summaryrefslogtreecommitdiff
path: root/imap/src/c-client/imap4r1.c
diff options
context:
space:
mode:
Diffstat (limited to 'imap/src/c-client/imap4r1.c')
-rw-r--r--imap/src/c-client/imap4r1.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/imap/src/c-client/imap4r1.c b/imap/src/c-client/imap4r1.c
index 7343122..344eada 100644
--- a/imap/src/c-client/imap4r1.c
+++ b/imap/src/c-client/imap4r1.c
@@ -1215,23 +1215,20 @@ long imap_auth (MAILSTREAM *stream,NETMBX *mb,char *tmp,char *usr)
ok = (*at->client) (imap_challenge,imap_response,base,"imap",mb,stream,
net_port(LOCAL->netstream),&trial,usr);
LOCAL->sensitive = NIL; /* unhide */
-
- if(base && ok && !trial){ /* return now or see below for the same code */
- mm_log ("IMAP Authentication cancelled",ERROR);
- return NIL;
- }
+ if(!base){
/* make sure have a response */
- if (!(reply = &LOCAL->reply)->tag)
- reply = imap_fake (stream,tag,
+ if (!(reply = &LOCAL->reply)->tag)
+ reply = imap_fake (stream,tag,
"[CLOSED] IMAP connection broken (authenticate)");
- else if (compare_cstring (reply->tag,tag))
- while (compare_cstring ((reply = imap_reply (stream,tag))->tag,tag))
- imap_soutr (stream,"*");
+ else if (compare_cstring (reply->tag,tag))
+ while (compare_cstring ((reply = imap_reply (stream,tag))->tag,tag))
+ imap_soutr (stream,"*");
/* good if SASL ok and success response */
- if (ok && imap_OK (stream,reply)){
- if(stream->auth.name) fs_give((void **) &stream->auth.name);
- stream->auth.name = cpystr(at->name); /* save method name */
- return T;
+ if (ok && imap_OK (stream,reply)){
+ if(stream->auth.name) fs_give((void **) &stream->auth.name);
+ stream->auth.name = cpystr(at->name); /* save method name */
+ return T;
+ }
}
if (!trial) { /* if main program requested cancellation */
mm_log ("IMAP Authentication cancelled",ERROR);