1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 09:08:49 -05:00

Merge pull request #323 from jca02266/adapt_broken_server

Adapt broken pop3 server
This commit is contained in:
cketti 2013-07-07 19:43:55 -07:00
commit 306b258f25

View File

@ -567,8 +567,13 @@ public class Pop3Store extends Store {
Pop3Message message = mMsgNumToMsgMap.get(msgNum);
if (message == null) {
String response = executeSimpleCommand(UIDL_COMMAND + " " + msgNum);
int uidIndex = response.lastIndexOf(' ');
String msgUid = response.substring(uidIndex + 1);
// response = "+OK msgNum msgUid"
String[] uidParts = response.split(" +");
if (uidParts.length < 3 || !"+OK".equals(uidParts[0])) {
Log.e(K9.LOG_TAG, "ERR response: " + response);
return;
}
String msgUid = uidParts[2];
message = new Pop3Message(msgUid, this);
indexMessage(msgNum, message);
}
@ -642,7 +647,7 @@ public class Pop3Store extends Store {
if (response.equals(".")) {
break;
}
String[] uidParts = response.split(" ");
String[] uidParts = response.split(" +");
// Ignore messages without a unique-id
if (uidParts.length >= 2) {