ph10@??? (Philip Hazel) wrote on 25.01.00 in <Pine.SOL.3.96.1000125083907.19424C-100000@???>:
> On Mon, 24 Jan 2000, Dean Brooks wrote:
>
> > Well, you do have *some* control over what messages are affected
> > by rewrite rules. The replacement string is expanded, so I frequently
> > have used "${if" statements in them for UUCP conversions in combination
> > with the "fail" directive.
>
> Good point.
This may be the point to post the rewrite rules I'm using on westfalen.de
... I'll add some English comments as well (#>). Maybe some people can
find some ideas in there. (Hmm. Looking over it, I'm reminded of
sendmail.cf - small wonder, this is exactly what sendmail.cf rulesets
typically do ...)
######################################################################
# REWRITE CONFIGURATION #
######################################################################
# Smail kann illegalerweise SMTP-Envelope-Adressen der Form
# x!y!z verwenden. Konvertiere diese nach y!z@x vor irgendwelchen Aktionen
# (aber nur, wenn noch kein @ vorhanden ist).
#> compensate for bad envelopes from smail
^<*([^!@]+)!([^@]+?)>*$ $2@$1 ESh
# Einige Leute produzieren x@y@z - nur f³r lokale Domains fixen
#> repair some bad addresses, but only for local domains
^<*(.*@.*)@([^@]+?)>*$ $1\
${lookup{$2}partial-dbm{/etc/exim/relay.dbm}{}fail} ESRh
# Explizites Routing vermeiden. Exim macht das selbst f³r @a,@b:c@d,
# f³r die ! und % Formen machen wir's mit Rewriting rules
# (aber nur f³r "lokale" Domains):
# Wenn wir a!b@c haben, konvertiere nach b@a (evtl. mehrfach)
#> un-bang bang paths iff RFC domain is local
^<*([^!@]+)!([^@]+)@([^@]+?)>*$ $2@$1\
${lookup{$3}partial-dbm{/etc/exim/relay.dbm}{}fail} ESRh
# Wenn wir a%b@c haben, konvertiere nach a@b (evtl. mehrfach)
#> similar for % hacks
^<*([^@]+)%([^%@]+)@([^@]+?)>*$ $1@$2\
${lookup{$3}partial-dbm{/etc/exim/relay.dbm}{}fail} ESRh
# Lokale Domains ohne . qualifizieren (Envelope)
#> qualify local domains (rules are complicated, so use a lookup)
^<*([^@]+)@([^\.]+?)>*$ $1@$2.${lookup{$2}partial-dbm{/etc/exim/qualify.dbm}\
{$value}fail} ESh
# spezielle User abfangen
#> special hack for one user where UCE was sent in his name from elsewhere
#> and he's flooded by complaints and bounces
^(welcome\d+)@(somesitename.westfalen.de)$ $1%$2@???
# End of Exim configuration file
MfG Kai