"Silvio Sancese" <sancese(_at_)mmedia(_dot_)df(_dot_)unibo(_dot_)it> writes:
Hi everybody,
I have procmail running two hosts on different domains.
One of my recipes is:
:0:
* $^From "$BLACKLIST"
* !^X-Loop: sancese(_at_)domainA
| (formail -rt \
-A "Precedence: junk" \
-A "X-Loop: sancese(_at_)domainA" ; \
cat $PMDIR/blacklist.reply; \
) | $SENDMAIL -t
(the $BLACKLIST is a very small list of known people, so I don't spam anyone).
Problem is that on domain domainB the recipe is slightly different for the
X-Loop stuff, indicating domainB.
How can I parametrize the recipe so that I can use the same rc file on machines
on different domains?
# $LOGNAME and $HOST are builtin to procmail
XLOOP = "$LOGNAME(_at_)$HOST"
# Don't need the quotes arount $BLACKLIST
# If you have procmail 3.11pre4 or later than you can change the
# $XLOOP in the condition into $\XLOOP so as to do a literal match
# against the contents of XLOOP, instead of treating its contents
# as a regexp.
:0:
* $ ^From $BLACKLIST
* ! $ ^X-Loop: $XLOOP
|(formail -rtA"Precedence: junk" -A"X-Loop: $XLOOP"; \
cat $PMDIR/blacklist.reply \
)|$SENDMAIL $SENDMAILFLAGS -t
Philip Guenther