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:
#[/etc/mail/mailertable.txt]
# pass messages for internalserver.domain.tld
internalserver.domain.tld esmtp:[internal_server_ip_address]
# pass messages for the gateway through procmail
domain.tld procmail:/etc/procmailrcs/yourgenericfilter.rc
#[/etc/mail/access.txt]
# 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
# space!).
internalserver.domain.tld RELAY
connect:w.x.y.z RELAY
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...
<http://groups.google.com/groups?q=sendmail+mailertable+procmail&start=20&hl=en&lr=&ie=UTF-8&oe=UTF-8&scoring=d&selm=BwJha.33086%24j15.17833%40prv-forum2.provo.novell.com&rnum=26>
Also see:
<http://www.softpanorama.org/Mail/procmail_from_sendmail.shtml>
<http://www.luni.org/pipermail/luni/2002-October/007527.html>
[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
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail