diff options
author | Eduardo Chappa <chappa@washington.edu> | 2020-06-26 12:30:31 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2020-06-26 12:30:31 -0600 |
commit | 40e5221e67e620c84350331aa4f273bcd88d25de (patch) | |
tree | 3dd045a8316ef9024c389667b75010156077efc7 /imap/src | |
parent | bf45b81b973d2290e9f9852b09fc700278598339 (diff) | |
download | alpine-40e5221e67e620c84350331aa4f273bcd88d25de.tar.xz |
* When Alpine starts a PREAUTH connection, it might still ask the user
to login. Reported by Frank Tobin.
Diffstat (limited to 'imap/src')
-rw-r--r-- | imap/src/c-client/imap4r1.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/imap/src/c-client/imap4r1.c b/imap/src/c-client/imap4r1.c index 4991f85e..db3f1190 100644 --- a/imap/src/c-client/imap4r1.c +++ b/imap/src/c-client/imap4r1.c @@ -800,7 +800,7 @@ long imap_status (MAILSTREAM *stream,char *mbx,long flags) MAILSTREAM *imap_open (MAILSTREAM *stream) { - unsigned long i,j; + unsigned long i,j, preauthed; char *s,tmp[MAILTMPLEN],usr[MAILTMPLEN]; NETMBX mb; IMAPPARSEDREPLY *reply = NIL; @@ -891,8 +891,9 @@ MAILSTREAM *imap_open (MAILSTREAM *stream) return NIL; /* lost during greeting */ } + preauthed = !strcmp (reply->key,"PREAUTH"); /* STARTTLS is not allowed in PREAUTH state */ - if (LOCAL->netstream && !strcmp (reply->key,"PREAUTH")){ + if (LOCAL->netstream && preauthed){ sslstart_t stls = (sslstart_t) mail_parameters (NIL,GET_SSLSTART,NIL); if (!LOCAL->gotcapability) imap_capability (stream); if (LOCAL->netstream @@ -902,7 +903,7 @@ MAILSTREAM *imap_open (MAILSTREAM *stream) } } /* if connected and not preauthenticated */ - if (LOCAL->netstream && strcmp (reply->key,"PREAUTH")) { + if (LOCAL->netstream && !preauthed) { sslstart_t stls = (sslstart_t) mail_parameters (NIL,GET_SSLSTART,NIL); /* get server capabilities */ if (!LOCAL->gotcapability) imap_capability (stream); |