Operating System - HP-UX
1834491 Members
3248 Online
110067 Solutions
New Discussion

Cannot send mail to outside the machine

 
SOLVED
Go to solution
Sridhar Rami reddy
Occasional Advisor

Cannot send mail to outside the machine

Hi,
I am DBA trying to work on some scripts to send me e-mail once the job of the scripts is done. But I was getting error from MAILER-DAEMON as Host Un-Known.
I tried this from Command prompt.
mailx -s "TEST" "xxxxxx@yahoo.com" < /dev/null

I got the same error as above. But when I tried to send the mail to a unix userid, it was successful.

mailx -s "TEST" unixid < /dev/null

I looked into some of the Forum pages and tried to ping www.yahoo.com or so. I got 'unknown host' error. I feel some thing is missing in setting up the Network. We have another server which is working fine( I don't know how it was setup before).

I am not a HP System Guy, so I will be thankful if you can let me know like
step1 : if file1 exists1
then step2
else step2
like that.

Any help in this regard will be greatly appreciated.

thanks a bunch in advance.
Sri
6 REPLIES 6
S.K. Chan
Honored Contributor

Re: Cannot send mail to outside the machine

Check /etc/mail/sendmail.cf on the server that works and look for this line :-
D{OutboundRelay esmtp:
Is the SMTP relay server defined here the same as the one defined in the "problematic" server? If not change it and restart sendmail. It would be helpful (for troubleshooting) if you use ..

$ sendmail -v bob@yahoo.com

to test this.
Kevin Wright
Honored Contributor

Re: Cannot send mail to outside the machine

Looks like DNS is not setup correctly, try to nslookup some hostnames and see what happens, probably get host not found errors.
put in /etc/resolv.conf
nameserver

then try to do more nslookups..this is a good start anyway.
Bill Hassell
Honored Contributor
Solution

Re: Cannot send mail to outside the machine

sendmail can't send mail to anywhere it doesn't know about. Typically, your DNS server will provide help by having MX (mail delivery) records indicating where to send the mail. Unless your machine is directly connected to the network, you'll need a helper machine that will accept the email and forward the message. Since ping returns yahoo.com as host unknown, then your DNS server is not setup correctly.

Use this to see MX records:

# nslookup -type=mx yahoo.com | grep exchanger

You can try alternate DNS servers with:

# nslookup -type=mx yahoo.com alt_server_name | grep exchanger

If neither produces output, you'll need to talk to your network administrator or DNS server administrator.


Bill Hassell, sysadmin
Mark Fenton
Esteemed Contributor

Re: Cannot send mail to outside the machine

Definately a DNS issue, assuming that your box is connected to the internet.

Step one is to edit /etc/resolv.conf as Kevin said. -- note you can include any number of nameserver entries (one per line), though typically one need not use more than two or three.

Step two is to verify that DNS is being searched: check /etc/nsswitch.conf , which should have a line like

hosts: files [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=continue] dns

(variations are possible, but dns ought to be in there somewhere)

Step three is to test per Bill's instructions. If there's still no joy, you could have a firewall issue, and you will need to bump the question up to the network admin side of the house.

Sanjay_6
Honored Contributor

Re: Cannot send mail to outside the machine

Sridhar Rami reddy
Occasional Advisor

Re: Cannot send mail to outside the machine

Thanks to all.
I tried everything as you all told. But I couldn't figure it out. So as Bill, Mark said, I am giving this problem to my Network Admin. He will take care of this.

thanks again.
Sri