GMail POP3 Confusing Behavior

51 views
Skip to first unread message

Chilkat

unread,
Sep 3, 2010, 9:16:35 AM9/3/10
to Chilkat
The behavior of the GMail mail server for POP3 access can cause some
difficult problems. I'll describe them.

If a POP3 session is cleanly ended by sending a QUIT command and then
disconnecting, then any emails downloaded will not be seen the next
time your application connects to read email. This happens even when
the GMail POP3 access settings for the account are set to "When
messages are accessed with POP, keep Gmail's copy in the Inbox."

For example, if your application connects, calls CopyMail to download
email, and then ends the session by calling Pop3EndSession, then re-
running the same code will result in 0 emails downloaded.

A new method was added to handle this problem: Pop3EndSessionNoQuit.
This will end the session (disconnect) without sending the QUIT.
However, there are still problems.

1) If some emails were previously marked for deletion, then the QUIT
is required to finalize the delete. However, by sending the QUIT in
the same session as when the emails were downloaded, you'll lose
visibility for emails not marked for delete.

2) If the ImmediateDelete property is true, then any deletes are
immediately deleted by sending a QUIT command and disconnecting, and
then automatically re-establishing the connection w/ the next POP3
method call. The QUIT command may have the unintended side-effect of
losing visibility of emails downloaded in the same session.

In a nutshell, GMail has made a real mess of things with it's non-
standard POP3 implicit behaviors. Your applications will certainly
need to handle GMail accounts with special considerations...
Reply all
Reply to author
Forward
0 new messages