Commit 352b446b 352b446baa6e2e7b8aa29d8aac449aecbf946dab by Sergey Poznyakoff

Implement global transcript settings in imap4d and pop3d.

* imap4d/imap4d.c (imap4d_cfg_param): New global
statement 'transcript'.
(imap4d_connection): The transcript parameter overrides
global imap4d_transcript settings.
* pop3d/pop3d.c (pop3d_cfg_param, pop3d_connection): Likewise.
1 parent bc4fde46
...@@ -341,6 +341,8 @@ static struct mu_cfg_param imap4d_cfg_param[] = { ...@@ -341,6 +341,8 @@ static struct mu_cfg_param imap4d_cfg_param[] = {
341 N_("List of fields to return in response to ID command.") }, 341 N_("List of fields to return in response to ID command.") },
342 { ".server", mu_cfg_section, NULL, 0, NULL, 342 { ".server", mu_cfg_section, NULL, 0, NULL,
343 N_("Server configuration.") }, 343 N_("Server configuration.") },
344 { "transcript", mu_cfg_bool, &imap4d_transcript, 0, NULL,
345 N_("Set global transcript mode.") },
344 TCP_WRAPPERS_CONFIG 346 TCP_WRAPPERS_CONFIG
345 { NULL } 347 { NULL }
346 }; 348 };
...@@ -473,6 +475,7 @@ imap4d_connection (int fd, struct sockaddr *sa, int salen, void *data, ...@@ -473,6 +475,7 @@ imap4d_connection (int fd, struct sockaddr *sa, int salen, void *data,
473 mu_ip_server_t srv, time_t timeout, int transcript) 475 mu_ip_server_t srv, time_t timeout, int transcript)
474 { 476 {
475 idle_timeout = timeout; 477 idle_timeout = timeout;
478 if (imap4d_transcript != transcript)
476 imap4d_transcript = transcript; 479 imap4d_transcript = transcript;
477 imap4d_mainloop (fd, fdopen (fd, "r"), fdopen (fd, "w")); 480 imap4d_mainloop (fd, fdopen (fd, "r"), fdopen (fd, "w"));
478 return 0; 481 return 0;
......
...@@ -156,6 +156,8 @@ static struct mu_cfg_param pop3d_cfg_param[] = { ...@@ -156,6 +156,8 @@ static struct mu_cfg_param pop3d_cfg_param[] = {
156 #endif 156 #endif
157 { ".server", mu_cfg_section, NULL, 0, NULL, 157 { ".server", mu_cfg_section, NULL, 0, NULL,
158 N_("Server configuration.") }, 158 N_("Server configuration.") },
159 { "transcript", mu_cfg_bool, &pop3d_transcript, 0, NULL,
160 N_("Set global transcript mode.") },
159 TCP_WRAPPERS_CONFIG 161 TCP_WRAPPERS_CONFIG
160 { NULL } 162 { NULL }
161 }; 163 };
...@@ -379,6 +381,7 @@ pop3d_connection (int fd, struct sockaddr *sa, int salen, void *data, ...@@ -379,6 +381,7 @@ pop3d_connection (int fd, struct sockaddr *sa, int salen, void *data,
379 mu_ip_server_t srv, time_t timeout, int transcript) 381 mu_ip_server_t srv, time_t timeout, int transcript)
380 { 382 {
381 idle_timeout = timeout; 383 idle_timeout = timeout;
384 if (pop3d_transcript != transcript)
382 pop3d_transcript = transcript; 385 pop3d_transcript = transcript;
383 pop3d_mainloop (fd, fdopen (fd, "r"), fdopen (fd, "w")); 386 pop3d_mainloop (fd, fdopen (fd, "r"), fdopen (fd, "w"));
384 return 0; 387 return 0;
......