Linux on the sendmail often due to some configuration problems, resulting in a failure to send mail, the following collation, collected some of the mail sent failed, abnormal cases.
Case 1: when testing sendmail on a new server to send a message, found that the message sent is not successful, check the/var/log/maillog log file found the following error (Notice:hostname, e-mail address and other information using XXX instead)
Tail/var/log/maillog
May 09:43:38 xxxxx sendmail[9182]: S4f1hcqe009182:from=root, size=58269, Class=0, Nrcpts=1, Msgid=<[email protecte D]>, [email protected]
May 09:43:38 xxxxx sendmail[9182]: s4f1hcqe009182: [email protected], delay=00:00:00, MAILER=ESMTP, pri=88269, dsn=4.4 .3, stat=queued
May 09:43:58 xxxxx sendmail[9186]: Noqueue:syserr (Oracle): Can not ChDir (/var/spool/mqueue/): Permission denied
This problem occurs because the Oracle account does not have access to the/var/spool/mqueue and needs to be granted the appropriate permissions, as follows:
chmod 755/var/spool/mqueue
Case 2: viewing the Var/log/maillog log file finds the following error
May 10:21:41 xxxxx sendmail[9850]: S4f2lfrt009850:to=<[email protected]>, delay=00:00:00, MAILER=ESMTP, pri= 37549, dsn=4.4.3, stat=queued
This problem occurs because the DNS server is incorrectly set up, and you need to modify the nameserver value under/etc/resolv.conf.
Case 3: check/var/log/maillog found the following information, the message status is Sent (Stat=sent), but still did not receive the message.
[Email protected] mail]# Tail/var/log/maillog
Dec 11:15:01 nbolnx01 sendmail[25312]: sbi3f18j025312:from=<[email protected]>, size=607, Class=0, Nrcpts=1, Msgid=<[email protected]>, Proto=esmtp, Daemon=mta, Relay=localhost.localdomain [127.0.0.1]
Dec 11:15:01 nbolnx01 sendmail[25302]: sbi3f12b025302:to=oracle, Ctladdr=oracle (502/502), delay=00:00:00, xdelay=00:00:00, Mailer=relay, pri=30290, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=sent (sbi3f18j025312 Message Accepted for delivery)
Dec 11:15:01 nbolnx01 sendmail[25327]: sbi3f1mw025327:from=<[email protected] size=599, Class=0, Nrcpts=1, Msgid=<[email protected]>, Proto=esmtp, Daemon=mta, relay= Localhost.localdomain [127.0.0.1]
Dec 11:15:01 nbolnx01 sendmail[25321]: sbi3f1ba025321:to=oracle, ctladdr= Oracle (502/502), delay=00:00:00, xdelay=00:00:00, Mailer=relay, pri=30282, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, Stat=sent (sbi3f1mw025327 Message accepted for delivery)
Check MAILQ, as shown below, to discover that a large number of messages are queued for delivery
[Email protected] mail]# MAILQ
.................................................................
.................................................................
.................................................................
sbd2j1tq000440 214 Sat Dec 10:45 <[email protected]>
(Host Map:lookup (xxxx.com): deferred)
[Email protected]
sbd301x9000637 214 Sat Dec <[email protected]>
(Host Map:lookup (xxxx.com): deferred)
[Email protected]
Total requests:120
[Email protected] mail]#
The "host Map:lookup: Deferred" error means that the delivery of the message is delayed. You need to modify the configuration file by/ETC/MAIL/SENDMAIL.CF. After you find #O resolveroptions=+aaonly This line of information, cancel the comment, and then restart the SendMail service to resolve the issue.
[[Email protected] ~]# service SendMail stop
Shutting down sm-client: [OK]
Shutting down SendMail: [OK]
[[Email protected] ~]# service SendMail start
Starting sendmail: [OK]
Starting sm-client: [OK]
References:
http://www.51osos.com/a/Linux_CentOS_RedHat/Linuxjichu/2010/1001/107.html
http://www.cnblogs.com/AloneSword/archive/2013/07/20/3203050.html
http://blog.chinaunix.net/uid-11888131-id-2804023.html
http://fanli7.net/a/caozuoxitong/OS/20120703/180401.html
http://blog.csdn.net/kindy1022/article/details/7639096
Linux sendmail sending mail failure diagnostic case