cancel
Showing results for 
Search instead for 
Did you mean: 

sendmail configuration

mwagiru
Frequent Advisor

sendmail configuration

I have configured sendmail to send mail to internal users in our LAN via MS Exchange but I cant get it to send mail outside like to xyz@gmail.com.
What do I need to do?
20 REPLIES
Peter Godron
Honored Contributor

Re: sendmail configuration

Hi,
can you please read:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=213290
and
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=76524

Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.

Your profile shows you have yet to reward any answer with points !
Mobeen_1
Esteemed Contributor

Re: sendmail configuration

Please review the link below and that should provide you details

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=973651

regards
Mobeen
mwagiru
Frequent Advisor

Re: sendmail configuration

I need to configure sedmail to send mail as admin@domain.com but now it sends as root@hostname.domain.net

Peter Godron
Honored Contributor

Re: sendmail configuration

Hi,
that is a new question.
Please see:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1016691

If your questions are now answered please complete this question by assignining points and closing the thread.
mwagiru
Frequent Advisor

Re: sendmail configuration

Why does my sendmail try to resolve?
I can send all emails to internal LAN, but I cant send to external email like gmail.See my partial attached output.
Keith Johnson
Valued Contributor

Re: sendmail configuration

Your /etc/nsswitch.conf file determines how your system will attempt to resolve host names.

Your /etc/nsswitch.conf file specifies the DNS server(s) you want to use to resolve host names.

This specific tells you that the server cannot get to any of the DNS servers specified in your /etc/resolv.conf file.
No matter where you go...there you are.
Keith Johnson
Valued Contributor

Re: sendmail configuration

Your /etc/nsswitch.conf file specifies the DNS server(s) you want to use to resolve host names.

That should be, "Your /etc/resolv.conf file specifies the DNS server(s) you want to use to resolve host names.

Sorry for any confusion.
No matter where you go...there you are.
mwagiru
Frequent Advisor

Re: sendmail configuration

sendmail -v -d8.99 -d38.99 bmwagiru@yahoo.com
;; res_querydomain(lmsapp, safaricom.net, 1, 1)
;; res_query(lmsapp.safaricom.net, 1, 1)
;; Querying server (# 1) address = 172.29.200.99
seq_map_parse(aliases.files, )
_res.options = 52c7, HasWildcardMX = 0
;; res_query(181.200.29.172.in-addr.arpa, 1, 12)
;; Querying server (# 1) address = 172.29.200.99
;; res_querydomain(lmsapp.safaricom.net., , 1, 1)
;; res_query(lmsapp.safaricom.net, 1, 1)
;; Querying server (# 1) address = 172.29.200.99
;; res_query(1.0.0.127.in-addr.arpa, 1, 12)
;; Querying server (# 1) address = 172.29.200.99
;; res_querydomain(localhost., , 1, 1)
;; res_query(localhost, 1, 1)
;; Querying server (# 1) address = 172.29.200.99
openmap() dequote:dequote NULL: valid
openmap() host:host NULL: valid
getcanonname(yahoo.com), trying dns
dns_getcanonname(yahoo.com, trymx=1)
dns_getcanonname: trying yahoo.com. (A)
;; res_querydomain(yahoo.com, , 1, 1)
;; res_query(yahoo.com., 1, 1)
;; Querying server (# 1) address = 172.29.200.99
;; Querying server (# 2) address = 172.29.200.134
;; Querying server (# 3) address = 172.29.200.11
;; Querying server (# 1) address = 172.29.200.99
;; Querying server (# 2) address = 172.29.200.134
;; Querying server (# 3) address = 172.29.200.11
;; Querying server (# 1) address = 172.29.200.99
;; Querying server (# 2) address = 172.29.200.134
;; Querying server (# 3) address = 172.29.200.11
;; Querying server (# 1) address = 172.29.200.99
;; Querying server (# 2) address = 172.29.200.134
;; Querying server (# 3) address = 172.29.200.11
;; res_query: send error
NO: errno=238, h_errno=2
dns_getcanonname: trying yahoo.com. (MX)
;; res_querydomain(yahoo.com, , 1, 15)
;; res_query(yahoo.com., 1, 15)
;; Querying server (# 1) address = 172.29.200.99
;; Querying server (# 2) address = 172.29.200.134
;; Querying server (# 3) address = 172.29.200.11
;; Querying server (# 1) address = 172.29.200.99
;; Querying server (# 2) address = 172.29.200.134
;; Querying server (# 3) address = 172.29.200.11
;; Querying server (# 1) address = 172.29.200.99
;; Querying server (# 2) address = 172.29.200.134
;; Querying server (# 3) address = 172.29.200.11
;; Querying server (# 1) address = 172.29.200.99
;; Querying server (# 2) address = 172.29.200.134
;; Querying server (# 3) address = 172.29.200.11
;; res_query: send error
NO: errno=238, h_errno=2
dns_getcanonname: trying yahoo.com.safaricom.net (A)
;; res_querydomain(yahoo.com, safaricom.net, 1, 1)
;; res_query(yahoo.com.safaricom.net, 1, 1)
;; Querying server (# 1) address = 172.29.200.99
;; rcode = 3, ancount=0
NO: errno=0, h_errno=1
getcanonname(yahoo.com), trying files
text_getcanonname(yahoo.com)
getcanonname(yahoo.com), failed, status=68
yahoo.com: Name server timeout
bmwagiru@yahoo.com... Transient parse error -- message queued for future delivery
mwagiru
Frequent Advisor

Re: sendmail configuration

I have configured my /etc/mail/sendmail.cf with a smtp server
DS172.31.100.69


Why can't sendmail send to xyz@yahoo.com ?
My /etc/rc.config.d/mailservs has
export SENDMAIL_SERVER=1
export SENDMAIL_SERVER_NAME=""

help!
Keith Johnson
Valued Contributor

Re: sendmail configuration

It looks as if you are not able to query your DNS server.

Check your /etc/nsswitch.conf and /etc/resolv.conf files to ensure they are configured correctly for how you want to do name resolution.

1. If you are using DNS for resolution, your /etc/nsswitch.conf file should have an entry like:

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

And, your resolv.conf file should list the DNS servers for your site and should look like:

domain your.domain
nameserver
(Note that you can list up to 3 nameservers.

2. If you are using /etc/hosts as your only name resolution, make the hosts line in the /etc/nsswitch.conf file read:

hosts: files [NOTFOUND=continue]

Also in this scenario, if you have an /etc/resolv.conf file, move it elsewhere.

Once these are configured properly try an nslookup on the address to which you want to send mail.
No matter where you go...there you are.
mwagiru
Frequent Advisor

Re: sendmail configuration

/sbin/init.d/sendmail start
Starting sendmail [ OK ]
Starting sm-client [FAILED]
Steven E. Protter
Exalted Contributor

Re: sendmail configuration

Shalom,

Hi, whats the OS? Sendmail on HP-UX doesn't do that(the smclient part).

I believe based on reading the entire thread and a sickening level of experience with sendmail that you have done everything right.

The relay server referred to in the DS directive is mishandling the mail. That server has a problem not the one you are working with.

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
mwagiru
Frequent Advisor

Re: sendmail configuration

The relay server is an MS Exchange server.
And yes, the OS is HP-UX 11.11i

Apparently, when I send mail to internal recipient it arrives but still shows a great deal of :
;; Querying server (# 1) address = 172.29.200.99
;; Querying server (# 2) address = 172.29.200.134
;; Querying server (# 3) address = 172.29.200.11
;; Querying server (# 1) address = 172.29.200.99
;; Querying server (# 2) address = 172.29.200.134
;; Querying server (# 3) address = 172.29.200.11
;; res_query: send error
;; res_querydomain(172.31.100.69, , 1, 15)
;; res_query(172.31.100.69., 1, 15)
;; Querying server (# 1) address = 172.29.200.99
;; Querying server (# 2) address = 172.29.200.134
;; Querying server (# 3) address = 172.29.200.11
;; Querying server (# 1) address = 172.29.200.99
;; Querying server (# 2) address = 172.29.200.134
;; Querying server (# 3) address = 172.29.200.11
;; Querying server (# 1) address = 172.29.200.99
;; Querying server (# 2) address = 172.29.200.134
;; Querying server (# 3) address = 172.29.200.11
;; Querying server (# 1) address = 172.29.200.99
;; Querying server (# 2) address = 172.29.200.134
;; Querying server (# 3) address = 172.29.200.11


But finally :


;; res_query: send error
getmxrr: res_search(172.31.100.69) failed (errno=238, h_errno=2)
bwachira@safaricom.co.ke... Connecting to 172.31.100.69 via relay...
;; res_query(181.200.29.172.in-addr.arpa, 1, 12)
;; Querying server (# 1) address = 172.29.200.99
;; res_querydomain(lmsapp.safaricom.net., , 1, 1)
;; res_query(lmsapp.safaricom.net, 1, 1)
;; Querying server (# 1) address = 172.29.200.99
220 svdt1exch01.safaricom.net Microsoft ESMTP MAIL Service, Version: 6.0.3790.1830 ready at Wed, 7 Mar 2007 18:21:34 +0300
>>> EHLO lmsapp.safaricom.net
250-svdt1exch01.safaricom.net Hello [172.29.200.181]
250-TURN
250-SIZE
250-ETRN
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250-X-EXPS GSSAPI NTLM LOGIN
250-X-EXPS=LOGIN
250-AUTH GSSAPI NTLM LOGIN
250-AUTH=LOGIN
250-X-LINK2STATE
250-XEXCH50
250 OK
>>> MAIL From: SIZE=9 AUTH=root@lmsapp.safaricom.net
250 2.1.0 root@lmsapp.safaricom.net....Sender OK
>>> RCPT To:
>>> DATA
250 2.1.5 bwachira@safaricom.co.ke
354 Start mail input; end with .
>>> .
250 2.6.0 <200703071513.l27FDNSw015263@lmsapp.safaricom.net> Queued mail for delivery
bwachira@safaricom.co.ke... Sent ( <200703071513.l27FDNSw015263@lmsapp.safaricom.net> Queued mail for delivery)
Closing connection to 172.31.100.69
>>> QUIT
221 2.0.0 svdt1exch01.safaricom.net Service closing transmission channel
closemaps: closing host (NULL)
closemaps: closing dequote (NULL)


The email is sent ...so whats the problem ??
Keith Johnson
Valued Contributor

Re: sendmail configuration

Check the following link for information regarding the "Starting sm-client [FAILED]" error you're receiving, it may help.

http://www.sendmail.org/~ca/email/doc8.12/SECURITY

For your other error, mail not leaving your server, I still think it might be DNS related based on these error messages:

;; Querying server (# 1) address = 172.29.200.99
;; rcode = 3, ancount=0
NO: errno=0, h_errno=1
getcanonname(yahoo.com), trying files
text_getcanonname(yahoo.com)
getcanonname(yahoo.com), failed, status=68
yahoo.com: Name server timeout

So please try this command and let us know the result:

nslookup yahoo.com
No matter where you go...there you are.
mwagiru
Frequent Advisor

Re: sendmail configuration

nslookup yahoo.com
*** Warning - the local domain is not set.
*** Either hostname should be a domain name,
*** the domain should be specified in /etc/resolv.conf,
*** or the shell variable LOCALDOMAIN should be set.

Name Server: svdt1ad01.safaricom.net
Address: 172.29.200.99

Trying DNS
looking up FILES
*** No address information is available for "yahoo.com"
mwagiru
Frequent Advisor

Re: sendmail configuration

I included the domain in /etc/resolve.conf


nslookup yahoo.com
Name Server: svdt1ad01.safaricom.net
Address: 172.29.200.99

Trying DNS
looking up FILES
*** No address information is available for "yahoo.com"
mwagiru
Frequent Advisor

Re: sendmail configuration

Why does my sendmail attempt to resolve?
I want it to send all request to my relay server (Exchange Server) which is connected to the internet.

My Sun server has sendmail and it sends all requests to the Exchange Server which will take it from there.


Huh?????
Sameer_Nirmal
Honored Contributor

Re: sendmail configuration

You need to ask MS Exchange server administrator to add the host in the relay list. This will allow this host to send email outside world's domain.

Regarding sm-client error, you need to take a look at the error messages in /var/adm/syslog/mail.log

Unless otherwise required as mail server, you don't need to run sendmail as server.
mwagiru
Frequent Advisor

Re: sendmail configuration

Finally....
I found the culprit....I just commented out this line:

# pass to name server to make hostname canonical
#R$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4

Thanks guys for your help!!!
mwagiru
Frequent Advisor

Re: sendmail configuration

Problem solved