Operating System - HP-UX
1751778 Members
4555 Online
108781 Solutions
New Discussion юеВ

Re: how does mailx look up the mail server

 
Phillip Thayer
Esteemed Contributor

Re: how does mailx look up the mail server

Check the contects of the /etc/nsswitch.conf and make sure they are really correct. Also, shouldn't you have a specific mail server name in the
export SENDMAIL_SERVER_NAME= line? Something like:

export SENDMAIL_SERVER_NAME=mailhost1.domain2.com

Phil
Once it's in production it's all bugs after that.
ran_li
Regular Advisor

Re: how does mailx look up the mail server

/etc/nsswitch.conf
passwd: files ldap
group: files ldap
hosts: files ldap dns
networks: files ldap
protocols: files ldap
rpc: files ldap
publickey: files
netgroup: files ldap
automount: ldap files
aliases: files
services: files ldap

I don't have any value for SENDMAIL_SERVER_NAME in /etc/rc.config.d/mailservs, do I have to?

mailx does not require sendmail daemon to be runing right.

Thanks!
Kasper Haitsma
Trusted Contributor

Re: how does mailx look up the mail server

Hi,

to emulate, how sendmail is looking up the mail destination, and works out how mail will get there, type:

nslookup -q=mx
e.g.
nslookup -q=mx hp.com

this results in a list with weighed mail relays (MX records). the lowest number will be attempted first.
you can also verify if the mail relay you intnd to use has the most important MX-record for itself, from the system you are sending from (this can vary)

nslookup -q=mx mailhost1.domain2.com

if this seems in order, you can test your sendmail.cf configuration file, by starting it in testmode:

sendmail -bt
> /parse user@dest.domain.

this will give you the real mailertype, relay and "destination user" sendmail will be using
i.e.
mailer smtp, host relay.domain.com, user user@dest.domain

you need to quit test mode using
with regards to the nsswitch.conf, do you need ldap and dns for host lookup, for the applications running on the system? if not, you could just have files in this line and add mailhost1 to /etc/hosts (if sendmail can only find mailhost1, it can only use that one)

if the result of the test is not what you want, and you need to use ldap and dns for hosts lookup, you could build a new sendmail.cf:

cd /usr/newconfig/etc/mail/cf/cf
./gen_cf

and answer the questions you find appropriate

HTH

kasper
hp
It depends
ran_li
Regular Advisor

Re: how does mailx look up the mail server

Thanks for the details!

nslookup -q=mx mailhost1.domain2.com
Using /etc/hosts on: hp03

looking up FILES
Trying DNS
mailhost1.domain2.com preference = 5, mail exchanger = mailhost1.domain2.com
mailhost1.domain2.com internet address = 14x.13x.1x.1x

One of the test result that I don't understand is if I did not specify the DS entry in sendmail.cf, and this host(hp03) is NOT in the allow relay list on mailhost1.domain2.com, mail still can be send out to my corporate email account as well as Internet email account(yahoo), but the mail headers are different.

1. for the mail arrived at my corporate mailbox, the header says it uses mailhost1.domain2.com for the mail routing.

2. for the mail arrived at my internet(yahoo) mailbox, the header says it uses 2x7.1x7.5x.1x,

3. I could not lookup this IP address(2x7.1x7.5x.1x) anywhere on the internal LAN, however it can be resolved outside on the internet(outside the corporate network).

It must be a legacy mail server somewhere (because of the company's acquisition), but I m wondering what is the mail route and how the DNS and mail server configuration will affect it.

We use ldap for user authentication, automount and netgroup, it has hosts entries but we use DNS to lookup the hosts.

Regards!
gopal.ak
New Member

Re: how does mailx look up the mail server

Hi !! ALL !
I am naive member to this forum.
The topic initiated, here would have been initaied by me today as i have to send message using mailx. SO i would like.. to have summarized , rather documented version of this usage, which will help me. So plz.. reply.. I am sure Mr ran_li will reply.. looking forward for ur replies .... & suggegstions..
ran_li
Regular Advisor

Re: how does mailx look up the mail server

gopal.ak,

what is your question or problem encountered.

Ran
ran_li
Regular Advisor

Re: how does mailx look up the mail server

gopal.ak,

Please initialize another thread for your questions, my problem is not apply to your case specifically.

Ran