POP3->msgs[POP3->num_msgs-1].deleted = 0;
fp = tmpfile();
POP3->msgs[POP3->num_msgs-1].temp = fp;
- CtdlOutputMsg(msgnum, MT_RFC822, 0, 0, fp, 0, 1);
+
+ CtdlRedirectOutput(fp, -1);
+ CtdlOutputMsg(msgnum, MT_RFC822, 0, 0, 1);
+ CtdlRedirectOutput(NULL, -1);
+
POP3->msgs[POP3->num_msgs-1].rfc822_length = ftell(fp);
}
*/
void pop3_retr(char *argbuf) {
int which_one;
- int ch;
+ int ch = 0;
size_t bytes_remaining;
which_one = atoi(argbuf);
ch = getc(POP3->msgs[which_one - 1].temp);
cprintf("%c", ch);
}
+ if (ch != 10) {
+ lprintf(5, "Problem: message ends with 0x%2x, not 0x0a\n", ch);
+ }
cprintf(".\r\n");
}
char *Dynamic_Module_Init(void)
{
SYM_POP3 = CtdlGetDynamicSymbol();
- CtdlRegisterServiceHook(POP3_PORT,
+ CtdlRegisterServiceHook(config.c_pop3_port,
+ NULL,
pop3_greeting,
pop3_command_loop);
CtdlRegisterSessionHook(pop3_cleanup_function, EVT_STOP);