Operating System - HP-UX
1827245 Members
2211 Online
109716 Solutions
New Discussion

Re: sendmail and name resolution

 
SOLVED
Go to solution
Christopher Little_2
Frequent Advisor

sendmail and name resolution

I'm having a problem getting sendmail to send e-mail to external e-mail addresses. I'm currently routing all outbound smtp mail through an smtp relay. I only have internal dns (can't resolve internet addresses).

If I telnet directly to the smtp relay, I can send an e-mail to an external address. This at least tells me that the smtp relay is working correctly. When I try to send from my HP-UX system, this is what I get in the mail.log file when trying to send an e-mail to boomshnka@yahoo.com from my address (christopher.little@gx.novartis.com):

Jun 12 15:31:00 usbrsapl sendmail[20180]: PAA20180: from=littlch1, size=141, class=0, pri=30141, nrcpts=1, msgid=<200306
122131.PAA20180@mail.novartis.com>, relay=littlch1@localhost
Jun 12 15:31:00 usbrsapl sendmail[20182]: PAA20180: to=boomshnka@yahoo.com, ctladdr=littlch1 (204/20), delay=00:00:00, x
delay=00:00:00, mailer=esmtp, relay=yahoo.com, stat=Host unknown (Name server: yahoo.com: host not found)

Jun 12 15:31:00 usbrsapl sendmail[20182]: PAA20180: PAA20182: DSN: Host unknown (Name server: yahoo.com: host not found)

Jun 12 15:31:01 usbrsapl sendmail[20182]: PAA20182: to=christopher.little@gx.novartis.com, delay=00:00:01, xdelay=00:00:
01, mailer=esmtp, relay=nvchbs-mailgw1.is.chbs. [192.37.33.74], stat=Sent (XAA11961 Message accepted for delivery)

One promissing solution that I found involved commenting the section "pass to name server to make hostname canonical" and then changing all occurences of "F=mDFMuX" to "F=0mDFMuX" under "SMTP Mailer speccification". The following is what I get in the mail.log file when trying to send the same previous e-mail:

Jun 12 15:41:32 usbrsapl sendmail[20457]: PAA20457: from=littlch1, size=138, class=0, pri=30138, nrcpts=1, msgid=<200306
122141.PAA20457@mail.novartis.com>, relay=littlch1@localhost
Jun 12 15:41:33 usbrsapl sendmail[20460]: PAA20457: to=boomshnka@yahoo.com, ctladdr=littlch1 (204/20), delay=00:00:01, x
delay=00:00:01, mailer=esmtp, relay=yahoo.com, stat=Host unknown (Name server: yahoo.com: host not found)

Jun 12 15:41:33 usbrsapl sendmail[20460]: PAA20457: PAA20460: DSN: Host unknown (Name server: yahoo.com: host not found)

Jun 12 15:41:33 usbrsapl sendmail[20460]: PAA20460: to=christopher.little@gx.novartis.com, delay=00:00:00, xdelay=00:00:
00, mailer=esmtp, relay=gx.novartis.com, stat=Host unknown (Name server: gx.novartis.com: no data known)

Jun 12 15:41:33 usbrsapl sendmail[20460]: PAA20460: PAB20460: return to sender: Host unknown (Name server: gx.novartis.c
om: no data known)

Jun 12 15:41:33 usbrsapl sendmail[20460]: PAB20460: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, stat=Sent

This actually turns out to make me worse off than before as I can't even send to local address anymore. I get the same errors as stated above. Any ideas? I'd be glad to send an entire copy of my sendmail.cf file and any other info to anybody that's willing to take a crack at it. Thanks.

Chris
12 REPLIES 12
Paul Sperry
Honored Contributor

Re: sendmail and name resolution

I'd look into your /etc/resolv.conf file.
Jerome Henry
Honored Contributor

Re: sendmail and name resolution

Sounds stupid, but why don't you add a second public DNS server to your private one ?
You can lean only on what resists you...
Christopher Little_2
Frequent Advisor

Re: sendmail and name resolution

Paul - resolv.conf is set to use files and then dns. It has to be this way and I can't change it.

Jerome - I have no control over our DNS environment and would likely have no luck in getting it changed.

Thanks for the replies guys. I'm really just hoping that there is some bit of magic out there for forcing the name resolution to take place at the smtp relay.

Chris
Paul Sperry
Honored Contributor

Re: sendmail and name resolution

No that should be in your /etc/nsswitch.conf file.

/etc/resolve.conf should have

domain YourDomain
nameserver IP_of_your_nameserver
Christopher Little_2
Frequent Advisor

Re: sendmail and name resolution

Sorry about that, brain is a little frazzled today. The resolv.conf file is setup correctly and resolves everything internal with no problems.
Paul Sperry
Honored Contributor

Re: sendmail and name resolution

can you lookup any thing?

# nslookup msn.com
Using /etc/hosts on: moron

looking up FILES
Trying DNS
Non-authoritative answer:
Name: msn.com
Address: 207.68.172.246
Christopher Little_2
Frequent Advisor

Re: sendmail and name resolution

No, I cannot lookup anything via our internal DNS. The really strange thing is that there are other groups here using the same smtp relay successfully, but from a Windows based mail program. They have the same DNS setup as the Unix systems but it just seems to work for them.
Steven E. Protter
Exalted Contributor

Re: sendmail and name resolution

You need to initiate mail relay if you can't resolve outside hosts directly.

Before you start, the server you intend to relay off of must accept relay mail from your HP box. This can be a pain with exchange, but it can be done. Its a lot easier to set up on a firewall/smtp server like Symmantec.

in the sendmail.cf file

DS
[IP_address_of_relay_server]

save it

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

You are ready to run a test mail.

sendmail -v -d8.99 -d38.99 someone@yahoo.com

Type a line of text

type a dot(period)

You will get good diagnostics.

One note: Yahoo aol and others will not accept mail unless the sending server resolves via public internet dns.

In mail relay, the relay server needs to have an address that can be resolved publically. If that happens to be your HP-UX server down the line in problem resolution, you sending mail server is going to need a publically resolvable name EVEN if its behind a firewall and that name resolves to an external mail server or isp.

Few ways to do that.

the Dj parameter in sendmail.cf

uncomment it and make it

Djmail.yourdomain.net

Or make your hostname in /etc/rc.config.d/netconf publically resolveable. That's not always an option on the business side of the firewall.

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
Bill Douglass
Esteemed Contributor
Solution

Re: sendmail and name resolution

If I understand you correctly, you want to have all your e-mail relayed through a "smart" mail host, which is capable of sending mail to external hosts.

This means you should have the DS macro defined in your sendmail.cf file like so:

DSfw-mail1.novartis.com

I'm taking this from your domain's MX records. Your relay's internal hostname may be different.

You also need to be sure that either /etc/hosts or your internal DNS can resolve the hostname of your mail relay. From there, all e-mail should flow correctly.

Con O'Kelly
Honored Contributor

Re: sendmail and name resolution

Hi

I'd say Steven is correct in that you need to set the DS paramater in the /etc/mail/sendmail.cf file as follows
DS.
If you can resolve internal DNS names (ie your smtp relay) then you can use name in place of IP address.

Its a while since I've done this but from memory that works fine.

Cheers
Con
yogesh_4
Regular Advisor

Re: sendmail and name resolution

After observing the o/p given by you , it seems to be dns error. if u give #nslookup yahoo.com then it should show you the address of yahoo site. Also you can try #./sendmail -v xyz@yahoo.com. This will through some erros on to the screen. If it gives error like host unknown then your server is not able to connnect to DNS or your web server entry has been removed from the ISP's DNS
Christopher Little_2
Frequent Advisor

Re: sendmail and name resolution

Bill, you nailed it. As soon as I changed the smart relay entry from mail.novartis.com to fw-mail1.novartis.com it worked. Thanks!!

Chris