Thanks for the answer Bill!
I see this a behavior as a good feature, seems like gmail just mark the message as read when you download if via pop and the pop server consider this information at the time to serve clients, it looks a pretty clean solution for me.
I do agree that this is probably not compliant with pop3 protocol, but, sometimes you can break a RFC to serve a good service and sometimes a RFC is rewrited to agree with a good new feature (have a look in SIP evolution).
I will try to do a plugin for that when I have time!
Thanks!
That's almost always correct: normal client-based POP3 server retention is entirely dependent on clients that keep track of what messages they have or have not downloaded, and some POP3 servers also maintain a Status header so that multiple clients can look at the same message and know whether another client has already read it.
GMail goes a bit further, in a somewhat useful fashion. Their POP3 server acts mostly like an auto-deleting server: once a message has been retrieved by POP3, it will not be seen on later POP3 sessions, even though it is retained in the GMail Inbox. Mail deleted by a POP3 or IMAP client is removed from the Inbox, but remains in the "All Mail" dump as well as in whatever labelled collection it is in. Frankly, that behavior is positively weird and arguably dysfunctional from a POP3 perspective, but then POP3 really isn't designed with a server-based persistent mailstore in mind.
It is my understanding that there is widespread principled aversion to the Status header (which is understandable) so that's likely not to happen for Dovecot. The GMail message hiding for POP3 seems to me like a recipe for disaster for anyone not willing to provide essentially unlimited permanent storage for mail, since it effectively hides mail from POP3 users without deleting it.