diff --git a/src/com/fsck/k9/mail/store/Pop3Store.java b/src/com/fsck/k9/mail/store/Pop3Store.java index 420878874..3f4319206 100644 --- a/src/com/fsck/k9/mail/store/Pop3Store.java +++ b/src/com/fsck/k9/mail/store/Pop3Store.java @@ -456,7 +456,22 @@ public class Pop3Store extends Store { if (response.equals(".")) { break; } - String[] uidParts = response.split(" "); + + /* + * Yet another work-around for buggy server software: + * Replace every occurence of multiple spaces with exactly one space. This way + * the String.split() call below will have the desired effect, i.e. split the + * response into message number and unique identifier. + * + * Example for a malformed response: + * 1 2011071307115510400ae3e9e00bmu9 + * + * Note the three spaces between message number and unique identifier. + * See issue 3546 + */ + String cleanedResponse = response.replaceAll(" +", " "); + + String[] uidParts = cleanedResponse.split(" "); if ((uidParts.length >= 3) && "+OK".equals(uidParts[0])) { /* * At least one server software places a "+OK" in