Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to retrieve only new emails using POP3 protocol

Tags:

pop3

I am using POP3 protocol to retrieve my emails in my .NET application. I need to read just new emails only but found in many blogs that it is not possible to retrieve just "unseen" or "new" mails using POP3. Is that true? If so, could you please help me understand how Outlook Express manages to get new mails using POP3?

Is there any way that I can flag the seen mails in the email server itself? Or please help me find out a way to retrieve new mails using POP3 protocol.

like image 443
Anu Avatar asked May 11 '11 06:05

Anu


People also ask

How do I get old emails from POP3 server?

Open an Outlook client that has access to the mailbox that has deleted items. Select the folder that has deleted items in it. From the Tools menu, select Recover Deleted Items. Select the items that you want to recover, and then click Recover Selected Items.

Does POP3 delete emails?

By default, when you retrieve new messages from a POP3 email account, the messages are deleted from the POP3 mail server and then saved on the computer that you are using. Because the message is no longer on the POP3 mail server, you can't see it when you connect from another computer.

Does POP3 download email from server?

Thus, POP3 offers a means of downloading email from a server to the client so the recipient can view the email offline. POP3 can be thought of as a "store-and-forward" service. Once the email is on the client, POP3 then deletes it from the server.

Does POP3 store email locally?

POP3 stands for Post Office Protocol. As the name suggests, it allows you to use your email inbox like a post office – emails are downloaded onto your computer and removed from the mail server. When accessing your emails using the POP3 protocol, a copy of the emails is created and stored locally on your computer.


1 Answers

You have to store the UIDL of each email in a local database. When you want to check for new mail, you retrieve the UIDLs on the server and see if you have if already in your local database; if not, it's a new mail.

Outlook uses the same strategy, BTW (see this KB article).

like image 87
abaumg Avatar answered Sep 18 '22 07:09

abaumg