Operating System - HP-UX
1833262 Members
3007 Online
110051 Solutions
New Discussion

sendmail want certain users to go to different host

 
SOLVED
Go to solution
OFC_EDM
Respected Contributor

sendmail want certain users to go to different host



Our default mail setup is for mail, from an HP-UX server, to be sent to the Smart Relay which is an exchange server.

However I for certain emails I want the mail to be sent to a 2nd unix host instead of the Exchange server.

On this 2nd host I have a mail alias called cku and have setup sendmail to accept mail in the sendmail.cw (local host, hostname).

I try
echo test | mailx cku@2ndUXhostname
and the mail still attempts to go to the Exchange server instead of the unix host.

What am I missing?
The Devil is in the detail.
7 REPLIES 7
Rick Garland
Honored Contributor

Re: sendmail want certain users to go to different host

Look at the mailertable function. Based on the address you can have mail routed to the specified destination.


Check out the www.sendmail.org site. Lots of info available.
OFC_EDM
Respected Contributor

Re: sendmail want certain users to go to different host

note the alias cku on the 2nd unix host is "not" a local user. It is just an alias in the /etc/mail/aliases file.

Cheers
The Devil is in the detail.
OFC_EDM
Respected Contributor

Re: sendmail want certain users to go to different host

Subtle difference:

UserA is a local user on host B
cku is a mail alias on host B. No local account is defined.

echo test | mailx UserA@hostb.domain.com
-> this works

echo test | mailx cku@hostb.domain.com
-> DOES NOT work

This difference is that cku is not a local user on the receiving server.

So do I need to modify something on the receiving server? (don't think mailertable applies does it?)
The Devil is in the detail.
Tor-Arne Nostdal
Trusted Contributor

Re: sendmail want certain users to go to different host

What happens if you login to host hostb.domain.com and try to send a mail locally to this alias?
hostb# echo test | mailx cku@hostb.domain.com

Did you just enter the alias into hostb.domain.com:/etc/mail/aliases and forgot to run /usr/sbin/newaliases ???
I'm trying to become President of the state I'm in...
OFC_EDM
Respected Contributor

Re: sendmail want certain users to go to different host

Sending mail locally to the alias works.
I had run newaliases.

Cheers
The Devil is in the detail.
Doug O'Leary
Honored Contributor
Solution

Re: sendmail want certain users to go to different host

Hey;

The way I understand it, you want all make except for cku@hostb.domain.com to go to the exchange server for relaying. cku@hostb.domain.com should be mailed directly to hostb... Is that correct?

If that's the case, R.Garland gave you the right answer:

For the first req, ensure your ^DS macro is set to the smart relay (which, it sounds like it already is).

For the second, add the FQDN of the hostb to the file /etc/mail/mailertable:

smtp:hostb.domain.com

Then, make the mailertable:

makemap dbm /etc/mail/mailertable < /etc/mail/mailertable

Restart sendmail and any mail directed to cku@hostb.domain.com should go directly there.

You can verify this by executing sendmail in rule testing mode:

sendmail -bt
> 3,0 cku@hostb.domain.com

Should tell you that it's going to hostb.domain.com.

> 3,0 dkoleary@olearycomputers.com

Should tell you that it' getting relayed through your smart host.

HTH;

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
OFC_EDM
Respected Contributor

Re: sendmail want certain users to go to different host

see above
The Devil is in the detail.