On Thu Jan 25 08:25:25 2007 Professional Software Engineering wrote:
At 18:46 2007-01-25 +0800, DR. Lee - NS1 wrote:
Can Procmail be used to trap the outgoing mail before it is sent?
Generally speaking, only with a lot of MTA hacking.
1) set up sendmail to queueonly mode
What about messages which are submitted from the network?
Do you mean incomming mail, relays, system traffic, or what?
messages which are sent from the local host to another SMTP server?
Again, do you mean real mail, bounce msgs, relays, or what?
2) get procmail to examine all outgoing e-mail in queue? How?
You should examine the messages in the queue sometime. If you do, you'll
find that there are TWO files for each message. One is strictly the body
of the message, and the other contains status information plus the headers
(whether locally originated, or relayed, or whatever) in an MTA-specific
You may want to investigate MILTERs, and you might consider filtering when
the message is SUBMITTED, not when it is being sent (modern sendmail
installations have two sendmail daemons - an SMTP one and a local MSA).
I'd recommend that you determine just what it is you want to accomplish by
examining the outbound mail of your users.
Personally, I appreciate that the developers of Sendmail have resisted
attempts to make it easier for outfits to programmatically snoop on the
communications of their users.
I know how to recognize mail coming from my site, as opposed to relay spam
and virii, the problem is catching hold of the garbage before it slides
right back out to the net with my address on it.
procmail mailing list Procmail homepage: http://www.procmail.org/