procmail
[Top] [All Lists]

Re: Sendmail rules

2000-10-31 00:17:58
"Carlos Perez Gonzalez" <charlie(_at_)hl(_dot_)minaz(_dot_)cu> writes:
I'm interested on your solution. Could you explain in detail with an example
if possible.

Sure: First, add "procmail" to class P in the top half of the config file:

CPprocmail


Then write the rules as Colin originally proposed:

R$*<@some.where.>       $#procmail $@/etc/procmailrcs/some.rc 
$:$1(_at_)some(_dot_)where(_dot_)procmail
R$*<@$*.procmail.>$*    $1<@$2>$3               Already filtered, map back


If you use the m4 config file generator then you would do something like
the following:

LOCAL_CONFIG
CPprocmail
LOCAL_RULE_0
R$*<@some.where.>       $#procmail $@/etc/procmailrcs/some.rc 
$:$1(_at_)some(_dot_)where(_dot_)procmail
R$*<@$*.procmail.>$*    $1<@$2>$3               Already filtered, map back
divert(-1)


I would guess that for most sites, $m could be used in the ruleset instead
of hardcoding the domain:

LOCAL_CONFIG
CPprocmail
LOCAL_RULE_0
R$*<@$m.>       $#procmail $@/etc/procmailrcs/some.rc 
$:$1(_at_)$m(_dot_)procmail
R$*<@$*.procmail.>$*    $1<@$2>$3               Already filtered, map back
divert(-1)


That has the additional advantage of making the rule short enough to
fit on one line.


Philip Guenther

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>