These are chat archives for IndySockets/Indy
.Disconnect- accordingly to the manual. Otherwise, if he/she wants to download and delete on server, I call
Disconnect. However, it looks not working... all the time.
Disconnect(), as it ends the current session gracefully, in both POP3 and IMAP, and then closes the socket. In POP3, ending the session gracefully automatically deletes any emails that were previously marked for deletion with the
TIdPOP3.Delete()method. They are not actually deleted until
Disconnect()is called (emails marked for deletion can be unmarked by calling
TIdPOP3.Reset()before disconnecting). In IMAP, emails are marked for deletion using the
TIdIMAP4.UIDDeleteMsg...()methods, and then deleted only when the mailbox is expunged with the
Disconnect()(emails marked for deletion can be unmarked by calling
TIdIMAP4.UIDStoreFlags()to remove the
mfDeletedflag). So, if you don't want to delete emails from the server, then simply don't mark them for deletion to begin with. Nothing in the POP3 or IMAP protocols requires you to delete emails from the server.
Connect, read all emails, call
TIdPOP3.Delete()in a loop, then
Disconnect. But will this always work doesn't matter the service - for example, using GMail?