Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 0 down vote accepted

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.

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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