1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-26 01:28:50 -05:00

adapt to a corner case for broken server.

This commit is contained in:
Koji Arai 2013-06-29 22:28:27 +09:00
parent 35c79a5656
commit b88fbb7fd8

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);
}