sendmail连接被127.0.0.1拒绝

hop*_*lcd 8 email freebsd sendmail localhost

我所使用的服务器是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]
Run Code Online (Sandbox Code Playgroud)

这是端口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
Run Code Online (Sandbox Code Playgroud)

这是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
Run Code Online (Sandbox Code Playgroud)

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

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"
Run Code Online (Sandbox Code Playgroud)

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

谢谢!