Linux sendmail 日志 DSN:Service unavailable

最近想利用Nmap定期扫描服务器端口,扫描结果自动发送邮件,发现无法正常发送邮件,查看/var/log/maillog日志,发现以下信息:

  1. Jun 26 07:24:23 MyVPS1976 sendmail[31760]: q5PNOMeP031760: from=<[email protected]>, size=1393, class=0, nrcpts=1, [email protected], proto=SMTP, daemon=MTA, relay=MyVPS [127.0.0.1]

  2. Jun 26 07:24:25 MyVPS1976 sendmail[31762]: q5PNOMeP031760: to=<[email protected]>, [email protected] (501/501), delay=00:00:02, xdelay=00:00:02, mailer=esmtp, pri=121393, relay=mxdomain.qq.com. [64.71.138.90], dsn=5.0.0,stat=Service unavailable

  3. Jun 26 07:24:25 MyVPS1976 sendmail[31762]: q5PNOMeP031760: q5PNOPeP031762: DSN: Service unavailable

  4. Jun 26 07:24:25 MyVPS1976 sendmail[31762]: q5PNOPeP031762: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32578, dsn=2.0.0, stat=Sent

根据relay=mxdomain.qq.com. [64.71.138.90], dsn=5.0.0,stat=Service unavailable这一段,我们知道邮件已经发送出去,但由于某种原因邮件被拒绝,于是更换hostname,重启sendmail,解决问题。
更换hostname方法:
1、编辑/etc/sysconfig/network,更换文件中的hostnmae。
2、把hostname写入/etc/hosts (注意格式)
3、执行hostname www.centos.com立即生效

 

你可能感兴趣的:(linux,日志,sendmail)