【问题标题】:sendmail connection refused by 127.0.0.1 [closed]sendmail 连接被 127.0.0.1 拒绝 [关闭]
【发布时间】:2014-11-26 23:11:28
【问题描述】:

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

这是 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"

如果有人以前遇到过这个问题或知道如何解决它,我愿意接受。

谢谢!

【问题讨论】:

    标签: email localhost sendmail freebsd


    【解决方案1】:

    要检查端口 25 是否打开,请尝试使用 sockstat(如 root),例如:

    sockstat -4l
    

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

    sysrc sendmail_enable="YES"
    

    通过以下方式启动/重启:

    /etc/rc.d/sendmail restart
    

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

    【讨论】:

      【解决方案2】:

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

      sendmail_enable="YES"
      

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

      如果这不能产生足够的信息,请确保您的 sendmail 设置为接受来自 localhost 的邮件,并且您的防火墙没有阻止访问。

      【讨论】:

        猜你喜欢
        • 2011-08-02
        • 2015-08-01
        • 2021-01-13
        • 2017-05-23
        • 1970-01-01
        • 2018-10-01
        • 2011-07-26
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多