/* Don't do this stuff if this is not a POP3 session! */
if (CC->h_command_function != pop3_command_loop) return;
- lprintf(CTDL_DEBUG, "Performing POP3 cleanup hook\n");
+ CtdlLogPrintf(CTDL_DEBUG, "Performing POP3 cleanup hook\n");
if (POP3->msgs != NULL) free(POP3->msgs);
free(POP3);
strcpy(username, argbuf);
striplt(username);
- /* lprintf(CTDL_DEBUG, "Trying <%s>\n", username); */
+ /* CtdlLogPrintf(CTDL_DEBUG, "Trying <%s>\n", username); */
if (CtdlLoginExistingUser(NULL, username) == login_ok) {
cprintf("+OK Password required for %s\r\n", username);
}
CC->redirect_buffer = malloc(SIZ);
CC->redirect_len = 0;
CC->redirect_alloc = SIZ;
- CtdlOutputMsg(msgnum, MT_RFC822, HEADERS_ALL, 0, 1, NULL);
+ CtdlOutputMsg(msgnum, MT_RFC822, HEADERS_ALL, 0, 1, NULL, SUPPRESS_ENV_TO);
smi.meta_rfc822_length = CC->redirect_len;
free(CC->redirect_buffer);
CC->redirect_buffer = NULL;
if (msgs >= 0) {
cprintf("+OK %s is logged in (%d messages)\r\n",
CC->user.fullname, msgs);
- lprintf(CTDL_NOTICE, "POP3 authenticated %s\n", CC->user.fullname);
+ CtdlLogPrintf(CTDL_NOTICE, "POP3 authenticated %s\n", CC->user.fullname);
}
else {
cprintf("-ERR Can't open your mailbox\r\n");
strcpy(password, argbuf);
striplt(password);
- /* lprintf(CTDL_DEBUG, "Trying <%s>\n", password); */
+ /* CtdlLogPrintf(CTDL_DEBUG, "Trying <%s>\n", password); */
if (CtdlTryPassword(password) == pass_ok) {
pop3_login();
}
}
cprintf("+OK Message %d:\r\n", which_one);
- CtdlOutputMsg(POP3->msgs[which_one - 1].msgnum, MT_RFC822, HEADERS_ALL, 0, 1, NULL);
+ CtdlOutputMsg(POP3->msgs[which_one - 1].msgnum,
+ MT_RFC822, HEADERS_ALL, 0, 1, NULL,
+ (ESC_DOT|SUPPRESS_ENV_TO)
+ );
cprintf(".\r\n");
}
CC->redirect_buffer = malloc(SIZ);
CC->redirect_len = 0;
CC->redirect_alloc = SIZ;
- CtdlOutputMsg(POP3->msgs[which_one - 1].msgnum,
- MT_RFC822, HEADERS_ALL, 0, 1, NULL);
+ CtdlOutputMsg(POP3->msgs[which_one - 1].msgnum, MT_RFC822, HEADERS_ALL, 0, 1, NULL, SUPPRESS_ENV_TO);
msgtext = CC->redirect_buffer;
CC->redirect_buffer = NULL;
CC->redirect_len = 0;
time(&CC->lastcmd);
memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
if (client_getln(cmdbuf, sizeof cmdbuf) < 1) {
- lprintf(CTDL_ERR, "Client disconnected: ending session.\r\n");
+ CtdlLogPrintf(CTDL_ERR, "Client disconnected: ending session.\r\n");
CC->kill_me = 1;
return;
}
if (!strncasecmp(cmdbuf, "PASS", 4)) {
- lprintf(CTDL_INFO, "POP3: PASS...\r\n");
+ CtdlLogPrintf(CTDL_INFO, "POP3: PASS...\r\n");
}
else {
- lprintf(CTDL_INFO, "POP3: %s\r\n", cmdbuf);
+ CtdlLogPrintf(CTDL_INFO, "POP3: %s\r\n", cmdbuf);
}
while (strlen(cmdbuf) < 5) strcat(cmdbuf, " ");
else if (!CC->logged_in) {
cprintf("-ERR Not logged in.\r\n");
}
+
+ else if (CC->nologin) {
+ cprintf("-ERR System busy, try later.\r\n");
+ CC->kill_me = 1;
+ }
else if (!strncasecmp(cmdbuf, "LIST", 4)) {
pop3_list(&cmdbuf[5]);