From 0162c9f5b88fd41823e46dee2d73979e72cae164 Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Thu, 27 Jun 2002 03:51:51 +0000 Subject: [PATCH] Oswald Buddenhagen * fix imap_open() brokeness with PREAUTH (missed hunk from previous patch) --- imap.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/imap.c b/imap.c index 34d4379..85bda5c 100644 --- a/imap.c +++ b/imap.c @@ -685,36 +685,36 @@ imap_open (config_t * box, unsigned int minuid, imap_t * imap, int flags) do { - /* read the greeting string */ - if (buffer_gets (imap->buf, &rsp)) - { - puts ("Error, no greeting response"); - ret = -1; - break; - } - if (Verbose) - puts (rsp); - arg = next_arg (&rsp); - if (!arg || *arg != '*' || (arg = next_arg (&rsp)) == NULL) - { - puts ("Error, invalid greeting response"); - ret = -1; - break; - } - if (!strcmp ("PREAUTH", arg)) - preauth = 1; - else if (strcmp ("OK", arg) != 0) - { - puts ("Error, unknown greeting response"); - ret = -1; - break; - } - /* if we are reusing the existing connection, we can skip the * authentication steps. */ if (!reuse) { + /* read the greeting string */ + if (buffer_gets (imap->buf, &rsp)) + { + puts ("Error, no greeting response"); + ret = -1; + break; + } + if (Verbose) + puts (rsp); + arg = next_arg (&rsp); + if (!arg || *arg != '*' || (arg = next_arg (&rsp)) == NULL) + { + puts ("Error, invalid greeting response"); + ret = -1; + break; + } + if (!strcmp ("PREAUTH", arg)) + preauth = 1; + else if (strcmp ("OK", arg) != 0) + { + puts ("Error, unknown greeting response"); + ret = -1; + break; + } + #if HAVE_LIBSSL if (box->use_imaps) use_ssl = 1;