Linux sendmail发送邮件失败诊断案例


在新服务器上测试sendmail发送邮件时,发现邮件发送不成功,检查日志文件发现如下错误(Notice:由于涉及公司服务器,邮箱等,故下面hostname、邮箱地址等信息使用xxx代替)

tail -40  /var/log/maillog

May 15 09:43:38 xxxxx sendmail[9182]: s4F1hcQe009182: from=root, size=58269, class=0, nrcpts=1, msgid=<201405150143.s4F1hcQe009182@xxxx>, relay=root@localhost

May 15 09:43:38 xxxxx sendmail[9182]: s4F1hcQe009182: to=konglb@xxxx, delay=00:00:00, mailer=esmtp, pri=88269, dsn=4.4.3, stat=queued

May 15 09:43:58 xxxxx sendmail[9186]: NOQUEUE: SYSERR(oracle): can not chdir(/var/spool/mqueue/): Permission denied

出现这个问题,是因为原来是(/var/spool/mqueue/)的权限配置不正确,sendmail没有权限访问这个目录,执行下面命令即可解决。

chmod 755 /var/spool/mqueue

image

此时再去测试时,发现如下错误,邮件状态一直为queued ,错误信息如下所示:


May 15 10:21:41 xxxxx sendmail[9850]: s4F2LfrT009850: to=<konglb@xxxx>, delay=00:00:00, mailer=esmtp, pri=37549, dsn=4.4.3, stat=queued

出现这个问题是因为dns server不正确设置导致,需要修改配置文件/etc/resolv.conf 下的nameserver值。

相关内容