Marc Perkel wrote:
First to do what I'm doing you have to be using EXIM. If you aren't running exim then you just can't do it. In fact, with all due respect, I can't see how anyone can do spam filtering and not use exim as their MTA.
qpsmtpd is another viable alternative.
Exim has a feature where you can execute code based on how the connection is closed. It have a NOTQUIT acl and you can look at if the connection timed out and a number of other things that caused the connection to close without issuing a quit. Before the 451 error I store information in variables that I can retrieve in the notquit acl and based on that information I can send messages to another server that accumulating information from all my servers.
qpsmtpd has hooks that are called at various stages of the SMTP transaction. I believe it has one that fires on connection close.
You can write plugins that are invoked by specific hooks and do pretty much whatever you want (they're just perl scripts).
R.