开发者

Dealing with bounce-backs emails (only POP3, without IMAP)

开发者 https://www.devze.com 2023-03-20 21:20 出处:网络
I want to ask about dealing with bounce-backs emails (but on server without IMAP, only with POP3, and without an Outlook on my machine).

I want to ask about dealing with bounce-backs emails (but on server without IMAP, only with POP3, and without an Outlook on my machine). I don’t want to read all emails from server every time.

So I thought, At first: 1. read e-mails from the oldest to the newest, checking whether there are bounce-backs. 2. save the date of the latest e-mail to the variable "TEMPDATA" //This process will be executed only once, at the beginning

And then in timer loop (in another thread): 3. read e-mails from the "TEMPDATA" to the newest, checking whether there are bounce-backs (check if there is a subject “"Undelivered Mail Returned to Sender"”.)

The pseudo-code of my idea:

TIMER( Tick every 5minutes )
{
    (LOCK)
    loop(on inbox from the "TEM开发者_运维百科PDATA" to the newest)
    {
        // Read single email

        if (the subject is "Undelivered Mail Returned to Sender")
        {
            // Here I will parse message so that I will know the addresse
            // And removie that addresse from my list.
        }
    }
    (UNLOCK)
}

I’m just curious if there is some better solution.


  1. If you are planning to use IMAP protocol I'd rather use email UID than date.

  2. Checking only the subject is not the bast way to check, if the message is delivery failure report. Some emails will have different subject (different language). Gmail for example uses additional header. Most delivery failure emails however follow RFC3464 specification and use Delivery Status Notification (DSN) format.

  3. You can try using Mail.dll component for this:

http://www.lesnikowski.com/blog/index.php/bounce-handling/

Please note that this is a commercial product I created.


I know this is an old question, but it shows up high in search results, so here's to hoping it helps others.

I found this open source solution:

https://mailsystem.codeplex.com/

Seems to be working well for us so far. Documentation is pretty much non-existent, though the Visual Studio intelli-sense is pretty detailed.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号