X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fmodules%2Fimap%2Fserv_imap.c;fp=citadel%2Fmodules%2Fimap%2Fserv_imap.c;h=278cc73323392b3883c08ff8ee58b75d1b8fa163;hp=d49b8d85403a475907b781d5fb146bdd6a078fe7;hb=b26e3e79fcb15dc1b46f4c7710a6bafdc6472950;hpb=128563fad091fb8cb0a01bb5300ae7842c76f253 diff --git a/citadel/modules/imap/serv_imap.c b/citadel/modules/imap/serv_imap.c index d49b8d854..278cc7332 100644 --- a/citadel/modules/imap/serv_imap.c +++ b/citadel/modules/imap/serv_imap.c @@ -677,7 +677,11 @@ void imap_authenticate(int num_parms, ConstStr *Params) } if (!strcasecmp(Params[2].Key, "LOGIN")) { - CtdlEncodeBase64(UsrBuf, "Username:", 9, 0); + size_t len = CtdlEncodeBase64(UsrBuf, "Username:", 9, 0); + if (UsrBuf[len - 1] == '\n') { + UsrBuf[len - 1] = '\0'; + } + IAPrintf("+ %s\r\n", UsrBuf); IMAP->authstate = imap_as_expecting_username; strcpy(IMAP->authseq, Params[0].Key); @@ -685,7 +689,10 @@ void imap_authenticate(int num_parms, ConstStr *Params) } if (!strcasecmp(Params[2].Key, "PLAIN")) { - // CtdlEncodeBase64(UsrBuf, "Username:", 9, 0); + // size_t len = CtdlEncodeBase64(UsrBuf, "Username:", 9, 0); + // if (UsrBuf[len - 1] == '\n') { + // UsrBuf[len - 1] = '\0'; + // } // IAPuts("+ %s\r\n", UsrBuf); IAPuts("+ \r\n"); IMAP->authstate = imap_as_expecting_plainauth; @@ -768,7 +775,11 @@ void imap_auth_login_user(long state) case imap_as_expecting_username: StrBufDecodeBase64(Imap->Cmd.CmdBuf); CtdlLoginExistingUser(NULL, ChrPtr(Imap->Cmd.CmdBuf)); - CtdlEncodeBase64(PWBuf, "Password:", 9, 0); + size_t len = CtdlEncodeBase64(PWBuf, "Password:", 9, 0); + if (PWBuf[len - 1] == '\n') { + PWBuf[len - 1] = '\0'; + } + IAPrintf("+ %s\r\n", PWBuf); Imap->authstate = imap_as_expecting_password;