We took over a domain (mydomain.at) and therefore are getting some
emails which we need to redirect, according to the following rule:
if the To: address is obviously "firstname...@mydomain.at" then
rewrite the To: address to "firstname...@mydomain.com" and deliver
it to the MX of mydomain.com. otherwise, apply all other rules as usual.
the best rule for recognition of "firstname.lastname" would be "if there
is a dot and there are at least 3 characters on the left side of the dot
and at least three characters between the dot and the @ then it is
firstname.lastname".
Has someone already written such a rule before ? a m4 macro would be
fine.
tnx in advance,
rainer.
-{Hi,
-{
-{We took over a domain (mydomain.at) and therefore are getting some
-{emails which we need to redirect, according to the following rule:
-{
-{if the To: address is obviously "firstname...@mydomain.at" then
-{rewrite the To: address to "firstname...@mydomain.com" and deliver
-{it to the MX of mydomain.com. otherwise, apply all other rules as usual.
-{
-{the best rule for recognition of "firstname.lastname" would be "if there
-{is a dot and there are at least 3 characters on the left side of the dot
-{and at least three characters between the dot and the @ then it is
-{firstname.lastname".
-{
-{Has someone already written such a rule before ? a m4 macro would be
-{fine.
AFAIK sendmail doesn't count letters like that. Rather, letters between
certain punctuation marks are put together in a token. To actually count
the letters you'll probably need a milter script. Otherwise this might
do the trick:
R$-.$-<@mydomain.at> $1.$2<@mydomain.com>
--
Randy (sch...@sgi.com) 715-726-2832 <*>
The Penguin Cometh
>-{the best rule for recognition of "firstname.lastname" would be "if there
>-{is a dot and there are at least 3 characters on the left side of the dot
>-{and at least three characters between the dot and the @ then it is
>-{firstname.lastname".
>AFAIK sendmail doesn't count letters like that. Rather, letters between
>certain punctuation marks are put together in a token. To actually count
>the letters you'll probably need a milter script. Otherwise this might
>do the trick:
>R$-.$-<@mydomain.at> $1.$2<@mydomain.com>
Actually, counting the characters/letters (or rather, requiring a
minimum amount of them) could be done with a regex map, if it's really
needed - implementation left as an exercise etc...
--Per Hedeland
p...@bluetail.com
> the letters you'll probably need a milter script. Otherwise this might
> do the trick:
> R$-.$-<@mydomain.at> $1.$2<@mydomain.com>
big tnx, I crafted this rule into our mailhost.cf (m4):
FEATURE(nouucp,`reject')
FEATURE(`virtusertable', `btree -o /etc/mail/virtusertable')
[...]
MAILER(smtp)
LOCAL_RULE_2
# re-route sanofi emails
R$-.$- < @mydomain . at . > $1.$2<@mydomain.com>
problem now is that this sendmail config also uses a virtusertable with an
default address defined:
@mydomain.at us...@otherhost.at
I'm not sure to which ruleset the rule above should be added. It seems like only
rulesets 0 to 4 are supported in m4, and ruleset to seems to be to late since
when ruleset 2 is invoked the recipient's address is already us...@otherhost.at
could anybody please give me a hint on where to add this rule in a sendmail 8.11
config ? preferred order is:
ruleset 3 --> domain.at to domain.com rule --> virtusertable lookup --> etc.
tnx in advance.
--
------------------------------------------------------------------------------
Rainer Fuegenstein r...@iguwnext.tuwien.ac.at
------------------------------------------------------------------------------
"Why are you looking into the darkness and not into the fire as we do ?", Nell
asked. "Because the darkness is where danger comes from," Peter said, "and
from the fire comes only illusion". (from "The Diamond Age")
------------------------------------------------------------------------------
LOCAL_RULE_0 should do the trick (it happpens just before the
virtusertable lookup).
--Per Hedeland
p...@hedeland.org