Operating System - HP-UX
1748051 Members
5362 Online
108757 Solutions
New Discussion юеВ

how does mailx look up the mail server

 
ran_li
Regular Advisor

how does mailx look up the mail server

Hello pros,

Two questions,

1. how does mailx lookup the mail server? what is the steps?

2. I want to send mail using assigned mail server, how to accomplish that?

Thanks in advance!
16 REPLIES 16
NMory
Respected Contributor

Re: how does mailx look up the mail server

ran:

You can check the man pages for mailx, dtmail, mail and sendmail. You will be able to grab some information from there.

Luis
ran_li
Regular Advisor

Re: how does mailx look up the mail server

I don't think man page tell you that, plus I tried to set DS in sendmail.cf and it does not work, as expected so I don't know what I did wrong. Thanks.
James R. Ferguson
Acclaimed Contributor

Re: how does mailx look up the mail server

Hi:

'sendmail' relys on having a viable DNS running, so first, do that.

You need to setup the smart relay macro in '/etc/mail/sendmail.cf'. You should have something like:

DSadmin.exchange.com

...for the DS macro which should be commented-out.

Also, add your server's hostname and FQDN to '/etc/mail/sendmail.cw' if its not already there.

You do *not* need to have the 'sendmail' daemon running to send out-going mails. Thus, if you wish, set SENDMAIL_SERVER=0 in ' /etc/rc.config.d/mailservs'.

Regards!

...JRF...

NMory
Respected Contributor

Re: how does mailx look up the mail server

Are you having some sort error messages in your config?, or when you are trying to send mail?

Just in case check this link also:
http://docs.hp.com/en/5991-4829/index.html

LN
ran_li
Regular Advisor

Re: how does mailx look up the mail server

Thanks for the reply.

--'sendmail' relys on having a viable DNS running, so first, do that.

>> yes, I have viable DNS running, but the situation is my host(FQDN) is in one domain(say host1.domain1.com) and the mail server (that I wish to use) is in another domain (mailhost1.domain2.com), both DNS server are correctly configured, from host host1.domain1.com I can nslookup and ping mailhost1.domain2.com, however, each time when I use mailx or sendmail it will use another mail server for delivering (mailhost2.domain2.com) so that's why I want to know the search path. I also tried to change the domain/nameserver in resolv.conf, it does not help either.

--You need to setup the smart relay macro in '/etc/mail/sendmail.cf'. You should have something like:

DSadmin.exchange.com

...for the DS macro which should be commented-out.

>> I did above but still mail won't be sent from this server
DSmailhost1.domain2.com

--Also, add your server's hostname and FQDN to '/etc/mail/sendmail.cw' if its not already there.

>> tried same as above.

--You do *not* need to have the 'sendmail' daemon running to send out-going mails. Thus, if you wish, set SENDMAIL_SERVER=0 in ' /etc/rc.config.d/mailservs'.

>> understand, thanks.
Bill Hassell
Honored Contributor

Re: how does mailx look up the mail server

And very important: The mail server (like Exchange) will always reject mail sent to it which is not addressed to anyone on that server. You must tell your mail server admin to allow your local HP-UX to relay messages through their server.


Bill Hassell, sysadmin
ran_li
Regular Advisor

Re: how does mailx look up the mail server

Actually, all the hosts that want to send mail from have been added to the allow list at maihost1.domain2.com, somehow, mail still go through the mailhost2.domain2.com instead of mailhost1.domain2.com.
...

Thanks!
V.Tamilvanan
Honored Contributor

Re: how does mailx look up the mail server

Hi,

Check the below link and /etc/rc.config.d/mailservs file.
http://devrsrc1.external.hp.com/STK/impacts/i216.html
ran_li
Regular Advisor

Re: how does mailx look up the mail server

/etc/rc.config.d/mailservs
export SENDMAIL_SERVER=1
export SENDMAIL_SERVER_NAME=