Linux用sendmail发信失败,提示Connection refused by [127.0.0.1]

时间:2021-02-12 16:30:35

现象:

Linux用sendmail发信失败,提示Connection refused by [127.0.0.1]

29 14:10:44 iZ257p7xxilZ sendmail[3395]: u6T6Aiai003395: to=xx@163.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30226, relay=[127.0.0.1] [127.0.0.1], dsn=4.0
.0, stat=Deferred: Connection refused by [127.0.0.1]
Jul 29 14:13:48 iZ257p7xxilZ sendmail[3596]: u6T6DmTF003596: from=root, size=225, class="0", nrcpts=1, msgid=<201607290613.u6T6DmTF003596@git.xx.com>, relay=root@localhost
Jul 29 14:13:48 iZ257p7xxilZ sendmail[3596]: u6T6DmTF003596: to=xx@163.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30225, relay=[127.0.0.1] [127.0.0.1], dsn=4.0
.0, stat=Deferred: Connection refused by [127.0.0.1]

问题原因:

有可能是sendmail没启动

解决办法:

sudo chkconfig --levels 235 sendmail on
sudo service sendmail restart