X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fimap%2Fserv_imap.c;h=3bc08c213502919294dcffe5a08b3489f43edd52;hb=8e944083763c9ddcb32d763cf8f19c966d01f873;hp=33a3f3ba7a34c26142b828116253b9d484d19564;hpb=320f2c1b46a08add1e866be64a101329932b98d6;p=citadel.git diff --git a/citadel/modules/imap/serv_imap.c b/citadel/modules/imap/serv_imap.c index 33a3f3ba7..3bc08c213 100644 --- a/citadel/modules/imap/serv_imap.c +++ b/citadel/modules/imap/serv_imap.c @@ -1,7 +1,7 @@ /* * 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 @@ -90,10 +90,6 @@ void registerImapCMD(const char *First, long FLen, } } -void imap_cleanup(void) -{ - DeleteHash(&ImapCmds); -} const imap_handler_hook *imap_lookup(int num_parms, ConstStr *Params) { @@ -628,7 +624,7 @@ void imap_login(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); @@ -638,12 +634,13 @@ void imap_login(int num_parms, ConstStr *Params) } else { - IReplyPrintf("NO AUTHENTICATE %s failed", - Params[3].Key); + IReplyPrintf("NO AUTHENTICATE %s failed", Params[3].Key); + return; } } IReply("BAD Login incorrect"); + return; default: IReply("BAD incorrect number of parameters"); return; @@ -743,10 +740,10 @@ void imap_auth_plain(void) 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) { @@ -767,7 +764,7 @@ void imap_auth_login_user(long state) 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'; @@ -779,7 +776,7 @@ void imap_auth_login_user(long state) 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; @@ -1737,7 +1734,6 @@ CTDL_MODULE_INIT(imap) 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 */