This post will attempt to describe the unique aspects of the POP3 implementation available in Gmail. Gmail was introduced with a very large quota for message storage and, from the beginning, could hold many, many messages. When POP3 access was provided, they needed to deal with the problem of scale. The solutions chosen are straightforward, but unexpected and can be confusing.
RFC1939, which describes the POP3 protocol, recognised the problems that the protocol had with scaling to large mailboxes, and made some specific suggestions for controlling the size. Gmail simulates two of these suggestions, depending how you access the account.
One of the suggestions is to limit the amount of time that messages can be retained on the server. Gmail simulates this with "recent mode". In this mode, Gmail's POP server provides a list of all messages added to the account in the last thirty days. Older messages do not appear in the POP server message list, so they appear, to the POP client, to have been deleted from the server. With recent mode, messages deleted by the client are moved to the Gmail Trash, and messages downloaded but not deleted are unchanged on the server. If the messages are not deleted within thirty days, they remain in the Gmail account, and can no longer be downloaded or deleted by the POP client.
Another suggestion is to delete the messages after they are downloaded, whether the client requests it or not. This is simulated by the default Gmail POP server mode, and is a little more complicated to describe. In this mode, a few hundred of the oldest "new" messages are added to the POP3 mailbox. I like to think of this as a download queue, and it has a limited number of slots. When the POP3 client downloads or deletes messages, they are removed from the queue, and the slots are filled by newer messages for the next session. When they are removed from the queue, the action chosen in Gmail's POP3 settings for "When messages are accessed via POP" is applied. Note that the email client can only delete messages from the queue, not from the Gmail mailbox, unless delete was chosen in the account settings in Gmail.
The next time the client connects, the previously downloaded messages are not listed, so they appear to have been deleted. If the session is lost before the client signs out, or the client does not download the entire message, the messages will remain in the queue until the client deletes them. If there are enough messages in the queue, it can slow down or stop the incoming messages, because there are not enough slots in the queue to add them. For this reason, it is very important that, in this mode, the email client deletes the messages after they are downloaded.
Because messages can only be downloaded once in normal mode, Gmail provides an option to reset POP to "Enable POP for all mail (even mail that's already been downloaded)". Choosing this option allows you to download everything to a new email client. There is no way to enable downloads for selected messages only.
No comments:
Post a Comment