My application is delivering automated E-mail notifications to the registered users. I would like to find a way to use the undeliverable mail notifications sent by the remote servers to save the E-mail addresses as failed. In other words, I would ideally want to find a way to, when an undeliverable mail notice is received, execute a program with the E-mail as argument.

-- Pierre


If you are able to, adjust the messages you send to use VERP. By using VERP, basically every email you send will contain a unique envelope sender. When the message is bounced is returned to your mail server you can look at the unique envelop sender and properly modify, disable or handle the bounced message.

As to how to do this, there are many tools, but they depend on the mail server. With some mail servers like exim it is very easy to setup a router+transport that will automatically deliver the message to your application. If you don't want to do that use one of the many programming APIs to access your message store and process them. Again, the exact details depends on your mail server, and how you are able to access it.

  • Thank you. I would have another question : when receiving messages at this address, how may I make sure it is a bounce mail before registering the mail as failed ? Is there any header I should look for ?
    – Pierre
    Sep 1 '10 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.