Solaris – Sendmail Troubleshooting Reference
Other Learning Articles that you may like to read
Free Courses We Offer
Paid Training Courses we Offer
The Difference Between the Sendmail Daemon in Solaris 9/10 and Prior versions
In Solaris 8 and prior versions has one mail queue:
– /var/spool/mqueue
In Solaris 9 and above, sendmail uses two queue structure, as below :
– /var/spool/mqueue managed by “/usr/lib/sendmail -bd -q15m” daemon owned by root.– /var/spool/clientmqueue managed by “/usr/lib/sendmail -Ac -q15m” which is owned by smmsp
There two roles for sendmail:
- Mail submission program ( MSP )
- Mail transport agent ( MTA ).
Mail Transport Agent
Mail Submission Program
Sendmail acts as MSP as per the configuration made into `/etc/mail/submit.cf’ . Both the files `/etc/mail/submit.cf’ and `/etc/mail/sendmail.cf’ share a common syntax and most sendmail configuration options can be used in either configuration file.
Daemon Mode : By default, Sendmail on Solaris 9 and 10 runs the two processes mentioned above, this is called Daemon Mode.Mail Submission Program Mode – In this mode only acts as mail submission program, but there are limitations to doing this.
Sendmail Troubleshooting for Mail Sending Issues
Below are the Guidelines to Diagnosis and Troubleshoot main sending issues in sendmail.
[tabs]
[tab title=”Mail client setup“]
Steps to ensure that your mail client setup is correctly configured
Check the Port with below command
# telnet mailserver.mydomain.com 25
Valid Sendmail server will answer with a following similar output:
220 mailserver.mydomain.com ESMTP Sendmail 8.13.8+Sun/8.13.8; Mon, 21 Apr 2008 11:36:17 +0200 (CEST)
When you type the ‘help’ command the available commands the mail server understands are listed:
214-2.0.0 This is sendmail version 8.13.8+Sun
214-2.0.0 Topics:
214-2.0.0 HELO EHLO MAIL RCPT DATA
214-2.0.0 RSET NOOP QUIT HELP VRFY
214-2.0.0 EXPN VERB ETRN DSN STARTTLS
214-2.0.0 For more info use “HELP <topic>”.
214-2.0.0 To report bugs in the implementation contact Sun Microsystems
214-2.0.0 Technical Support.
214-2.0.0 For local information send email to Postmaster at your site.
214 2.0.0 End of HELP info
Try the following to send an e-mail from the command line:
helo clienthostname.mydomain.com
250 clienthostname.mydomain.com Hello clienthostname.mydomain.com [xx.xx.xx.xx], pleased to meet you
mail from:myname@mydomain.com
250 2.1.0 myname@mydomain.com… Sender ok
rcpt to:recepientname@recepientdomainname.com
250 2.1.5 recepientname@recepientdomainname.com… Recipient ok
data
354 Enter mail, end with “.” on a line by itself
subject: This is a test
to:recepientname@recepientdomainname.com
This contains the BODY of a test mail
.
250 2.0.0 m3L9aH0W018247 Message accepted for delivery
quit
221 2.0.0 mailserver.mydomain.com closing connection
Note the dot (“.”) at the end of the mail body.
If this test succeeds (mail is delivered to it’s final destination), then most likely the issues is with the mail client configuration .
– ethereal– wireshark– netcap– tcpdump– snoop
[/tab]
[tab title=”Network checks“]
Steps to validate the network path between the mail client and mail server
# getent hosts myserver192.168.1.228 myserver
#ping IPaddress or hostname#traceroute IPaddress or hostname
# svcs | grep sshonline Nov_15 svc:/network/ssh:default
[/tab]
[tab title=”Service Checks“]
$ /usr/lib/sendmail -v -d0.1 < /dev/nullVersion 8.13.8+SunCompiled with: DNSMAP LDAPMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8MIME8TO7 NAMED_BIND NDBM NETINET NETINET6 NETUNIX NEWDB NISNISPLUS PIPELINING SCANF STARTTLS TCPWRAPPERS USERDBUSE_LDAP_INIT XDEBUG============ SYSTEM IDENTITY (after readcf) ============(short domain name) $w = pluto(canonical domain name) $j = pluto.mydomain.com(subdomain name) $m = pluto.mydomain.com(node name) $k = pluto========================================================Recipient names must be specified$
# ps -ef |grep sendmailroot 516 1 0 Mar 19 ? 1:16 /usr/lib/sendmail -bd-q15msmmsp 515 1 0 Mar 19 ? 0:04 /usr/lib/sendmail -Ac -q15m
# /usr/ucb/ps -auxwww | grep sendmailroot 6043 0.1 0.1 1280 968 console S 18:18:03 0:00 grep sendmailroot 516 0.0 0.2 8240 2648 ? S Mar 19 1:16 sendmail:accepting connectionssmmsp 515 0.0 0.1 8240 2216 ? S Mar 19 0:03 sendmail:Queue runner@00:15:00 for /var/spool/clientmqueue
# ps -ef | grep sendroot 271 1 0 Mar 10 ? 0:01 /usr/lib/sendmail -bd -q15m# /usr/ucb/ps -auxwww | grep sendmailroot 271 0.0 0.3 4288 1512 ? S Mar 10 0:00 sendmail:accepting connections
#/etc/rc2.d/S88sendmail startor#/usr/lib/sendmail -bd -q15m
#/etc/rc2.d/S88sendmail startor#/usr/lib/sendmail -bd -q15m#/usr/lib/sendmail -Ac -q15m
#svcadm enable svc:/network/smtp:sendmail
#svcadm enable svc:/network/smtp:sendmailps -ef|grep “sendmail -bd”root 516 1 0 Mar 19 ? 1:16 /usr/lib/sendmail -bd#svcadm enable svc:/network/sendmail-clientps -ef |grep “sendmail -Ac”smmsp 515 1 0 Mar 19 ? 0:04 /usr/lib/sendmail -Ac -q15m
[/tab]
[tab title=”Sendmail Config“]
The Generic Procedure to Configure Sendmail for Receiving and Sending mails
Note: Btw, this is just for guidelines and might vary depending on your environment
Step 1 – verify that the /etc/mail directory, sendmail.cf and submit.cf all exist.
# ls -ail /etc/mailtotal 9241445 drwxr-xr-x 3 root mail 1024 Mar 13 13:48 .1403 drwxr-xr-x 76 root sys 4608 Mar 27 11:59 ..19564 -rw-r–r– 1 root bin 163 Oct 29 12:40 Mail.rc3964 -rw-r–r– 1 root bin 1423 Oct 29 12:24 aliases2405 -rw-r—– 1 root smmsp 40960 Nov 6 14:45 aliases.db22855 drwxr-xr-x 9 root mail 512 Nov 6 14:35 cf21951 -rw-r–r– 1 root bin 5449 Dec 22 2006 helpfile4055 -rw-r–r– 1 root bin 9 Nov 30 10:43 local-host-names2977 -r–r–r– 1 root bin 39953 Dec 22 2006 local.cf1865 -rw-r–r– 1 root bin 1839 Oct 29 12:16 mailx.rc4048 lrwxrwxrwx 1 root root 11 Oct 29 12:24 main.cf -> sendmail.cf42821 -rw-r–r– 1 root root 50 Nov 30 11:09 relay-domains42667 -r–r–r– 1 root root 40551 Mar 14 14:58 sendmail.cf41752 -r–r–r– 1 root other 39900 Nov 6 14:35 sendmail.cf.old4331 -rw-r–r– 1 root root 40032 Nov 29 11:35 sendmail.cf_cust21801 -r–r–r– 1 root root 39875 Mar 13 13:48 sendmail.cf_orig4054 -r–r–r– 1 root bin 39895 Nov 28 10:39 sendmail.cf_save4049 lrwxrwxrwx 1 root root 8 Oct 29 12:24 sendmail.hf -> helpfile21832 -rw-r–r– 1 root bin 41448 Mar 14 15:01 submit.cf41761 -r–r–r– 1 root other 40241 Nov 6 14:35 submit.cf.old21818 -rw-r–r– 1 root root 40216 Mar 13 13:48 submit.cf_orig4056 -r–r–r– 1 root bin 40220 Nov 9 12:26 submit.cf_save4050 lrwxrwxrwx 1 root root 11 Oct 29 12:24 subsidiary.cf -> sendmail.cf42853 -rw-r–r– 1 root root 5 Nov 30 11:10 trusted-users4058 -rw-r–r– 1 root bin 0 Nov 30 10:47 trusted-users_save
Step 2 – Verify the sendmail.cf has the correct mailhost (this may differs from unique site, see summary) setup.
In Solaris 9 and above :
# grep DS sendmail.cfDS# grep Fallback sendmail.cfO FallbackSmartHost=mailhost$?m.$m$.
define(`confFALLBACK_SMARTHOST’, `mailhost$?m.$m$.’)
In Solaris 8 and below :
# grep DS sendmail.cfDSmailhost$?m.$m$
m4 macros:define(`SMART_HOST’, `mailhost$?m.$m$.’)Step 3 – Verify the submit.cfThis is to route the local messages to the localhost port 25.# grep MTAHost submit.cfD{MTAHost}[127.0.0.1]# grep DS submit.cfDS
Step 4 – Verify that the port 25 is configured
In Solaris 10 with patch 142436-03 or higher:
svc:/network/smtp:sendmail/config/local_only = true
# svccfg -s svc:/network/smtp:sendmail setprop config/local_only = false# svcadm refresh svc:/network/smtp:sendmail# svcadm restart svc:/network/smtp:sendmail
In Solaris 9 and above :
# grep Port sendmail.cfO DaemonPortOptions=Name=MTA-v4, Family=inetO DaemonPortOptions=Name=MTA-v6, Family=inet6O DaemonPortOptions=Port=587, Name=MSA, M=E
In Solaris 8 and below :
# grep Port sendmail.cfO DaemonPortOptions=Name=MTA-IPv4, Family=inetO DaemonPortOptions=Name=MTA-IPv6, Family=inet6O DaemonPortOptions=Port=587, Name=MSA, M=Em4 macros : DAEMON_OPTIONS(`NAME=MSA, Port=27, Addr=127.0.0.1, M=E’)
# more local-host-namesv4u-x1c
[/tab]
[tab title=”Syslog checks“]
Steps to verify Logs for both inbound and outbound mail.
Step 1 – Verify where syslogd(1M) will log sendmail syslog records to.
…*.err;kern.debug;daemon.notice;mail.crit /var/adm/messages…mail.debug ifdef(`LOGHOST’, /var/log/syslog, @loghost)…
- syslog will log critical sendmail messages to /var/adm/messages
- if loghost can be resolved, syslogd will log sendmail syslog record to the /var/log/syslog file of that host.
Resolve the ‘loghost’ hostname:
$ getent hosts loghost172.16.1.1 e450 loghost$
Which syslog to check?
- If loghost points to the same system where the sendmail service your want to troubleshoot is running on, you will find the sendmail syslog records in /var/log/syslog.
- If loghost points to a different system, login into this system and verify the contents of /var/log/syslog.
- If neither is the case, verify the contents of syslod.conf and verify to which host and/or file mail.debug records points to.
Step 2 – Verify the contents of /var/adm/messages.
…May 20 04:01:12 db7 sendmail[1872]: [ID 801593 mail.crit] NOQUEUE:SYSERR(oracle): can not write to queue directory /var/spool/clientmqueue/(RunAsGid=0, required=1): Permission deniedMay 20 05:00:01 db7 sendmail[1961]: [ID 801593 mail.crit] NOQUEUE:SYSERR(sys): can not write to queue directory /var/spool/clientmqueue/(RunAsGid=0, required=1): Permission denied…
Step 3 – Verify the contents of the /var/log/syslog file or equivalent file.
…Apr 16 10:58:56 mymailhost sendmail[24234]: [ID 801593 mail.info] m3G8wu8g024234: to=<joe.foe@extdomain.com>, ctladdr=<john@mymailhost.mydomain.com> (22960/117), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30920, relay=mailhost.extdomain.com. [172.17.1.4], dsn=2.0.0, stat=Sent (m3G8wug1009950 Message accepted for delivery)…
- The date is the month, day, and time that the line of information was logged.
- The host is the name of the host that produced this information.
- This can be different from the name of the host on which the logfiles are kept (see above).
- The pid (process id) of the sendmail processes that produced the output.
- The qid (queue identifier) that uniquely identifies each message on a given host.
- The remainder is a list of fields which define values of who the sender or the recipient is and whether delivery succeeded, failed, or was deferred.
- to= The final recipient
- from= The envelope sender
- ctladdr= The controlling user
- delay= Total time to deliver
- xdelay= Transaction delay for this address only
- mailer= The delivery agent used
- pri= The initial priority
- relay= The host that sent or accepted the message
- dsn= The DSN status code
- stat= The status of delivery
- size= The size of the message
- ntries= The number of delivery attempts
Step 4 – Verify the stat= field of this record.
Step 5 – Verify the dsn= field of this record (when available).
…Apr 11 10:25:29 e450 sendmail[16860]: [ID 801593 mail.info] m3B8PSVM016855: to=<user1@wrongdomain.org>, ctladdr=<user2@mydomain.org> (2031/2001), delay=00:00:01, xdelay=00:00:00, mailer=esmtp, pri=150549, relay=wrongdomain.org.be, dsn=5.1.2, stat=Host unknown (Name server: wrongdomain.org: host not found)…
5.X.X Permanent Failure : A permanent failure is one which is not likely to be resolved by resending the message in the current form. Some change to the message or the destination must be made for successful delivery.X.1.2 Bad destination system address : The destination system specified in the address does not exist or is incapable of accepting mail. For Internet mail names, this means the address portion to the right of the “@” is invalid for mail. This codes is only useful for permanent failures.
Step 6 – Verify the reject= field of this record (when available).
…Apr 16 15:38:34 e450 sendmail[17707]: [ID 801593 mail.notice] m3GDcYW8017707: ru leset=check_mail, arg1=<nekkipfa1981@54sales.com>, relay=to1-84-91-48-146.netvis ao.pt [84.91.48.146], reject=553 5.1.8 <nekkipfa1981@54sales.com>… Domain of sender address nekkipfa1981@54sales.com does not exist…and…Apr 16 16:50:54 e450 sendmail[18581]: [ID 801593 mail.notice] m3GEorFQ018581: ru leset=check_rcpt, arg1=<a286e4184@yahoo.com.tw>, relay=203-73-236-153.adsl.dynam ic.seed.net.tw [203.73.236.153], reject=550 5.7.1 <a286e4184@yahoo.com.tw>…
[/tab]
[tab title=”Queue Permissions“]
Steps to check the permissions for Mail Queues
Step 1 – Verify the /var/spool/mqueue exist, also has the following permissions and ownerships
# ls -ail /var/spool/mqueuedrwxr-x— 2 root bin /var/spool/mqueue#/usr/bin/chmod 750 /var/spool/mqueue#/usr/bin/chown root:bin /var/spool/mqueue
# ls -ail /var/spool/mqueuedrwxr-x— 2 root bin /var/spool/mqueue#/usr/bin/chmod 750 /var/spool/mqueue#/usr/bin/chown root:bin /var/spool/mqueue
Step 2 – For S9 and above, verify the /var/spool/clientmqueue exist, also has the following permission and ownership
# ls -ail /var/spool/clientmqueuedrwxrwx— 2 smmsp smmsp /var/spool/clientmqueue#/usr/bin/chmod 770 /var/spool/clientmqueue#/usr/bin/chown smmsp:smmsp /var/spool/client/mqueue
# /usr/lib/sendmail -v -d44.5 someone@somewhere.com < /etc/hosts
[tab title=”DNS Checks“]
Steps to Validate DNS client configuration (and to verify Mail exchanger lookups are successful (if using DNS for mail exchanger lookups).
Is system configured as a DNS client:
# nslookup (type this command and return)Default Server: nameserver.somedomain.COMAddress: 129.168.1.2> set type=MX (type this command and return)> yahoo.com (type in the domain in question, results follow)Server: nameserver.somedomain.COMAddress: 129.168.1.2Non-authoritative answer: yahoo.com preference = 5, mail exchanger = mx1.yahoo.comyahoo.com preference = 5, mail exchanger = mx2.yahoo.comyahoo.com preference = 5, mail exchanger = mx3.yahoo.comyahoo.com preference = 5, mail exchanger = mx4.yahoo.comAuthoritative answers can be found from:yahoo.com nameserver = ns1.yh.netyahoo.com nameserver = ns2.yh.netyahoo.com nameserver = ns3.yh.netyahoo.com nameserver = ns4.yh.netyahoo.com nameserver = ns5.yh.netmx1.yahoo.com internet address = 65.54.244.8mx1.yahoo.com internet address = 65.54.245.8mx1.yahoo.com internet address = 65.54.244.136mx2.yahoo.com internet address = 65.54.244.168mx2.yahoo.com internet address = 65.54.244.40mx2.yahoo.com internet address = 65.54.245.40mx3.yahoo.com internet address = 65.54.244.200mx3.yahoo.com internet address = 65.54.244.72mx3.yahoo.com internet address = 65.54.245.72mx4.yahoo.com internet address = 65.54.245.104mx4.yahoo.com internet address = 65.54.244.104mx4.yahoo.com internet address = 65.54.244.232ns1.yh.net internet address = 207.68.160.190ns2.yh.net internet address = 65.54.240.126ns3.yh.net internet address = 213.199.161.77ns4.yh.net internet address = 207.46.66.126ns5.yh.net internet address = 65.55.238.126
# dig -t mx yahoo.com; <<>> DiG 8.3 <<>> -t yahoo.com;; res options: init recurs defnam dnsrch;; got answer:;; ->>HEADER<;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 5, ADDITIONAL: 17;; QUERY SECTION:;; yahoo.com, type = MX, class = IN;; ANSWER SECTION:yahoo.com. 47m34s IN MX 5 mx2.yahoo.com.yahoo.com. 47m34s IN MX 5 mx3.yahoo.com.yahoo.com. 47m34s IN MX 5 mx4.yahoo.com.yahoo.com. 47m34s IN MX 5 mx1.yahoo.com.;; AUTHORITY SECTION:yahoo.com. 6h4m35s IN NS ns1.yh.net.yahoo.com. 6h4m35s IN NS ns2.yh.net.yahoo.com. 6h4m35s IN NS ns3.yh.net.yahoo.com. 6h4m35s IN NS ns4.yh.net.yahoo.com. 6h4m35s IN NS ns5.yh.net.;; ADDITIONAL SECTION:mx2.yahoo.com. 47m34s IN A 65.54.244.168mx2.yahoo.com. 47m34s IN A 65.54.244.40mx2.yahoo.com. 47m34s IN A 65.54.245.40mx3.yahoo.com. 47m34s IN A 65.54.244.200mx3.yahoo.com. 47m34s IN A 65.54.244.72mx3.yahoo.com. 47m34s IN A 65.54.245.72mx4.yahoo.com. 47m34s IN A 65.54.245.104mx4.yahoo.com. 47m34s IN A 65.54.244.104mx4.yahoo.com. 47m34s IN A 65.54.244.232mx1.yahoo.com. 47m34s IN A 65.54.244.8mx1.yahoo.com. 47m34s IN A 65.54.245.8mx1.yahoo.com. 47m34s IN A 65.54.244.136ns1.yh.net. 1d1h41m34s IN A 207.68.160.190ns2.yh.net. 7m13s IN A 65.54.240.126ns3.yh.net. 7m13s IN A 213.199.161.77ns4.yh.net. 7m13s IN A 207.46.66.126ns5.yh.net. 7m13s IN A 65.55.238.126;; Total query time: 62 msec;; FROM: solarishost to SERVER: default — 129.168.1.2;; WHEN: Thu Apr 3 15:34:41 2008;; MSG SIZE sent: 29 rcvd: 479<
- nslookup <hostname or IP address>
- dig <hostname or IP address>
- getent hosts <hostname or IP address>
Using getent
root# getent hosts mailhost129.148.9.192 mailhost.foo.com129.148.13.5 mailhost.foo.com
root# getent hosts mailhostroot#
root# /usr/lib/sendmail -d0.11 -bpVersion 8.13.8+SunCompiled with: DNSMAP LDAPMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NDBM NETINET NETINET6 NETUNIX NEWDB NIS NISPLUS PIPELINING SCANF STARTTLS TCPWRAPPERS USERDB USE_LDAP_INIT XDEBUGOS Defines: HASCLOSEFROM HASFCHOWN HASFCHMOD HASFDWALK HASGETUSERSHELL HASINITGROUPS HASLDAPGETALIASBYNAME HASLSTAT HASNICE HASRANDOM HASRRESVPORT HASSETREGID HASSETREUID HASSETRLIMIT HASSETSID HASSETVBUF HASURANDOMDEV HASSTRERROR HASULIMIT HASUNAME HASUNSETENV HASWAITPID IDENTPROTO IP_SRCROUTE SAFENFSPATHCONF SYS5SETPGRP SYSTEM5 USE_DOUBLE_FORK USE_SA_SIGACTION USE_SIGLONGJMP USESETEUIDKernel symbols: /dev/ksymsConf file: /etc/mail/submit.cf (default for MSP)Conf file: /etc/mail/sendmail.cf (default for MTA)Pid file: /var/run/sendmail.pid (default)Canonical name: solarishost.nisplus.comUUCP nodename: solarishosta.k.a.: solarishost.nisplus.coma.k.a.: [10.10.11.88]a.k.a.: [127.0.0.1]a.k.a.: loghostConf file: /etc/mail/sendmail.cf (selected)Pid file: /var/run/sendmail.pid (selected)============ SYSTEM IDENTITY (after readcf) ============(short domain name) $w = solarishost(canonical domain name) $j = solarishost.nisplus.com(subdomain name) $m = nisplus.com(node name) $k = solarishost========================================================/var/spool/mqueue is emptyTotal requests: 0
root# /usr/lib/sendmail -btADDRESS TEST MODE (ruleset 3 NOT automatically invoked)Enter <ruleset> <address>> /mx yahoo.com [type in /mx domain2query.com and return]getmxrr(yahoo.com) returns 7 value(s):c.mx.mail.yahoo.com.f.mx.mail.yahoo.com.b.mx.mail.yahoo.com.a.mx.mail.yahoo.com.e.mx.mail.yahoo.com.d.mx.mail.yahoo.com.g.mx.mail.yahoo.com.(control-D to exit)
[/tab]
[/tabs]
Sendmail Troubleshooting for Mail Receive Issues
[tabs]
[tab title=”Sendmail Services“]
First refer the Section “Sendmail Services” from Mail Sending Troubleshooting above.
In addition to the above checks, check sendmail “secure by default” status
Below procedure helps you to determine if your sendmail configuration is using the “Secure by Default” profile. This might be a possible cause for the symptom “can’t receive mail”. The “Secure by Default Network Profile” is an installation enhancement that arrived with Solaris 10U3
To determine if the system is configured for Secure by Default:
# cd /var/svc/profile
ls -l gen* lrwxrwxrwx 1
root root 25 Mar 26 06:13 generic.xml -> ./generic_limited_net.xml
-r–r–r– 1 root sys 11300 Dec 21 2006 generic_limited_net.xml
-r–r–r– 1 root sys 5592 Dec 21 2006 generic_open.xml# ps -ef | grep sendmail
smmsp 10561 10559 0 11:57:52 ? 0:00 /usr/lib/sendmail -Ac -q15m
smmsp 10559 1 0 11:57:52 ? 0:00 /usr/lib/sendmail -Ac -q15m root
10560 1 0 11:57:52 ? 0:00 /usr/lib/sendmail -bd -q15m – C /etc/mail/local.cf.. Last line points to “local.cf”
To determine if this property is set for sendmail:
# svccfg -s sendmail listprop | grep local_only
config/local_only boolean true
… But default this setting is false
To re-enable all network services including sendmail:
# netservices open
To re-enable the sendmail network service only:
Determine if this property is set for sendmail:
# svccfg -s sendmail listprop | grep local_only config/local_only boolean true <— The default is false
Disable sendmail:
# svcadm -v disable sendmail
Turn local_only mode back to false:
# svccfg -s sendmail setprop config/local_only=false
Verify the change:
# svccfg -s sendmail listprop | grep local_only
config/local_only boolean falseRefresh the sendmail service so that the change takes effect:
# svcadm -v refresh sendmail
… About command will refresh svc:/network/smtp:sendmail.
Enable sendmail again:
# svcadm -v enable sendmail svc:/network/smtp:sendmail enabled.
Verify the change was made to sendmail only:
# pwd
/var/svc/profile# ls -l gen* lrwxrwxrwx 1 root root 25 Mar 26 06:36 generic.xml -> ./generic_limited_net.xml
-r–r–r– 1 root sys 11300 Dec 21 2006 generic_limited_net.xml
-r–r–r– 1 root sys 5592 Dec 21 2006 generic_open.xml… sendmail now running in a default state again which will look at the sendmail.cf and not the local.cf
# ps -ef | grep sendmail
smmsp 2411 1 0 06:50:51 ? 0:00 /usr/lib/sendmail -Ac -q15m
root 2412 1 0 06:50:51 ? 0:00 /usr/lib/sendmail -bd -q15m
[tab title=”Network Checks“]
Refer the “Network Connectivity” Section from the “Troubleshooting Mail Sending issues” mentioned above
[/tab]
[tab title=”DNS Checks“]
Refer the “DNS Checks” Section from the “Troubleshooting Mail Sending issues” mentioned above
[/tab]
[tab title=”Validate User“]
$ id postgresuid=90(postgres) gid=90(postgres)
$ id mysqlid: invalid user name: “mysql”
$ getent passwd postgrespostgres:x:90:90:PostgreSQL Reserved UID:/:/usr/bin/pfksh
$ getent passwd mysql$
[/tab]
[tab title=”Verify mail.local binary“]
The sendmail daemon (/usr/lib/sendmail -bd -q15m) listens on port 25 and when a message is received, it is determined to be destined for the local mail box or externally after rules rewrite. For local mail box delivery, the message is routed to the mailer local (Mlocal) in the sendmail.cf which is termed the mail.local binary.
Step 1. Ensure the mail.local binary exists:
# ls -ail /usr/lib/mail.local
3193 -r-xr-xr-x 1 root bin 63104 Apr 5 2007 /usr/lib/mail.local
Step 2. Set ownership and mode on the mail.local binary
#chown root:bin /usr/lib/mail.local
#chmod 555 /usr/lib/mail.local
Step 3. Ensure the sendmail.cf has the defaullt entry for the mailer “local” :
Mlocal, P=/usr/lib/mail.local, F=lsDFMAw5:/|@qPSXmnz9, S=EnvFromSMTP/HdrFromL, R=EnvToL/HdrToL,
T=DNS/RFC822/SMTP,
A=mail.local -l
[/tab]
[tab title=”NFS permissions for /var/mail“]
The Mail should always be delivered to a local file system so that the user agent can pull mail from the mail spool and store it readily in the local mailbox. Do not use
Note : NFS-mounted file systems as the destination for a user’s mailbox. Specifically, do not direct mail to a mail client that is mounting the /var/mail file system from a remote server. Mail for the user, in this instance, should be addressed to the mail server and not to the client host name. NFS-mounted file systems can cause problems with mail delivery and handling.
The /etc/mail/aliases file and name services such as NIS, NIS+ and LDAP provide mechanisms for creating aliases for electronic mail addresses. So, users do not need to know the precise local name of a user’s mailbox.
Below procedure helps you to verify the permissions of /var/mail and its NFS mount state when using remote access.
# ls -ld /var/mail
drwxrwxrwt 3 root mail 25088 May 15 2007 /var/mail
#…..By Default Sticky Bit should set for this directory
[/tab]
[tab title=”QueueLA and RefuseLA settings“]
By default, sendmail (All versions) will refuse mail connections when load average rises above 12. Load average can be seen with the unix command “/usr/bin/uptime”.
# uptime
11:32am up 1 day(s), 23:13, 1 user, load average: 0.07, 0.08, 0.09
Where:
0.07 = 1 minute
0.08 = 5 minutes
0.09 = 15 minutes
This can be a problem with multiprocessor machines where load averages.High Load average ceases sendmail to stop forking processes.
Below Procedure Helps to set the load average to higher limit(RefuseLA):
In sendmail 8.8.8(or later) in sendmail.cf
#cd /usr/lib/mail/cf
#vi sendmail.mc
divert(-1)
divert(0)dnl
VERSIONID(`@(#)main-v7sun.mc 1.5 (Sun) 09/12/01′)
OSTYPE(`solaris8′)dnl
DOMAIN(`solaris-generic’)dnl
MAILER(`local’)dnl
MAILER(`smtp’)dnl
define(`SMART_HOST’, `mailhost$?m.$m$.’)dnl
define(`confREFUSE_LA’,21)dnl$
/usr/ccs/bin/m4 ../m4/cf.m4 sendmail.mc > sendmail.cf
One can use the -d3.30 to see if the load is really that high:
# /usr/lib/sendmail -d3.30 some.body@unixadminschool.com < /etc/passwd
getla: 4
getla: 4
getla: 4
shouldqueue: CurrentLA=4, pri=30638: false (CurrentLA < QueueLA)
Note
- In Solaris 8, this issue only affect inbound connection, however in Solaris 9 this affects also the outbound messages that is send locally.
- This is due to the fact that in Solaris 9/10 there are two queues in sendmail. The local message has to connect back to the 127.0.0.1:25 which is then serviced by the main sendmail daemon which in turn send this out.
[/tab]
[tab title=”Alias Checks “]
Aliasing is the process of converting one recipient name into another. It is essential for sendmail to be able to expand the mail address in the aliases db correctly before the mailer mail.local is called. Otherwise, messages will not be delivered successfully to the local mail box.
Step 1. Ensure the default /etc/mail/aliases file exists and set it’s permisions :
# ls -ail /etc/mail/aliases
3162 -rw-r–r– 1 root bin 1423 Jul 14 2007 /etc/mail/aliases
#chmod 644 /etc/mail/aliases
#chown root:bin /etc/mail/aliases
Step 2. Ensure the AliasFile option is set to the correct aliases file :
/etc/mail/sendmail.cf :
O AliasFile=/etc/mail/aliases
Or m4 macros to use :
define(`ALIAS_FILE’, `/etc/mail/aliases’)
Step 3. When adding a new entry in the aliases file, ensure this is updated into the aliases.db file :
#vi /etc/mail/aliases :
me: stiffer, marie@[129.123.456.78]#/usr/sbin/newaliases
/etc/mail/aliases: 13 aliases, longest 31 bytes, 171 bytes total
Step 4. Check The name service switch
The Names Service Switch Configuration file , i.e nsswitch.conf , has a database for aliases , so ensure the /etc/nsswitch.conf has the correct setting for the aliases database that you are using or updated
Sample entry in “/etc/nsswitch.conf “:
aliases: files nisplus ldap
Step 5. Ensure the user address is seen or expandable by sendmail :
#/usr/lib/sendmail -bt
> /map aliases toor
map_lookup: aliases (toor) returns root (0)
> /map aliases me
map_lookup: aliases (me) returns stiffer, marie@[129.123.456.78] (0)Or use debug switch 37.88-91 :
#/usr/lib/sendmail -v -d37.88-91 me < /etc/hosts
.
.
Look for the below :>>> MAIL From:<somebody@aserver.unixadminschool.com> SIZE=676
250 2.1.0 <somebody@aserver.unixadminschool.com>… Sender ok
>>> RCPT To:<me@aserver.unixadminschool.com>
>>> DATA
050 <me@aserver.unixadminschool.com>… aliased to stiffer, marie@[129.123.456.78]
[/tab]
[tab title=”Check /etc/mail/local-host-names “]
Ensure the /etc/mail/local-host-names has the local hostname of the machine receiving the message.
# cat /etc/mail/local-host-names | grep rcvhost
rcvhost
where rcvhost is the machine name.
[/tab]
[tab title=” Syslog Checks “]
Refer the “SysLog Checks” Section from the “Troubleshooting Mail Sending issues” mentioned above
[/tab]
[/tabs]
1 Response
[…] Read – Troubleshooting Reference […]