From: Brian C. <B.C...@po...> - 2004-10-15 11:38:30
|
On Fri, Oct 15, 2004 at 11:20:28AM +0200, Matthias Andree wrote: > re-reading Rodolfo's fetchmail hang, it appears as though his POP3 > server is at fault. > > I've looked into the reliability of the SIZE information given by POP3 > servers, and the first one I checked, qmail-pop3d, failed horribly by > giving a size that is too short - we cannot use SIZE in POP3 to > determine how many bytes to read lest we risk reading only part of the > mail. ... and therefore losing command/response synchronisation. The end of a message in POP3 is determined by the sequence "CR LF . CR LF" and only by that. You are not permitted to perform "LIST n", look at the size returned, enter "RETR n", read exactly that number of bytes, and expect to be back in sync with the server at that point. qmail-pop3d gives a wrong size because it doesn't count end-of-line as two bytes; however using the size would not work anyway even if it did, because lines which start with the termination character use byte-stuffing but don't count it twice in the size (see RFC1939, section 11) line on server abcd\n RFC1939 size 6 (a b c d \r \n) Actual octets sent 6 (a b c d \r \n) line on server .abc\n RFC1939 size 6 (. a b c \r \n) Actual octets sent 7 (. . a b c \r \n) Regards, Brian. |