Quoting Timo Sirainen:
The reason why the messages are read in the first place is because the message sizes need to be returned so that linefeeds are counted in CR+LF format, while they're typically stored in LF-only format. So if Dovecot just stat()ed the file and returned that as the message's size, it would be violating the POP3 spec. tpop3d seems to be doing that.
Oh. I would suggest a config switch (yes, yet another one) that tells dovecot to do the same. Most clients don't care about it, anyway, and if you tell your LDA to use crlf, dovecot would even do the right thing. It would also enable mail_save_crlf (we could even drop that one). Hm, how does dovecot know that a message contains crlf, so it can use sendfile instead of read/write? If you have some kind of simple autodetection, like "read the first line, if it contains crlf, assume all other lines also do", we already have some (non-optimized) form of that. I guess this also affects IMAP, right?