1821410 Members
3080 Online
109633 Solutions
New Discussion юеВ

Re: Sendmail To: mapping

 
SOLVED
Go to solution
Robert Early_3
Advisor

Sendmail To: mapping

I'm running sendmail 8.9.3 and I want to be able to do the following:Server is on domain b.com, all mail is transferred to another 'smart host' for delivery.Users send mail from the server to a.com, b.com, amongst othersI want all mail sent TO x@a.com translated to x@b.com before being transferred to the smart host.What's the simplest way of doing this? I've been trying out FEATURE(allmasquerade) and MASQUERADE_AS(`domain') but without success.
11 REPLIES 11
Fred Ruffet
Honored Contributor

Re: Sendmail To: mapping

in /etc/mail/sendmail.cf, change line begining by DM, and put your domain. It will masquerade to this domain.
--

"Reality is just a point of view." (P. K. D.)
Geoff Wild
Honored Contributor

Re: Sendmail To: mapping

Yes - set DM macro in sendmail.cf:

DMyourdomain.com

Also, set DS to smart relay:

DSyouremailserver

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Robert Early_3
Advisor

Re: Sendmail To: mapping

Tried that, but the mail address remained untranslated. I checked in the mail.log and the "to=" part still had the wrong domain?Note, it's not the From: address I want to translate, it's the To: address. The mail originates on the sendmail server itself, going to an external domain.
Geoff Wild
Honored Contributor

Re: Sendmail To: mapping

I wonder if this will work for you:

http://www.tldp.org/HOWTO/Sendmail-Address-Rewrite-3.html

It uses the genreics table - like aliases - but you have to explicitly set each person....

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Robert Early_3
Advisor

Re: Sendmail To: mapping

That woudln't be feasable really, as there are potentially thousands of different recipients. I was hoping to do some sort of wildcard replace.
Geoff Wild
Honored Contributor

Re: Sendmail To: mapping

That's what I thought - rewriting out-going header is difficult...

I was looking for something similiar:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=519534

I got this email from a friend of mine:

Considering procmail doens't have anything to do with outbound mail, probably not *8-)

Sendmail won't do it either, because the only thing it can manipulate is the envelope, and the subject line isn't part of that.

I can think of two things that might work. The first one is GNU Anubis, and the second one is "emailrelay" from sourceforge. Both of them will basically need a dedicated machine to act as a relay between the unix
boxes and the (retarded) mail server.

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Robert Early_3
Advisor

Re: Sendmail To: mapping

There is another way around this, and it was a possibility that I was looking at - just blocking the other domain entirely and forcing the (l)users to update their addressbooks themselves. I was also looking at sendmails anti-spam settings. Is it possible to block a domain on the To: line?
Geoff Wild
Honored Contributor

Re: Sendmail To: mapping

Blocking on the To: line - I think so:

Try this in /etc/mail/access

To:a.com ERROR:"553 - please use user@b.com instead...."

Thats a TAB between com and ERROR.

makemap hash /etc/mail/access

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Robert Early_3
Advisor

Re: Sendmail To: mapping

I've done this, but it seems to still pass the emails. I've added FEATURE(`access_db') to the .mc file and recompiled. Is there any other feature I need to enable to pick up access databases?
Stuart Browne
Honored Contributor

Re: Sendmail To: mapping

Have you looked at using the 'virtual user table' ?

FEATURE(`virtusertable', `dbm /path/to/virtusertable')

Full instructions are at http://www.sendmail.org/virtual-hosting.html for this feature, as well as discussion on it's other features.

One long-haired git at your service...
Berlene Herren
Honored Contributor
Solution

Re: Sendmail To: mapping

Robert, How about the redirect feature in sendmail? This allows aliases to be set up for email accounts. You can use this feature to notify others of a new address. In addition to the notification to the sender this feature may be setup
to forward the original email message the the recipient's new address.


Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm