summaryrefslogtreecommitdiff
path: root/imap/src/c-client/smtp.c
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2019-10-27 17:57:47 -0600
committerEduardo Chappa <chappa@washington.edu>2019-10-27 17:57:47 -0600
commitbb598d500bcce509fa48ee7134ae632459cf1735 (patch)
tree929c543cce35544924f189e3c667084154ceee61 /imap/src/c-client/smtp.c
parentfe5ffafc188fe02e8a8c11dad1b8747f0ac17ff2 (diff)
downloadalpine-bb598d500bcce509fa48ee7134ae632459cf1735.tar.xz
* Fix a bug in commit 418e8bc5789d... which made Alpine ignore a challenge
during authentication using CRAM-MD5. The intention was to ignore the challenge in the PLAIN authentication. This made Alpine fail to authenticate when using the CRAM-MD5 authenticator. Reported by Stefan Mueller.
Diffstat (limited to 'imap/src/c-client/smtp.c')
-rw-r--r--imap/src/c-client/smtp.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/imap/src/c-client/smtp.c b/imap/src/c-client/smtp.c
index c79d9cfb..d1c9a7cb 100644
--- a/imap/src/c-client/smtp.c
+++ b/imap/src/c-client/smtp.c
@@ -357,14 +357,12 @@ void *smtp_challenge (void *s,unsigned long *len)
char tmp[MAILTMPLEN];
void *ret = NIL;
SENDSTREAM *stream = (SENDSTREAM *) s;
- if (stream->replycode == SMTPAUTHREADY){
- if(!(ret = rfc822_base64 ((unsigned char *) stream->reply + 4,
+ if ((stream->replycode == SMTPAUTHREADY) &&
+ !(ret = rfc822_base64 ((unsigned char *) stream->reply + 4,
strlen (stream->reply + 4),len))) {
- sprintf (tmp,"SMTP SERVER BUG (invalid challenge, continuing): %.80s",stream->reply+4);
- mm_log (tmp,ERROR);
- ret = cpystr(""); /* This is silly: fake a reply, it will be ignored */
- }
- *len = 0L; /* This is even sillier, fake challenge is empty... */
+ sprintf (tmp,"SMTP SERVER BUG (invalid challenge, continuing): %.80s",stream->reply+4);
+ mm_log (tmp,ERROR);
+ ret = cpystr(""); /* This is silly: fake a reply, it will be ignored */
}
return ret;
}