/*
* IMAP server for the Citadel system
*
- * Copyright (C) 2000-2017 by Art Cancro and others.
+ * Copyright (C) 2000-2021 by Art Cancro and others.
* This code is released under the terms of the GNU General Public License.
*
* WARNING: the IMAP protocol is badly designed. No implementation of it
#include <pwd.h>
#include <errno.h>
#include <sys/types.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
+#include <time.h>
#include <sys/wait.h>
#include <ctype.h>
#include <string.h>
}
}
-void imap_cleanup(void)
-{
- DeleteHash(&ImapCmds);
-}
const imap_handler_hook *imap_lookup(int num_parms, ConstStr *Params)
{
return;
}
case 4:
- if (CtdlLoginExistingUser(NULL, Params[2].Key) == login_ok) {
+ if (CtdlLoginExistingUser(Params[2].Key) == login_ok) {
if (CtdlTryPassword(Params[3].Key, Params[3].len) == pass_ok) {
/* hm, thats not doable by IReply :-( */
IAPrintf("%s OK [", Params[0].Key);
Imap->authstate = imap_as_normal;
if (!IsEmptyStr(ident)) {
- result = CtdlLoginExistingUser(user, ident);
+ result = CtdlLoginExistingUser(ident);
}
else {
- result = CtdlLoginExistingUser(NULL, user);
+ result = CtdlLoginExistingUser(user);
}
if (result == login_ok) {
switch (state){
case imap_as_expecting_username:
StrBufDecodeBase64(Imap->Cmd.CmdBuf);
- CtdlLoginExistingUser(NULL, ChrPtr(Imap->Cmd.CmdBuf));
+ CtdlLoginExistingUser(ChrPtr(Imap->Cmd.CmdBuf));
size_t len = CtdlEncodeBase64(PWBuf, "Password:", 9, 0);
if (PWBuf[len - 1] == '\n') {
PWBuf[len - 1] = '\0';
return;
case imap_as_expecting_multilineusername:
extract_token(PWBuf, ChrPtr(Imap->Cmd.CmdBuf), 1, ' ', sizeof(PWBuf));
- CtdlLoginExistingUser(NULL, ChrPtr(Imap->Cmd.CmdBuf));
+ CtdlLoginExistingUser(ChrPtr(Imap->Cmd.CmdBuf));
IAPuts("+ go ahead\r\n");
Imap->authstate = imap_as_expecting_multilinepassword;
return;
NULL, imaps_greeting, imap_command_loop, NULL, CitadelServiceIMAPS);
#endif
CtdlRegisterSessionHook(imap_cleanup_function, EVT_STOP, PRIO_STOP + 30);
- CtdlRegisterCleanupHook(imap_cleanup);
}
/* return our module name for the log */