Operating System - HP-UX
1833780 Members
2749 Online
110063 Solutions
New Discussion

Adding default domain to outgoing mail

 
SOLVED
Go to solution
Earl Locken
Occasional Contributor

Adding default domain to outgoing mail

Currently we have some users who want to have e-mail to "user" delivered to "user@localdomain.com". That way the users can receive e-mail in one spot and not have to check individual machines.

We are using sendmail on HP-UX 11 and 11i systems to forward mail to a central server running MS Exchange. To complicate things, the Exchange servers can't assume the local domain because they handle several different domains. I could use a user DB, but it seems to me it would be difficult to maintain across all the servers.

Is this something I should try to do with sendmail? Is it easy to get sendmail to apply a defalt domain to the recepient's address? The sendmail.cf file has been changed to set DR and DS to the MX record for the Exchange servers, and we use DM to masquerade our internal domain name to a consistent external one. The DM macro affects the From address and header. Is there something equivalent for the To and recepient? Would I have to change sendmail's rewrite rules?
--
Earl Locken
elocken@petro-canada.ca
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: Adding default domain to outgoing mail

Easiset:

in sendmail.cf

Djlocaldomain.com

/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start

You can also do it with the system hostname.

in /etc/rc.config.d/netconf

change hostname=servername

to

hostname.localdomain.com

This will not work if any portion of the name exceeds 8 characters.

You can also do it with sendmail m4 macro programming in the /usr/newconfig/etc/mail/cf/cf/generic-hpux10.cf

file. Thats where you should do your macro programming.

masquerade will work.

Here is a script that does the m4 macro programming and gen_cf work as well.

http://www.hpux.ws/buildmail.hpux.ws

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Geoff Wild
Honored Contributor

Re: Adding default domain to outgoing mail

Hey Earl - Geoff here....

If I understand you correctly...you want mail sent to "unix" id to go to user@yourdomian.com.

You can do that with perhaps .forward files or with the alias file:

joe: joe@yourdomain.com

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.
Geoff Wild
Honored Contributor

Re: Adding default domain to outgoing mail

Steven - Dj might work - but, if I understand it correctly - then email will work to all users who have a Unix account - but if you try to send to someone in the company that doesn't have an Unix id - you will get something like " sendmail[123]: 4330: --> 550 ... User unknown"...because "yourcompany.com" is fully locally managed by sendmail....

Have to test this....

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.
Geoff Wild
Honored Contributor
Solution

Re: Adding default domain to outgoing mail

Tested the Dj - doesn't work - aliases does....

I did find this on page 398 of Sendmail book:

F=C
Add @domain to recipient

The F=C flag causes sendmail to append an @domain extension to any recipient which lacks one...

However, I can't seem to figure out how to implement - tried modifying the Mlocal as well as Ruleset 96.....

There is a warning - stating that F=C should be avoided for local delivery...

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.
Earl Locken
Occasional Contributor

Re: Adding default domain to outgoing mail

The C flag seems to be just what I wanted. If I add it to the flags for the Mrelay mailer messages will get the default domain name. Thanks!