bertjohnson/OpaqueMail

fix for bad pop 3 server response

infinity7117 opened this issue · 1 comments

pop3 server responds with first line empty to "UIDL\r\n"

actual reply:
\n1 1490184700.13481.s1.xxx.xxx.xx,S=701\n2 1490184832.13551.s1.xxx.xxx.xx,S=701\n3 1490186235.14276.s1.xxx.xxx.xx,S=11843

interpreted reply:
{string[4]}
[0]: ""
[1]: "1 1490184700.13481.s1.xxx.xxx.xx,S=701"
[2]: "2 1490184832.13551.s1.xxx.xxx.xx,S=701"
[3]: "3 1490186235.14276.s1.xxx.xxx.xx,S=11843"

The first empty string causes an exeption in the next foreach loop, at Pop3Client.cs, line 658.

Recomend fix the above line 653
string[] responseLines = response.Split('\n');
with
string[] responseLines = response.Split('\n').Where(w => !string.IsNullOrEmpty(w)).ToArray()

or similar :D

EDIT

sorry for posting here as an issue, but direct editing the file did not work for me at the time.
now it did, i submitted the change

Thanks for the report! This is fixed with the 2.5.2 release.