Re: Downloading duplicates

Giganews Newsgroups
Subject: Re: Downloading duplicates
Posted by:  Remy Lebeau \(Indy Team\) (
Date: Wed, 24 Jan 2007

"Khalid Rahaman" <khali…> wrote in message

> everytime i run the "get mail" function it re-downloads the
> same emails again plus any new emails.

Then you are not tracking the messages correctly, if at all.

> I do not want to delete from the server

You need to keep track of the messages that you have already
downloaded.  Each time you reconnect, you can then skip the messages
you already have.  Each message has a unique server-assigned MsgID
that you can put into a list.  When you come up to a message, download
just its headers first, see if its MsgID is already in your list, and
if not then add the MsgID to the list and download the message body.
Also, while you are looping through messages, keep track of the MsgIDs
that are currently on the server.  At the end of your downloading, you
can compare the two lists and remove any MsgIDs from your tracking
list that no longer exist on the server because someone deleted those

> i just want a way to "tag" that email as having been downloaded

You cannot tag messages on the server.  You have to track them locally
inside your program instead.




In response to

Downloading duplicates posted by Khalid Rahaman on Wed, 24 Jan 2007