I process bounce letters (rollbacks / returns after sending to a nonexistent email address), trying to save them to my MySQL table. From the letters it is taken: the subject of the letter, the text of the message, the address where the letter was not sent and a rollback came. And here's the last one just don’t know how to determine, because all the rollback letters in my box have the address: MAILER-DAEMON@site.ru, where site.ru is the domain of my site (site.ru is of course taken for example, domain I have another).

It turns out this mail daemon on my mail server sends me kickbacks?

How can we find the recipient's address in the letter then? The email address of the letter that had not previously been sent and a rollback came to me.

  • See the full text of the letter, the mail server usually sends the headers of an undelivered letter in the text of its letter - Mike

1 answer 1

In the properly formatted Delivery Status Notifications, there is a separate MIME container of the Content-Type: message/delivery-status , which follows the format described in the RFC . You are interested in Original-Recipient and Final-Recipient.