path: root/comsat
diff options
authorSergey Poznyakoff <>2011-11-04 21:30:38 +0200
committerSergey Poznyakoff <>2011-11-04 21:44:56 +0200
commite1233d5516f48cd7d786a69d4eebd40e73d95d45 (patch)
tree38692d813e645ac60bfababee4c5f7ec7f8cede9 /comsat
parentbad3c6c3a982f65af0fe137d1e5b7a98d13bb9d5 (diff)
Implement pop3s and imap4s in respective servers.
* comsat/comsat.c (comsat_prefork,comsat_connection): Change signatures. * imap4d/imap4d.c: Implement imaps. * imap4d/imap4d.h (io_setio): Change signature. (tls_encryption_on): New proto. * imap4d/io.c (io_setio): Change signature. Initialize TLS stream if requested. * imap4d/starttls.c (tls_encryption_on): New function. * include/mailutils/server.h (mu_srv_config): New struct. (mu_m_server_conn_fp, mu_m_server_prefork_fp): Remove typedefs. (mu_m_server_handler_fp): New typedef. (mu_m_server_set_conn): Change signature. (mu_m_server_set_prefork): Change signature. (mu_m_server_set_app_data_size) (mu_m_server_set_config_size): New prototype. (mu_m_server_cfg_init): Change signature. * include/mailutils/tls.h (mu_init_tls_libs): Change signature. * lib/tcpwrap.c: Include tcpwrap.h (mu_tcp_wrapper_daemon): Fix declaration. (mu_tcp_wrapper_prefork): Change signature. * lib/tcpwrap.h (mu_tcp_wrapper_prefork): Change signature * libmailutils/server/msrv.c (_mu_m_server) <conn,prefork>: Change data type. All uses updated. <app_data_size>: New member. (m_srv_config): Remove struct. Replaced with mu_srv_config from tls.h (mu_m_server_set_conn): Change signature. (mu_m_server_set_prefork): Change signature. (mu_m_server_set_app_data_size) (mu_m_server_set_config_size): New functions. (add_server): Allocate app_data_size additional bytes of data. (mu_m_server_cfg_init): Take one argument. * libmu_auth/tls.c (mu_tls_module_init): Update call to mu_init_tls_libs. Don't call mu_file_safety_check with NULL argument. (mu_init_tls_libs): Rewrite. Prepare x509 here, instead of doing it each time a TLS stream is created. (mu_deinit_tls_libs): Free x509, if exists. (_tls_server_open): Update call to mu_init_tls_libs. Remove x509 initialization. * libmu_cfg/tls.c (cb2_safety_checks): Fix typos. * maidag/lmtp.c (lmtp_connection): Change signature. * maidag/maidag.c (main): Update call to mu_m_server_cfg_init. * maidag/maidag.h (lmtp_connection): Change signature. * pop3d/extra.c (pop3d_setio): Initialize TLS stream, if requested. * pop3d/pop3d.c: Implement pops. * pop3d/pop3d.h (pop3d_setio): Change prototype.
Diffstat (limited to 'comsat')
1 files changed, 8 insertions, 8 deletions
diff --git a/comsat/comsat.c b/comsat/comsat.c
index e9a5a220c..ec73d52a1 100644
--- a/comsat/comsat.c
+++ b/comsat/comsat.c
@@ -320,7 +320,8 @@ static unsigned overflow_count = 0; /* Number of overflows detected during
the current interval */
-comsat_prefork (int fd, void *data, struct sockaddr *s, int size)
+comsat_prefork (int fd, struct sockaddr *s, int size,
+ struct mu_srv_config *pconf, void *data)
int retval = 0;
time_t now;
@@ -367,15 +368,14 @@ comsat_prefork (int fd, void *data, struct sockaddr *s, int size)
comsat_connection (int fd, struct sockaddr *sa, int salen,
- void *data, mu_ip_server_t srv,
- time_t to, int transcript)
+ struct mu_srv_config *pconf, void *data)
char *buffer;
size_t rdlen, size;
- if (mu_udp_server_get_rdata (srv, &buffer, &rdlen))
+ if (mu_udp_server_get_rdata (pconf->tcpsrv, &buffer, &rdlen))
return 0;
- if (transcript)
+ if (pconf->transcript)
char *p = mu_sockaddr_to_astr (sa, salen);
mu_diag_output (MU_DIAG_INFO,
@@ -386,10 +386,10 @@ comsat_connection (int fd, struct sockaddr *sa, int salen,
mu_diag_output (MU_DIAG_INFO, "string: %s", buffer);
free (p);
- mu_udp_server_get_bufsize (srv, &size);
+ mu_udp_server_get_bufsize (pconf->tcpsrv, &size);
if (size < rdlen + 1)
- int rc = mu_udp_server_set_bufsize (srv, rdlen + 1);
+ int rc = mu_udp_server_set_bufsize (pconf->tcpsrv, rdlen + 1);
if (rc)
mu_error (_("cannot resize buffer: %s"), mu_strerror (rc));
@@ -560,7 +560,7 @@ main (int argc, char **argv)
mu_argp_init (NULL, NULL);
comsat_init ();
mu_acl_cfg_init ();
- mu_m_server_cfg_init ();
+ mu_m_server_cfg_init (NULL);
mu_m_server_create (&server, program_version);
mu_m_server_set_type (server, MU_IP_UDP);
mu_m_server_set_conn (server, comsat_connection);

Return to:

Send suggestions and report system problems to the System administrator.