X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=imap%2Fauth_sasl.c;h=a68c9d427b4d6e10167e51aa6a4c99eab31b89f2;hb=6e997d9ff55a392658fddfda5b95742c98d7de0b;hp=574043577c17397440b1aee874e96681d27bcc18;hpb=6833ce8bdca2d64e14485118f2a4417b7e1cb1b1;p=apps%2Fmadmutt.git diff --git a/imap/auth_sasl.c b/imap/auth_sasl.c index 5740435..a68c9d4 100644 --- a/imap/auth_sasl.c +++ b/imap/auth_sasl.c @@ -116,12 +116,19 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA* idata, const char* method) irc = IMAP_CMD_CONTINUE; /* looping protocol */ - while (rc == SASL_CONTINUE) + while (rc == SASL_CONTINUE || olen > 0) { do irc = imap_cmd_step (idata); while (irc == IMAP_CMD_CONTINUE); + if (method && irc == IMAP_CMD_NO) + { + dprint (2, (debugfile, "imap_auth_sasl: %s failed\n", method)); + sasl_dispose (&saslconn); + return IMAP_AUTH_UNAVAIL; + } + if (irc == IMAP_CMD_BAD || irc == IMAP_CMD_NO) goto bail; @@ -180,6 +187,8 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA* idata, const char* method) mutt_socket_write (idata->conn, "*\r\n"); dprint (1, (debugfile, "imap_auth_sasl: sasl_client_step error %d\n",rc)); } + + olen = 0; } while (irc != IMAP_CMD_OK)