]> code.citadel.org Git - citadel.git/blobdiff - citadel/server/modules/pop3/serv_pop3.c
Remove preprocessor tests for OpenSSL. It's a requirement.
[citadel.git] / citadel / server / modules / pop3 / serv_pop3.c
index 322f2d826038834c47f55d21ef714339a75c98e9..d624cfe9e07ebf749efb40e488e42b3f2e04f84a 100644 (file)
 #include "../../ctdl_module.h"
 
 
-// This cleanup function blows away the temporary memory and files used by
-// the POP3 server.
+// This cleanup function blows away the temporary memory and files used by the POP3 server.
 void pop3_cleanup_function(void) {
-       /* Don't do this stuff if this is not a POP3 session! */
+       // Don't do this stuff if this is not a POP3 session!
        if (CC->h_command_function != pop3_command_loop) return;
 
        struct citpop3 *pop3 = ((struct citpop3 *)CC->session_specific_data);
@@ -78,13 +77,10 @@ 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 = KILLME_NO_CRYPTO;
-#else
-       CC->kill_me = KILLME_NO_CRYPTO;
-#endif
-
+       // kill the session if TLS is not running by now
+       if (!CC->redirect_ssl) {
+               CC->kill_me = KILLME_NO_CRYPTO;
+       }
        pop3_greeting();
 }
 
@@ -149,10 +145,10 @@ int pop3_grab_mailbox(void) {
 
        if (CtdlGetRoom(&CC->room, MAILROOM) != 0) return(-1);
 
-       /* Load up the messages */
+       // Load up the messages
        CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, NULL, pop3_add_message, NULL);
 
-       /* Figure out which are old and which are new */
+       // Figure out which are old and which are new
         CtdlGetRelationship(&vbuf, &CC->user, &CC->room);
        POP3->lastseen = (-1);
        if (POP3->num_msgs) for (i=0; i<POP3->num_msgs; ++i) {
@@ -516,11 +512,9 @@ void pop3_command_loop(void) {
                pop3_pass(&cmdbuf[5]);
        }
 
-#ifdef HAVE_OPENSSL
        else if (!strncasecmp(cmdbuf, "STLS", 4)) {
                pop3_stls();
        }
-#endif
 
        else if (!CC->logged_in) {
                cprintf("-ERR Not logged in.\r\n");
@@ -582,17 +576,15 @@ char *ctdl_module_init_pop3(void) {
                                        pop3_command_loop,
                                        NULL,
                                        CitadelServicePop3);
-#ifdef HAVE_OPENSSL
                CtdlRegisterServiceHook(CtdlGetConfigInt("c_pop3s_port"),
                                        NULL,
                                        pop3s_greeting,
                                        pop3_command_loop,
                                        NULL,
                                        CitadelServicePop3S);
-#endif
                CtdlRegisterSessionHook(pop3_cleanup_function, EVT_STOP, PRIO_STOP + 30);
        }
        
-       /* return our module name for the log */
+       // return our module name for the log
        return "pop3";
 }