#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);
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();
}
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) {
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");
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";
}