]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/imap/serv_imap.c
For the SSL-only ports, if crypto negotiation fails,
[citadel.git] / citadel / modules / imap / serv_imap.c
index 4d5feb063ec62c139ccd07b76141c166b94e2296..1454781aacde94685ed4e0d84f9800faadd65d56 100644 (file)
@@ -508,6 +508,7 @@ void imap_greeting(void)
  */
 void imaps_greeting(void) {
        CtdlModuleStartCryptoMsgs(NULL, NULL, NULL);
+       if (!CC->redirect_ssl) CC->kill_me = 1;         /* kill session if no crypto */
        imap_greeting();
 }
 
@@ -1582,16 +1583,19 @@ void imap_command_loop(void)
 }
 
 
+const char *CitadelServiceIMAP="IMAP";
+const char *CitadelServiceIMAPS="IMAPS";
+
 /*
  * This function is called to register the IMAP extension with Citadel.
  */
 CTDL_MODULE_INIT(imap)
 {
        CtdlRegisterServiceHook(config.c_imap_port,
-                               NULL, imap_greeting, imap_command_loop, NULL);
+                               NULL, imap_greeting, imap_command_loop, NULL, CitadelServiceIMAP);
 #ifdef HAVE_OPENSSL
        CtdlRegisterServiceHook(config.c_imaps_port,
-                               NULL, imaps_greeting, imap_command_loop, NULL);
+                               NULL, imaps_greeting, imap_command_loop, NULL, CitadelServiceIMAPS);
 #endif
        CtdlRegisterSessionHook(imap_cleanup_function, EVT_STOP);