]> granicus.if.org Git - curl/commitdiff
pop3: Fixed auth preference not being honored when CAPA not supported
authorSteve Holme <steve_holme@hotmail.com>
Tue, 24 Dec 2013 22:35:55 +0000 (22:35 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Tue, 24 Dec 2013 22:49:36 +0000 (22:49 +0000)
If a user indicated they preferred to authenticate using APOP or a SASL
mechanism, but neither were supported by the server, curl would always
fall back to clear text when CAPA wasn't supported, even though the
user didn't want to use this.

This also fixes the auto build failure caused by commit 6f2d5f0562f64a.

lib/pop3.c

index 5ea50e36974590d05c50db661efa1dccc3bfbc19..2716cec65fecd16fad7bb0028713f9719c08937f 100644 (file)
@@ -780,8 +780,12 @@ static CURLcode pop3_state_capa_resp(struct connectdata *conn, int pop3code,
     else
       result = pop3_perform_authentication(conn);
   }
-  else
-    result = pop3_perform_user(conn);
+  else {
+    /* Clear text is supported when CAPA isn't recognised */
+    pop3c->authtypes |= POP3_TYPE_CLEARTEXT;
+
+    result = pop3_perform_authentication(conn);
+  }
 
   return result;
 }