Duplicate emails when emails left on server

Giganews Newsgroups
Subject: Duplicate emails when emails left on server
Posted by:  Jon E. Scott (NOSPAMsuppo…@blueorbsoft.comNOSPAM)
Date: Tue, 21 Dec 2004

Using Indy 9.0.14 in D7.  One of our products periodically checks for emails
on the POP3 server, dowloads them and enters the messages into our database.
Users can configure this product to leave messages on server, otherwise we
delete them off the server using the call TIdPOP3.Delete().  The problem
arises when the next time our program checks for mail, the same emails are
downloaded again and entered into our database resulting in duplicates.  We
have no problems with this using Extended MAPI or Lotus Notes, as those
protocols give us an option to mark the emails as "read" when we're done and
we only filter out new emails.  I don't see this capability with POP3 and

Does anyone know what to look for in the TIdMessage class to determine if a
mail is already read or not?  I thought about maybe storing a list of
TIdMessage.MsgID's retrieved in a permanent local file somewhere and skip
the email if it's ID exists in this file, but thought there must be a better
way than this cumbersome method.

Jon E. Scott
Blue Orb Software