POP3 Sessions w.r.t. New Email and Deleting Email

The POP3 protocol is such that a new session is started after a successful login. The session is a snapshot of the existing emails in the mailbox. Any new email that arrives during the session will not be seen until the session is ended (i.e. you logout) and a new session is started. Also, emails marked for deletion are not actually deleted until the session ends.

If you are writing a program to delete multiple emails, then session management becomes important. If your program loses connection to the POP3 server while marking the Nth email for deletion, then none of the emails will have actually been deleted. (Internally, the POP3 server requires a QUIT command to be sent before the TCP/IP socket disconnect. The Chilkat Pop3EndSession method does this.)

The mailman.ImmediateDelete property controls whether the POP3 session is automatically ended and re-established in each of the various delete methods. If set to false, then the POP3 session remains open after each email is marked for delete. This is more efficient when marking many emails for deletion, but your code will need to recover appropriately if a connection is lost before marking the last email for deletion and cleanly closing the POP3 session.