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开发者_StackOverflow社区 to store locally failed emails?
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.
精彩评论