Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I am looking for an MTA that will allow me (a script, really) to proactively manage its send queue in response to status codes returned by the remote servers I am delivering to.

Basically, for each mail sent I would like to be able to react to the SMTP reply code returned by the remote server, ex. '250 OK', or to any error conditions like connection timeouts.

Additionally, I would like to be able to manage the send queue moving forward based on this information, e.g. ' has timed out the last 5 connection attempts, so no longer queue mail for recipients'.

I am currently using Postfix and Perl to parse its logs for this information, but I am playing a game of catchup that is prone to errors (out-of-order log entries etc.) and it's starting to get messy (some real ugly regexes ;).

I really don't want to reinvent the wheel and use some language's SMTP library; I would prefer to use a proven/fast/reliable MTA. I am however open to suggestions if what I need just isn't possible.

Thanks for your help!

share|improve this question
up vote 1 down vote accepted

postfix is the closest you will get to the "smartest queue" you are looking for. it is already split nicely and very manageable.

You may want to re-think your script to monitor files in your queue folders


and then have messages moved around with postsuper command?

share|improve this answer
Any chance you'd know the difference between defer and deferred? Besides the obvious; does mail go from defer to deferred? – mikewaters Aug 25 '10 at 2:57
Did you find a solution to this? I need the same thing ... an MTA that could react to every SMTP response code. – Newtonx Apr 28 '11 at 1:31

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.