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. 'example.com has timed out the last 5 connection attempts, so no longer queue mail for recipients @example.com'.
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!