From 01d2247ffda5c35b462d5c3e22a01809d9eb8213 Mon Sep 17 00:00:00 2001 From: Joe Steele Date: Sat, 8 Mar 2014 18:41:43 -0500 Subject: [PATCH] Change POP3 error response detection Instead of interpreting a "-" at the beginning of a line as an error response, consider the absence of a "+" at the beginning of a line as an error response. This is what Thunderbird does. http://hg.mozilla.org/releases/comm-esr24/file/55e96a433bd1/mailnews/local/src/nsPop3Protocol.cpp#l1177 The problem arises with godaddy servers spewing additional lines of data upon login failure. The login was being interpreted as successful, and a STAT commanded was subsequently being sent, resulting in a dialog saying 'Cannot connect to server. (Invalid int: "auth_error:")'. $ openssl s_client -quiet -crlf -connect pop.secureserver.net:995 ... +OK <24984.1394317012@pop.secureserver.net> user testuser +OK pass testpass testuser not found in the auth database warning: auth_error: authorization failed (no such object) -ERR authorization failed Check your server settings. --- src/com/fsck/k9/mail/store/Pop3Store.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/fsck/k9/mail/store/Pop3Store.java b/src/com/fsck/k9/mail/store/Pop3Store.java index f50187a36..3f6d5e9dc 100644 --- a/src/com/fsck/k9/mail/store/Pop3Store.java +++ b/src/com/fsck/k9/mail/store/Pop3Store.java @@ -1113,7 +1113,7 @@ public class Pop3Store extends Store { } String response = readLine(); - if (response.length() > 1 && response.charAt(0) == '-') { + if (response.length() == 0 || response.charAt(0) != '+') { throw new Pop3ErrorResponse(response); }