/*
* POP3 service for the Citadel system
*
- * Copyright (c) 1998-2012 by the citadel.org team
+ * Copyright (c) 1998-2015 by the citadel.org team
*
- * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3.
- *
- *
+ * This program is open source software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- *
- *
- *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
* Current status of standards conformance:
*
/* Don't do this stuff if this is not a POP3 session! */
if (CCC->h_command_function != pop3_command_loop) return;
+ struct citpop3 *pop3 = ((struct citpop3 *)CCC->session_specific_data);
POP3M_syslog(LOG_DEBUG, "Performing POP3 cleanup hook");
- if (POP3->msgs != NULL) free(POP3->msgs);
+ if (pop3->msgs != NULL) {
+ free(pop3->msgs);
+ }
- free(POP3);
+ free(pop3);
}
/* Set last read pointer */
if (POP3->num_msgs > 0) {
- CtdlGetUserLock(&CCC->user, CCC->curr_user);
+ CtdlLockGetCurrentUser();
CtdlGetRelationship(&vbuf, &CCC->user, &CCC->room);
snprintf(vbuf.v_seen, sizeof vbuf.v_seen, "*:%ld",
POP3->msgs[POP3->num_msgs-1].msgnum);
CtdlSetRelationship(&vbuf, &CCC->user, &CCC->room);
- CtdlPutUserLock(&CCC->user);
+ CtdlPutCurrentUserLock();
}
}
{
CtdlRegisterDebugFlagHook(HKEY("pop3srv"), SetPOP3DebugEnabled, &POP3DebugEnabled);
- CtdlRegisterServiceHook(config.c_pop3_port,
+ CtdlRegisterServiceHook(CtdlGetConfigInt("c_pop3_port"),
NULL,
pop3_greeting,
pop3_command_loop,
NULL,
CitadelServicePop3);
#ifdef HAVE_OPENSSL
- CtdlRegisterServiceHook(config.c_pop3s_port,
+ CtdlRegisterServiceHook(CtdlGetConfigInt("c_pop3s_port"),
NULL,
pop3s_greeting,
pop3_command_loop,