We've run a custom pop3 server without problems for many years. But now some clients are trying to use iPhones and there is some mysterious incompatibility. For emails over a certain size (for tests we use around 32K) the iPhone just retrieves headers and the first 40 lines using the
TOP command. It displays those lines, "This message is only partially downloaded", and a button to "Download remaining".
With our server it never retrieves the full message. Hitting "Download remaining" just sends a
STAT command. With a test server running the Dovecot pop3 server it sends a
RETR command as expected and displays the full message. I've also monitored the protocol exchange with a test AOL account which works as expected.
I obviously don't expect anyone to debug our pop3 server code but does anyone have a clue as to what the iPhone might be seeing that would make it behave this way - never sending the
RETR? I've compared the protocol exchanges and can see no practical difference between the servers that work and ours. I've checked the message format (header lines + blank line + message body + single period on a line to terminate) many times.
Here is the protocol exchange for our server:
+OK MultiBase POP3 Server Ready USER email@example.com +OK Name is a valid mailbox PASS a +OK Mailbox locked and ready STAT +OK 1 34572 UIDL +OK 1 20110607123720000006 . LIST +OK 1 messages (34572) 1 34572 . TOP 1 40 +OK message top follows [--message headers + 40 lines--] . [--Download remaining button hit--] STAT +OK 1 34572
Here is the protocol exchange for the Dovecot server:
+OK Dovecot ready. USER stuff +OK PASS a +OK Logged in. STAT +OK 1 34732 UIDL +OK 1 000000014dee8328 . LIST +OK 1 messages: 1 34732 . TOP 1 40 +OK [--message headers + 40 lines--] . [--Download remaining button hit--] STAT +OK 1 34732 RETR 1 +OK 34732 octets [--full message--] .
The iPhone seems to have the habit of not closing the connection any time soon so that's why there's no
QUIT command in these exchanges.
Any suggestions or clues greatly appreciated.