HUGE PATCH. This moves all of mime_parser.c and all
[citadel.git] / citadel / modules / pop3 / serv_pop3.c
index ba2faa1e1009ba4ac6190e221d094303818e9bb7..6aaa628a4cdd236eb535787b327c3e3d8ddc124e 100644 (file)
@@ -41,6 +41,7 @@
 #include <string.h>
 #include <limits.h>
 #include <ctype.h>
+#include <libcitadel.h>
 #include "citadel.h"
 #include "server.h"
 #include "citserver.h"
@@ -51,7 +52,6 @@
 #include "policy.h"
 #include "database.h"
 #include "msgbase.h"
-#include "tools.h"
 #include "internet_addressing.h"
 #include "serv_pop3.h"
 #include "md5.h"
@@ -98,6 +98,14 @@ void pop3_greeting(void) {
  */
 void pop3s_greeting(void) {
        CtdlModuleStartCryptoMsgs(NULL, NULL, NULL);
+
+/* kill session if no crypto */
+#ifdef HAVE_OPENSSL
+       if (!CC->redirect_ssl) CC->kill_me = 1;
+#else
+       CC->kill_me = 1;
+#endif
+
        pop3_greeting();
 }
 
@@ -702,6 +710,8 @@ void pop3_command_loop(void) {
 
 }
 
+const char *CitadelServicePop3="POP3";
+const char *CitadelServicePop3S="POP3S";
 
 
 CTDL_MODULE_INIT(pop3)
@@ -710,13 +720,15 @@ CTDL_MODULE_INIT(pop3)
                                NULL,
                                pop3_greeting,
                                pop3_command_loop,
-                               NULL);
+                               NULL,
+                               CitadelServicePop3);
 #ifdef HAVE_OPENSSL
        CtdlRegisterServiceHook(config.c_pop3s_port,
                                NULL,
                                pop3s_greeting,
                                pop3_command_loop,
-                               NULL);
+                               NULL,
+                               CitadelServicePop3S);
 #endif
        CtdlRegisterSessionHook(pop3_cleanup_function, EVT_STOP);