After soem digging into to the docs I came accross the LUSER_RELAY option.
Ok I tought, I will use that to solve my probs. Here is my sitiation.
I have set up a number of users on my linux box.
I'm using fetchmail to receive mail from my ISP.
If U send a mail to kees@host1 and kees does NOT exist on host1 it must be
relays to my ISP. But if I use define(`LUSER_RELAY', smtp:host2) the address
is changed to kees@host2. From my ISP I'm getting the return message
kees@hist2 not found.
How do I prevent changing the hostname?
so kees@host1 must after relaying still be kees@host1.
My ISP will accept kees@host1 as a valid mail address.
Best Regards, Ries van Twisk
*** tested on V8.7 via sendmail -bv ***
One option is to allow $L in the following formats
mailer:host,domain
host,domain
Where domain is the domain to be added to user names
when LUSER_RELY is triggered.
In your case you need:
define(`LUSER_RELAY', `smtp:host2,host1')
On my sendmail you would need to change S5:
----------------------------------------------
# OLD
R< $- : $+ > $+ $: $>95 < $1 : $2 > $3 < @ $2 >
R< $+ > $+ $@ $>95 < $1 > $2 < @ $1 >
----------------------------------------------
# NEW
R< $- : $+ , $+ > $+ $: $>95 < $1 : $2 > $4 < @ $3 >
R< $- : $+ > $+ $: $>95 < $1 : $2 > $3 < @ $2 >
R< $+ , $+ > $+ $: $>95 < $1 > $3 < @ $2 >
R< $+ > $+ $@ $>95 < $1 > $2 < @ $1 >
----------------------------------------------
--
"Andrzej (Andrew) A. Filip" <an...@polbox.com>
Warsaw, Poland
an...@bigfoot.com (backup)
This works great with sendmail 8.9.3 also. I needed this to send
mail to default cc:Mail and Exchange SMTP gateways as getting either
of those to accept alternate domains as local is a royal pain in the
butt (surprise). I would suggest that this second address be a
builtin feature to LUSER_RELAY as it very useful when dealing with
such uncooperative MTAs and I saw many previous posts on DejaNews
from people that wanted to not rewrite the headers when LUSER_RELAY
is used.
--
- Kyle
(When I took one more look at the rules I wrote)
I think "error" delivery agent should be excluded from comma rules
otherwise one have to remember to avoid commas in error messages.
(The rules may be triggered not only by $L but also by DR, DH.)
*** tested on V8.7 via sendmail -bv ***
One option is to allow $L in the following formats
mailer:host,domain
host,domain
Where domain is the domain to be added to user names
when LUSER_RELAY is triggered.
In your case you need:
define(`LUSER_RELAY', `smtp:host2,host1')
On my sendmail you would need to change S5:
----------------------------------------------
# OLD
R< $- : $+ > $+ $: $>95 < $1 : $2 > $3 < @ $2 >
R< $+ > $+ $@ $>95 < $1 > $2 < @ $1 >
----------------------------------------------
# NEW
R< error : $+ > $+ $: $>95 < error : $1 > $2 < @1 >