tags:

views:

37

answers:

1

Hi! I have an application that read emails from a pop3 account. When I connect to the account I download all new emails and process body and attachments.

If there is an error processing one of the emails I would like to download it again next time I connect but since I only get new emails and the failed one was already downloaded I don't get it so I can't try to process it again.

Can I do it this with any pop3 command or I have to store locally failed emails?

+1  A: 

As long as you're not deleting the messages after downloading them, they should remain on the server so that you can retrieve them again. In other words, this should happen by default. See RFC 1939 for details.

What POP3 client library are you using?

Edit: I guess it's possible that your POP3 server is deleting messages after you retrieve them once, although that would be rather rude of it. It might be interesting to run your client code against a free POP3 server like GMail to see if it acts any different.

If you're not SSL-encrypting your POP3 connection, then it might also be interesting to run Wireshark to see what exactly is happening over the network between your client and the server. (POP3 is a plaintext protocol and is very easy to understand from looking at a network trace.) To use Wireshark, go under the Capture menu, choose Options, make sure that your interface is selected, enter a Capture Filter of "tcp port 110", and press Start.

If you're willing to post your client code, we might be able to offer some more help.

Josh Kelley
@Josh:Thanks! I'm using Lesnikowski library. But think that the fact that you don't delete emails from the server doesn't mean that you receive them over and over. Once I received an email OK, I don't get it again from the account :-(
Timmy O' Tool
+1 Thanks man. I'm using SSL (testing against GMAIL). My client code is not very interesting, as I told you, I'm using a third party library so I just do Connect() Login() GetAccountStat() GetMessage() Close(). The library is http://www.lesnikowski.com/mail/. BTW: Mails still on the inbox but I don't get them again once I receive them once, same behavior as any email client as Outlook.
Timmy O' Tool