At 17:11 2003-05-19 +0100, Oliver Marshall did say:
Can anyone confirm that procmail can be configured so that it can
compare emails to a set of prefined rules, and then forward them on (or
not) to their original destination? Ideally, someone should be able to
be informed of the any emails that fail the rules.
Invoking procmail from within the MTA is generally a tricky operation,
since no two MTAs operate in quite the same fashion. It can be done.
One method might be to use the mailertable feature of sendmail - your *nix
server accepts the messages, and relays them ALL to another server, which
you list in mailertable. Set up a procmail mailer (which is separate from
a procmail LDA), then:
# pass messages for internalserver.domain.tld
# pass messages for the gateway through procmail
# allow relaying for the domain - this _may_ be required to relay for the
# internal server. Better would be to relay for it by IP address, as shown
# in the second line (even better if the IP address is from the private IP
The tricky part would be writing the procmail filter in such a way that it
would forward messages appropriatley to the internal server. It seems
dependant upon your sendmail config file being set up appropriatley so that
you don't loop when you resubmit the message. See the links below.
A search for "sendmail procmail mailertable relay filter" on
deja^H^H^H^HGoogle Groups should net you loads of reading material, though
you'll have to weed through a number of results which merely mention
procmail in a .cf file posting...
[performing web searches for people since 1992]
Sean B. Straw / Professional Software Engineering
Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
Please DO NOT carbon me on list replies. I'll get my copy from the list.
procmail mailing list