热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

sendmail报错dsn:serviceunavailable的解决办法

118:41:44localhostsendmail[5283]:o71Afikr005283:toroot@localhost.localdomain,delay00:00:00,xdelay00:00:00,mailerlocal,pri31717,dsn2.0.0,statSent后来在google上找了很多,最
1 18:41:44 localhost sendmail[5283]: o71Afikr005283: to=, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31717, dsn=2.0.0, stat=Sent

后来在google上找了很多,最后终于找到原因了:
I fixed the problem by changing the hostname of my server. Apparently "localhost.localdomain" will get rejected automatically by a lot of mail servers. As soon as I changed my hostname to "extra.idahostatesman.com" (a domain that is hosted on the server), everything just worked and I had no more problems sending e-mail.

可以用hostanme 命令临时修改主机名,hostname aa.com; 还是失败了

Aug  1 19:11:33 localhost sendmail[5579]: o71BBVB9005579: from=root, size=221, class=0, nrcpts=1, msgid=<201008011111.o71BBVB9005579@aa.com>, relay=root@localhost
Aug  1 19:11:35 localhost sendmail[5580]: o71BBX3b005580: from=, size=436, class=0, nrcpts=1, msgid=<201008011111.o71BBVB9005579@aa.com>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Aug  1 19:11:35 localhost sendmail[5579]: o71BBVB9005579: to=favorite214@139.com, ctladdr=root (0/0), delay=00:00:04, xdelay=00:00:02, mailer=relay, pri=30221, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o71BBX3b005580 Message accepted for delivery)
Aug  1 19:11:39 localhost sendmail[5582]: o71BBX3b005580: to=, delay=00:00:04, xdelay=00:00:04, mailer=esmtp, pri=120436, relay=mx.139.com. [221.176.6.96], dsn=4.0.0, stat=Deferred: 450 Requested action not taken:cmmx01, AS0QrJA75wiRVlVMWIvlAA--.3152S2, dynamic, reputation, zen.spamhaus.org, please try again

切记:修改完hostname以后需要重启sendmail 服务,重启服务后,一切ok.


推荐阅读
author-avatar
苦咖啡青柠檬
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有