1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 17:18:50 -05:00

Work-around for a buggy POP3 server software that places "+OK" in front of every line of the unique-id listing (UIDL response).

Fixes issue 1237
This commit is contained in:
cketti 2010-03-25 13:42:48 +00:00
parent 938317e700
commit d595033fa8

View File

@ -513,6 +513,18 @@ public class Pop3Store extends Store
break; break;
} }
String[] uidParts = response.split(" "); String[] uidParts = response.split(" ");
if ((uidParts.length >= 3) && "+OK".equals(uidParts[0]))
{
/*
* At least one server software places a "+OK" in
* front of every line in the unique-id listing.
*
* Fix up the array if we detected this behavior.
* See Issue 1237
*/
uidParts[0] = uidParts[1];
uidParts[1] = uidParts[2];
}
if (uidParts.length >= 2) if (uidParts.length >= 2)
{ {
Integer msgNum = Integer.valueOf(uidParts[0]); Integer msgNum = Integer.valueOf(uidParts[0]);