From 88de3aa407f15cb333caf267e50453ef4338d1fb Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 8 Apr 2000 06:34:15 +0000 Subject: Preauth fix. svn path=/trunk/; revision=2864 --- imap.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'imap.c') diff --git a/imap.c b/imap.c index 3e534cf3..66010957 100644 --- a/imap.c +++ b/imap.c @@ -130,14 +130,7 @@ int imap_ok(int sock, char *argbuf) while (isspace(*cp)) cp++; - if (strncmp(cp, "PREAUTH", 2) == 0) - { - if (argbuf) - strcpy(argbuf, cp); - preauth = TRUE; - return(PS_SUCCESS); - } - else if (strncmp(cp, "OK", 2) == 0) + if (strncmp(cp, "OK", 2) == 0) { if (argbuf) strcpy(argbuf, cp); @@ -860,7 +853,6 @@ int imap_getauth(int sock, struct query *ctl, char *greeting) /* probe to see if we're running IMAP4 and can use RFC822.PEEK */ capabilities[0] = '\0'; - preauth = FALSE; if ((ok = gen_transact(sock, "CAPABILITY")) == PS_SUCCESS) { /* UW-IMAP server 10.173 notifies in all caps */ @@ -898,11 +890,14 @@ int imap_getauth(int sock, struct query *ctl, char *greeting) expunge_period = 1; /* - * If either (a) we saw a PREAUTH token in the capability response, or + * If either (a) we saw a PREAUTH token in the greeting, or * (b) the user specified ssh preauthentication, then we're done. */ if (preauth || ctl->server.preauthenticate == A_SSH) - return(PS_SUCCESS); + { + preauth = FALSE; /* reset for the next session */ + return(PS_SUCCESS); + } /* * Handle idling. We depend on coming through here on startup -- cgit v1.2.3