1834903 Members
2747 Online
110071 Solutions
New Discussion

sendmail mail relay

 
j773303
Super Advisor

sendmail mail relay

How to set the mail relay for sendmail?
While sendmail to out of the intranet, it is use mail relay. If sendmail to the local intranet, it it doesn't use mail relay. How to configure this? Thankx.

OS: 10.20
sendmail patch: PHNE_18979 8.9.3
Hero
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: sendmail mail relay

vi /etc/mail/sendmail.cf

change
DS

to

DShostnameofrelayserver

thats the host name of the relay server

or

DS
[ip address of relay server]

I do the latter so mail flows when the DNS server internally is down. The external relay server has access to the outside world and I'd rather have the mail queue there than on my boxes.

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

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
j773303
Super Advisor

Re: sendmail mail relay

Hi,
I've configure the DS. But all the mail will via the mail relay to send out. I'd want to local domain mail don't via mail relay. How to configure it?
Hero
Steven E. Protter
Exalted Contributor

Re: sendmail mail relay

You can do a few things:

/etc/mail/aliases

someone@localdomain: username


This will route mail from the individual accounts to local user names. That will work for a small domain.

For an entire domain:

/etc/mail/virtusertable

@localdomain username

/etc/mail/genericstable

username @localdomain

That will send a whole domain's mail to a single user.

You'll need a script to build the hash databases, attaching a template.

Please point if posts were useful or solved the problem.

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
j773303
Super Advisor

Re: sendmail mail relay

Does sendmail configure file /etc/mail/sendmail.cf doesn't support set the mail route, if local mail, then via local domain, if internet mail, then via mail realy?
Hero
Seth Parker
Trusted Contributor

Re: sendmail mail relay

Try putting the system's hostname in the sendmail.cw file. That will help with local delivery (also search for "Cw" in sendmail.cf).

Also, try reading about the DL macro in the comments in the sendmail.cf

Here's a link that may help as well:
http://devrsrc1.external.hp.com/STK/impacts/i653.html

Good luck!
Seth
Steven E. Protter
Exalted Contributor

Re: sendmail mail relay

You actually have a couple of options.

If your mail environment is static you can just jump in and edit sendmail.cf to make it do what you want it to do.

Or, you can run the gen_cf utility which will integrate the information from my previous posts. This allows you to be a little more dynamic and change you mail behavior without editing sendmail.cf

Except for the Dj and DS directives, doing anything else to sendmail.cf gives me a headache. I find it easier to work with sendmail.mc(which I have programmed to integrate the files noted in my prior post) on Linux and the gen_cf in HP-UX(which also integrates those files).

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