sendmail连接被127.0.0.1拒绝

时间:2014-11-26 23:11:29

标签: email localhost sendmail freebsd

我所使用的服务器是FreeBSD,最近sendmail停止发送电子邮件。我一直在google做很多研究,我从很多不同的网站上尝试了很多东西,但到目前为止还没有任何效果。

这是sendmail命令的输出:

# echo "test" | mail -v -s test test@test.com
test@test.com... Connecting to [127.0.0.1] via relay...
test@test.com... Deferred: Connection refused by [127.0.0.1]

这是端口25上的telnet:

# telnet localhost 25
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
Trying ::1...
telnet: connect to address ::1: Connection refused
telnet: Unable to connect to remote host

这是netstat输出的一部分:

tcp4       0      0 the.first.ip.address.25             *.*                    LISTEN
tcp4       0      0 the.second.ip.address.26            *.*                    LISTEN
tcp4       0      0 the.third.ip.address.25             *.*                    LISTEN
tcp4       0      0 the.fourth.ip.address.25            *.*                    LISTEN
tcp4       0      0 the.main.server.ip.address.25       *.*                    LISTEN

到目前为止我尝试过的一些事情:

1) changed settings /etc/hosts file
2) changed settings in the .mc file, then make, make install, service sendmail restart
3) directly changed the .cf file since changing .mc file didn't fix the problem, then "service sendmail restart"

如果有人之前遇到过这个问题,或者我知道如何解决这个问题,我会很开心。

谢谢!

2 个答案:

答案 0 :(得分:2)

要检查端口25是否已打开,请尝试使用类似root的sockstat,例如:

sockstat -4l

使用sysrc确保在启动时启用/启动sendmail:

sysrc sendmail_enable="YES"

通过执行以下操作启动/重启:

/etc/rc.d/sendmail restart

作为替代方案,您可能希望将ssmpt配置为sendmail的替代品,以便您可以使用自己的提供商发送电子邮件。

答案 1 :(得分:0)

确保/etc/rc.conf中启用了sendmail:

sendmail_enable="YES"

检查日志文件/var/log/messages/var/log/maillog

如果这不能提供足够的信息,请确保将sendmail设置为接受来自localhost的邮件,并确保您的防火墙不会阻止访问。

相关问题