$Log$
+ Revision 640.5 2005/02/13 04:55:18 ajc
+ * Did the server port hooks etc. for SSL listeners. For some reason it
+ doesn't work. :(
+
Revision 640.4 2005/02/13 04:23:59 ajc
* Added server and client configuration settings to specify port
numbers for IMAPS, POP3S, and SMTPS (SSL-encrypted services that start
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
int retval, bits, alg_bits;
if (!ssl_ctx) {
- cprintf("%s", nosup_response);
+ lprintf(CTDL_CRIT, "SSL failed: no ssl_ctx exists?\n");
+ if (nosup_response != NULL) cprintf("%s", nosup_response);
return;
}
if (!(CC->ssl = SSL_new(ssl_ctx))) {
lprintf(CTDL_CRIT, "SSL_new failed: %s\n",
ERR_reason_error_string(ERR_get_error()));
- cprintf("%s", error_response);
+ if (error_response != NULL) cprintf("%s", error_response);
return;
}
if (!(SSL_set_fd(CC->ssl, CC->client_socket))) {
ERR_reason_error_string(ERR_get_error()));
SSL_free(CC->ssl);
CC->ssl = NULL;
- cprintf("%s", error_response);
+ if (error_response != NULL) cprintf("%s", error_response);
return;
}
- cprintf("%s", ok_response);
+ if (ok_response != NULL) cprintf("%s", ok_response);
retval = SSL_accept(CC->ssl);
if (retval < 1) {
/*
config.c_fqdn);
}
+/*
+ * IMAPS is just like IMAP, except it goes crypto right away.
+ */
+#ifdef HAVE_OPENSSL
+void imaps_greeting(void) {
+ CtdlStartTLS(NULL, NULL, NULL);
+ imap_greeting();
+}
+#endif
+
/*
* implements the LOGIN command (ordinary username/password login)
{
CtdlRegisterServiceHook(config.c_imap_port,
NULL, imap_greeting, imap_command_loop, NULL);
+#ifdef HAVE_OPENSSL
+ CtdlRegisterServiceHook(config.c_imaps_port,
+ NULL, imaps_greeting, imap_command_loop, NULL);
+#endif
CtdlRegisterSessionHook(imap_cleanup_function, EVT_STOP);
return "$Id$";
}
}
+/*
+ * POP3S is just like POP3, except it goes crypto right away.
+ */
+#ifdef HAVE_OPENSSL
+void pop3s_greeting(void) {
+ CtdlStartTLS(NULL, NULL, NULL);
+ pop3_greeting();
+}
+#endif
+
+
+
/*
* Specify user name (implements POP3 "USER" command)
*/
pop3_greeting,
pop3_command_loop,
NULL);
+#ifdef HAVE_OPENSSL
+ CtdlRegisterServiceHook(config.c_pop3s_port,
+ NULL,
+ pop3s_greeting,
+ pop3_command_loop,
+ NULL);
+#endif
CtdlRegisterSessionHook(pop3_cleanup_function, EVT_STOP);
return "$Id$";
}
cprintf("220 %s ESMTP Citadel server ready.\r\n", config.c_fqdn);
}
+
+/*
+ * SMTPS is just like SMTP, except it goes crypto right away.
+ */
+#ifdef HAVE_OPENSSL
+void smtps_greeting(void) {
+ CtdlStartTLS(NULL, NULL, NULL);
+ smtp_greeting();
+}
+#endif
+
+
/*
* SMTP MSA port requires authentication.
*/
smtp_command_loop,
NULL);
+#ifdef HAVE_OPENSSL
+ CtdlRegisterServiceHook(config.c_smtps_port,
+ NULL,
+ smtps_greeting,
+ smtp_command_loop,
+ NULL);
+#endif
+
CtdlRegisterServiceHook(config.c_msa_port, /* SMTP MSA */
NULL,
smtp_msa_greeting,