LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 07-20-2016, 07:55 AM   #1
flexihopper18
Member
 
Registered: Jan 2015
Posts: 30

Rep: Reputation: Disabled
Mailx Solaris Issue


Hi,

Can someone help to enable mailx on solaris box? When i tried to send a mail, status is always deferred.

bash-4.1$ cat /var/log/syslog
Jul 20 13:58:35 hqnisdb01 sendmail[14574]: [ID 801593 mail.info] u6KAwYEu014574: from=oracle, size=205, class=0, nrcpts=1, msgid=<201607201058.u6KAwYEu014574@hqnisdb01.domain.com>, relay=oracle@localhost
Jul 20 13:58:35 hqnisdb01 sendmail[14575]: [ID 801593 mail.info] u6KAwZj5014575: from=<oracle@hqnisdb01.domain.com>, size=518, class=0, nrcpts=1, msgid=<201607201058.u6KAwYEu014574@hqnisdb01.domain.com>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Jul 20 13:58:35 hqnisdb01 sendmail[14574]: [ID 801593 mail.info] u6KAwYEu014574: to=psDBA@domain.com, ctladdr=oracle (101/100), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30205, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (u6KAwZj5014575 Message accepted for delivery)
Jul 20 13:58:35 hqnisdb01 sendmail[14577]: [ID 801593 mail.info] u6KAwZj5014575: to=<psDBA@domain.com>, ctladdr=<oracle@hqnisdb01.domain.com> (101/100), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120518, relay=mailhost.domain.com, dsn=4.0.0, stat=Deferred: Name server: mailhost.domain.com: host name lookup failure
Jul 20 14:10:16 hqnisdb01 sendmail[18596]: [ID 801593 mail.info] u6KAwZj5014575: to=<psDBA@domain.com>, ctladdr=<oracle@hqnisdb01.domain.com> (101/100), delay=00:11:41, xdelay=00:00:00, mailer=esmtp, pri=210518, relay=mailhost.domain.com, dsn=4.0.0, stat=Deferred: Name server: mailhost.domain.com: host name lookup failure
Jul 20 14:22:09 hqnisdb01 sendmail[22855]: [ID 801593 mail.info] u6KBM9tL022855: Authentication-Warning: hqnisdb01.domain.com: oracle set sender to DBA@domain.com using -r
Jul 20 14:22:09 hqnisdb01 sendmail[22855]: [ID 801593 mail.info] u6KBM9tL022855: from=DBA@domain.com, size=1546210, class=0, nrcpts=1, msgid=<201607201122.u6KBM9tL022855@hqnisdb01.domain.com>, relay=oracle@localhost
Jul 20 14:22:09 hqnisdb01 sendmail[22856]: [ID 801593 mail.info] u6KBM9h2022856: from=<DBA@domain.com>, size=1546601, class=0, nrcpts=1, msgid=<201607201122.u6KBM9tL022855@hqnisdb01.domain.com>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Jul 20 14:22:09 hqnisdb01 sendmail[22855]: [ID 801593 mail.info] u6KBM9tL022855: to=psDBA@domain.com, ctladdr=DBA@domain.com (101/100), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=1576210, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (u6KBM9h2022856 Message accepted for delivery)
Jul 20 14:22:12 hqnisdb01 sendmail[22858]: [ID 801593 mail.info] u6KBM9h2022856: to=<psDBA@domain.com>, delay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=1666601, relay=mailhost.domain.com, dsn=4.0.0, stat=Deferred: Name server: mailhost.domain.com: host name lookup failure
Jul 20 14:23:47 hqnisdb01 sendmail[23758]: [ID 801593 mail.info] u6KBNlNP023758: Authentication-Warning: hqnisdb01.domain.com: oracle set sender to DBA@domain.com using -r
Jul 20 14:23:59 hqnisdb01 sendmail[23758]: [ID 801593 mail.info] u6KBNlNP023758: from=DBA@domain.com, size=1546202, class=0, nrcpts=1, msgid=<201607201123.u6KBNlNP023758@hqnisdb01.domain.com>, relay=oracle@localhost
Jul 20 14:24:04 hqnisdb01 sendmail[23784]: [ID 801593 mail.info] u6KBNxUZ023784: from=<DBA@domain.com>, size=1546585, class=0, nrcpts=1, msgid=<201607201123.u6KBNlNP023758@hqnisdb01.domain.com>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Jul 20 14:24:04 hqnisdb01 sendmail[23758]: [ID 801593 mail.info] u6KBNlNP023758: to=psDBA@gmail.com, ctladdr=DBA@domain.com (101/100), delay=00:00:17, xdelay=00:00:05, mailer=relay, pri=1576202, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (u6KBNxUZ023784 Message accepted for delivery)
Jul 20 14:25:19 hqnisdb01 sendmail[24116]: [ID 801593 mail.info] u6KAwZj5014575: to=<psDBA@domain.com>, ctladdr=<oracle@hqnisdb01.domain.com> (101/100), delay=00:26:44, xdelay=00:00:03, mailer=esmtp, pri=300518, relay=mailhost.domain.com, dsn=4.0.0, stat=Deferred: Name server: mailhost.domain.com: host name lookup failure
Jul 20 14:25:19 hqnisdb01 sendmail[24116]: [ID 801593 mail.info] u6KBM9h2022856: to=<psDBA@domain.com>, delay=00:03:10, xdelay=00:00:00, mailer=esmtp, pri=1756601, relay=mailhost.domain.com, dsn=4.0.0, stat=Deferred: Name server: mailhost.domain.com: host name lookup failure
Jul 20 14:25:53 hqnisdb01 sendmail[24430]: [ID 801593 mail.info] u6KBPmIJ024430: from=oracle, size=1546167, class=0, nrcpts=1, msgid=<201607201125.u6KBPmIJ024430@hqnisdb01.domain.com>, relay=oracle@localhost
Jul 20 14:25:58 hqnisdb01 sendmail[24456]: [ID 801593 mail.info] u6KBPr8V024456: from=<oracle@hqnisdb01.domain.com>, size=1546468, class=0, nrcpts=1, msgid=<201607201125.u6KBPmIJ024430@hqnisdb01.domain.com>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Jul 20 14:25:58 hqnisdb01 sendmail[24430]: [ID 801593 mail.info] u6KBPmIJ024430: to=psDBA@gmail.com, ctladdr=oracle (101/100), delay=00:00:10, xdelay=00:00:05, mailer=relay, pri=1576167, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (u6KBPr8V024456 Message accepted for delivery)
Jul 20 14:27:10 hqnisdb01 sendmail[24704]: [ID 801593 mail.info] u6KBRAfP024704: Authentication-Warning: hqnisdb01.domain.com: oracle set sender to DBA@domain.com using -r
Jul 20 14:27:15 hqnisdb01 sendmail[24704]: [ID 801593 mail.info] u6KBRAfP024704: from=DBA@domain.com, size=1546202, class=0, nrcpts=1, msgid=<201607201127.u6KBRAfP024704@hqnisdb01.domain.com>, relay=oracle@localhost
Jul 20 14:27:20 hqnisdb01 sendmail[24717]: [ID 801593 mail.info] u6KBRF3g024717: from=<DBA@domain.com>, size=1546585, class=0, nrcpts=1, msgid=<201607201127.u6KBRAfP024704@hqnisdb01.domain.com>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Jul 20 14:27:20 hqnisdb01 sendmail[24704]: [ID 801593 mail.info] u6KBRAfP024704: to=psDBA@gmail.com, ctladdr=DBA@domain.com (101/100), delay=00:00:10, xdelay=00:00:05, mailer=relay, pri=1576202, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (u6KBRF3g024717 Message accepted for delivery)
Jul 20 14:40:16 hqnisdb01 sendmail[29595]: [ID 801593 mail.info] u6KAwZj5014575: to=<psDBA@domain.com>, ctladdr=<oracle@hqnisdb01.domain.com> (101/100), delay=00:41:41, xdelay=00:00:00, mailer=esmtp, pri=390518, relay=mailhost.domain.com, dsn=4.0.0, stat=Deferred: Name server: mailhost.domain.com: host name lookup failure
Jul 20 14:40:16 hqnisdb01 sendmail[29595]: [ID 801593 mail.info] u6KBM9h2022856: to=<psDBA@domain.com>, delay=00:18:07, xdelay=00:00:00, mailer=esmtp, pri=1846601, relay=mailhost.domain.com, dsn=4.0.0, stat=Deferred: Name server: mailhost.domain.com: host name lookup failure
Jul 20 14:55:16 hqnisdb01 sendmail[2638]: [ID 801593 mail.info] u6KAwZj5014575: to=<psDBA@domain.com>, ctladdr=<oracle@hqnisdb01.domain.com> (101/100), delay=00:56:41, xdelay=00:00:00, mailer=esmtp, pri=480518, relay=mailhost.domain.com, dsn=4.0.0, stat=Deferred: Name server: mailhost.domain.com: host name lookup failure
Jul 20 14:55:16 hqnisdb01 sendmail[2638]: [ID 801593 mail.info] u6KBM9h2022856: to=<psDBA@domain.com>, delay=00:33:07, xdelay=00:00:00, mailer=esmtp, pri=1936601, relay=mailhost.domain.com, dsn=4.0.0, stat=Deferred: Name server: mailhost.domain.com: host name lookup failure
Jul 20 14:59:04 hqnisdb01 sendmail[23807]: [ID 801593 mail.info] u6KBNxUZ023784: to=<psDBA@gmail.com>, delay=00:35:00, xdelay=00:35:00, mailer=esmtp, pri=1666585, relay=mailhost.domain.com, dsn=4.0.0, stat=Deferred: Name server: mailhost.domain.com: host name lookup failure
Jul 20 14:59:04 hqnisdb01 sendmail[24498]: [ID 801593 mail.info] u6KBPr8V024456: to=<psDBA@gmail.com>, ctladdr=<oracle@hqnisdb01.domain.com> (101/100), delay=00:33:06, xdelay=00:33:06, mailer=esmtp, pri=1666468, relay=mailhost.domain.com, dsn=4.0.0, stat=Deferred: Name server: mailhost.domain.com: host name lookup failure
Jul 20 15:01:05 hqnisdb01 sendmail[24729]: [ID 801593 mail.info] u6KBRF3g024717: to=<psDBA@gmail.com>, delay=00:33:45, xdelay=00:33:45, mailer=esmtp, pri=1666585, relay=mailhost.domain.com, dsn=4.0.0, stat=Deferred: Name server: mailhost.domain.com: host name lookup failure
 
Old 07-21-2016, 02:29 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Jul 20 13:58:35 hqnisdb01 sendmail[14577]: [ID 801593 mail.info] u6KAwZj5014575: to=<psDBA@domain.com>, ctladdr=<oracle@hqnisdb01.domain.com> (101/100), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120518, relay=mailhost.domain.com, dsn=4.0.0, stat=Deferred: Name server: mailhost.domain.com: host name lookup failure
This is a DNS problem. Your mailserver tries to send the email to psDBA@domain.com but it cannot resolve mailhost.domain.com that I guess is the mailserver responsible for domain.com (the MX record in dns terms). To verify run:
Code:
nslookup -q=mx domain.com
Did you try to send an email to a different address (e.g. @gmail.com) and see what happens.
You can also use a different nameserver in /etc/resolv.conf and test again

Regards
 
Old 07-21-2016, 02:53 AM   #3
flexihopper18
Member
 
Registered: Jan 2015
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
This is a DNS problem. Your mailserver tries to send the email to psDBA@domain.com but it cannot resolve mailhost.domain.com that I guess is the mailserver responsible for domain.com (the MX record in dns terms). To verify run:
Code:
nslookup -q=mx domain.com
Did you try to send an email to a different address (e.g. @gmail.com) and see what happens.
You can also use a different nameserver in /etc/resolv.conf and test again

Regards
Thank you for the reply!

Yes, I also tried to send mail in my gmail and same error occur.

How can I use different nameserver?
 
Old 07-21-2016, 03:18 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Yes, I also tried to send mail in my gmail and same error occur.
That means that you use mailhost.domain.com as a smarthost.


Quote:
How can I use different nameserver?
As I've already told, you can add it in /etc/resolv.conf. E.g add the following line before the other occurrences of "nameserver ..."
Code:
nameserver 8.8.8.8
 
1 members found this post helpful.
Old 07-21-2016, 03:59 PM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Unless you use Solaris 11 in which case the resolv.conf file is only informative and dns client settings are handled by smf, e.g.:

Code:
svccfg -s network/dns/client setprop config/nameserver = net_address: "(8.8.8.8)"
 
2 members found this post helpful.
Old 07-27-2016, 02:47 AM   #6
flexihopper18
Member
 
Registered: Jan 2015
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
That means that you use mailhost.domain.com as a smarthost.



As I've already told, you can add it in /etc/resolv.conf. E.g add the following line before the other occurrences of "nameserver ..."
Code:
nameserver 8.8.8.8
Apologies, I'm a DBA and not familiar with most of unix terminologies. What IP should be provided for the nameserver?
 
Old 07-27-2016, 02:48 AM   #7
flexihopper18
Member
 
Registered: Jan 2015
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jlliagre View Post
Unless you use Solaris 11 in which case the resolv.conf file is only informative and dns client settings are handled by smf, e.g.:

Code:
svccfg -s network/dns/client setprop config/nameserver = net_address: "(8.8.8.8)"
Yes, we're using Solaris 11..
 
Old 07-27-2016, 03:24 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by flexihopper18 View Post
Apologies, I'm a DBA and not familiar with most of unix terminologies. What IP should be provided for the nameserver?
You can use 8.8.8.8 (it's google public dns IP), or ask your ISP for their dns IPs.
Then since you're running Solaris 11, use the svccfg command provided by jlliagre above, to set the nameserver.
 
1 members found this post helpful.
Old 07-27-2016, 03:35 AM   #9
flexihopper18
Member
 
Registered: Jan 2015
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
You can use 8.8.8.8 (it's google public dns IP), or ask your ISP for their dns IPs.
Then since you're running Solaris 11, use the svccfg command provided by jlliagre above, to set the nameserver.
Thanks bathory!!

I'll work with our server admin to have the change.

One more question, what do you mean I used mailhost.domain.com as a smarthost?
 
Old 07-27-2016, 04:12 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
One more question, what do you mean I used mailhost.domain.com as a smarthost?
You said that you get the same error (Name server: mailhost.domain.com: host name lookup failure) either while sending mail to your domain and to gmail. So I guess that you use mailhost.domain.com as a smarthost for outgoing mail.
Otherwise your mailserver would contact directly the mailserver of your domain and the gmail mailserver, i.e. without the need of mailhost.domain.com in both cases.

To verify if that's the case, you can run:
Code:
grep ^DS /etc/mail/sendmail.cf
 
Old 07-27-2016, 05:37 AM   #11
flexihopper18
Member
 
Registered: Jan 2015
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
You said that you get the same error (Name server: mailhost.domain.com: host name lookup failure) either while sending mail to your domain and to gmail. So I guess that you use mailhost.domain.com as a smarthost for outgoing mail.
Otherwise your mailserver would contact directly the mailserver of your domain and the gmail mailserver, i.e. without the need of mailhost.domain.com in both cases.

To verify if that's the case, you can run:
Code:
grep ^DS /etc/mail/sendmail.cf
Yes, same error when sending to my domain and gmail. Below is result when I run the command.
Code:
bash-4.1$ grep ^DS /etc/mail/sendmail.cf
DS
bash-4.1$
 
Old 07-27-2016, 06:52 AM   #12
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
bash-4.1$ grep ^DS /etc/mail/sendmail.cf
DS
Huh, there is no smarthost configured in sendmail.cf!!! Maybe it's configured in some other file (like submit.cf, mailertable etc). Run the following to see if that's the case (replace mailhost.domain.com with your actual mailserver hostname):
Code:
grep -r mailhost.domain.com /etc/mail/
And just to verify, what is the output of the next 2 commands:
Code:
sendmail -bv psDBA@domain.com
sendmail -bv someuser@gmail.com

Last edited by bathory; 07-27-2016 at 07:30 AM.
 
Old 07-27-2016, 08:09 AM   #13
flexihopper18
Member
 
Registered: Jan 2015
Posts: 30

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
Huh, there is no smarthost configured in sendmail.cf!!! Maybe it's configured in some other file (like submit.cf, mailertable etc). Run the following to see if that's the case (replace mailhost.domain.com with your actual mailserver hostname):
Code:
grep -r mailhost.domain.com /etc/mail/
bash-4.1$ grep <mailserver> /etc/mail/

No output returned :|


Quote:
And just to verify, what is the output of the next 2 commands:
Code:
sendmail -bv psDBA@domain.com
sendmail -bv someuser@gmail.com
bash-4.1$ sendmail -bv psDBA@domain.com
bash: sendmail: command not found
bash-4.1$ mailx -bv psDBA@domain.com
Subject: Test Mail

It hang after entering the subject. Sendmail can't found. I used mailx instead.
 
Old 07-27-2016, 08:42 AM   #14
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
sendmail -bv psDBA@domain.com
bash: sendmail: command not found
Well, sendmail is not in your PATH. Try:
Code:
/usr/lib/sendmail -bv psDBA@domain.com
/usr/lib/sendmail -bv someuser@gmail.com

Quote:
Sendmail can't found. I used mailx instead.
mailx is a mail client and as such it needs an smtp server in order the send out the mail. That is what sendmail is doing. If you lokk at your OP you'll see that the logs are from sendmail

Anyway, ince you cannot find a reference to a smarthost in your sendmail config files, check the mailx config files (either /etc/mail.rc or .mailrc in your home directory) where a relay can also be defined.

IMO you should first try to resolve the dns problem and if you still cannot send email we can investigate further.

Regards
 
Old 07-30-2016, 04:32 AM   #15
flexihopper18
Member
 
Registered: Jan 2015
Posts: 30

Original Poster
Rep: Reputation: Disabled
Hi,

First of all, thank you for giving response on my concern

Issue has been fixed by adding the mail server on the /etc/hosts.

Reference1
Reference2

Thank you lq!!

Last edited by flexihopper18; 07-30-2016 at 04:33 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Solaris 10 performance issue talksanjiv Solaris / OpenSolaris 3 03-12-2012 08:16 AM
mailx issue Linux_Kidd Linux - Software 3 05-29-2010 12:30 PM
Solaris LDD issue Mike_the_Man Solaris / OpenSolaris 1 07-31-2009 03:47 PM
DNS issue Solaris 10 metallica1973 Solaris / OpenSolaris 6 11-28-2007 02:56 PM
NIS issue for solaris 10 UltraSoul Solaris / OpenSolaris 16 05-28-2007 11:27 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 07:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration