Fedora 上的 dovecot SquirrelMail 使用 sendmail 发送时连接被 [127.0.0.1] 拒绝

Fedora 上的 dovecot SquirrelMail 使用 sendmail 发送时连接被 [127.0.0.1] 拒绝

我们使用 Fedora 25 和 sendmail-8.15.2-8.fc25.x86_64,通过 SquirrelMail 发送消息需要很长时间。以下日志显示:

delay=00:00:15, xdelay=00:00:00, mailer=relay, pri=46987, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]

我试过这个建议

# SMTP daemon options
O DaemonPortOptions=Family=inet, Name=MTA-v4, Port=smtp, Addr=XX.XX.XX.XX
O DaemonPortOptions=Family=inet, Name=MTA-v4, Port=smtp, Addr=127.0.0.1
O DaemonPortOptions=Family=inet, Name=MSP-v4, Port=submission, M=Ea, Addr=127.0.0.1

和:

cat /etc/hosts.allow
ALL : 127.0.0.1

Firewalld 似乎也不错:

firewall-cmd --permanent --list-all
[...]
  services: samba imaps pop3s http ssh nfs samba-client smtp dhcpv6-client mysql cockpit https vnc-server postgresql ipp-client mdns ipp dns 

rich rules:
        rule family="ipv4" source address="218.65.30.108" reject
        rule family="ipv4" source address="72.9.101.182" reject

还有什么要检查的吗?邮件最终确实会发出。需要将近一分钟。

编辑:使用这里有建议,我至少能够发送邮件。现在看来 SpamAssassin 正在减慢速度,而 Pyzor 是罪魁祸首。

Jul 13 23:03:24 storm sendmail[14504]: v6E33EOQ014504: Authentication-Warning: our-domain: apache set sender to me@our-domain using -f
Jul 13 23:03:39 storm sendmail[14504]: v6E33EOQ014504: from=me@our-domain, size=535, class=0, nrcpts=1, msgid=<9ca00a710c6bfad3d60dd424cd79ac19.squirrel@our-domain>, relay=apache@localhost
Jul 13 23:04:05 storm sendmail[14629]: v6E33ddm014629: from=<me@our-domain>, size=779, class=0, nrcpts=1, msgid=<9ca00a710c6bfad3d60dd424cd79ac19.squirrel@our-domain>, proto=ESMTP, daemon=MTA-loopback, relay=localhost [127.0.0.1]
Jul 13 23:04:05 storm sendmail[14629]: v6E33ddm014629: Milter insert (1): header: X-Virus-Scanned: clamav-milter 0.99.2 at our-domain
Jul 13 23:04:05 storm sendmail[14629]: v6E33ddm014629: Milter insert (1): header: X-Virus-Status: Clean
Jul 13 23:04:05 storm spamd[13378]: spamd: connection from localhost [::1]:48316 to port 783, fd 5
Jul 13 23:04:05 storm spamd[13378]: spamd: using default config for root: /home/spamd/user_prefs
Jul 13 23:04:05 storm spamd[13378]: spamd: processing message <9ca00a710c6bfad3d60dd424cd79ac19.squirrel@our-domain> for root:1001
Jul 13 23:04:20 storm spamd[13378]: spamd: clean message (-101.5/5.0) for root:1001 in 15.0 seconds, 1193 bytes.
Jul 13 23:04:20 storm spamd[13378]: spamd: result: . -101 - ALL_TRUSTED,BAYES_00,PYZOR_CHECK,USER_IN_WHITELIST scantime=15.0,size=1193,user=root,uid=1001,required_score=5.0,rhost=localhost,raddr=::1,rport=48316,mid=<9ca00a710c6bfad3d60dd424cd79ac19.squirrel@our-domain>,bayes=0.000000,autolearn=no autolearn_force=no
Jul 13 23:04:20 storm sendmail[14629]: v6E33ddm014629: Milter add: header: X-Spam-Status: No, score=-101.5 required=5.0 tests=ALL_TRUSTED,BAYES_00,\n\tPYZOR_CHECK,USER_IN_WHITELIST autolearn=no autolearn_force=no version=3.4.1
Jul 13 23:04:20 storm sendmail[14629]: v6E33ddm014629: Milter add: header: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on\n\tour-domain
Jul 13 23:04:20 storm sendmail[14504]: v6E33EOQ014504: to=me@our-domain, ctladdr=me@our-domain (16836/16836), delay=00:01:06, xdelay=00:00:41, mailer=relay, pri=30535, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v6E33ddm014629 Message accepted for delivery)
Jul 13 23:04:20 storm spamd[13309]: prefork: child states: II
Jul 13 23:04:20 storm spamd[13378]: spamd: connection from localhost [::1]:48320 to port 783, fd 5
Jul 13 23:04:20 storm spamd[13378]: spamd: using default config for spamd: /home/spamd/user_prefs
Jul 13 23:04:20 storm spamd[13378]: spamd: processing message <9ca00a710c6bfad3d60dd424cd79ac19.squirrel@our-domain> for spamd:1001

答案1

可能的解释

  1. sendmail 守护程序未运行
    使用ps( ps auxw | grep sendmail),检查日志文件
  2. 由于系统负载过高,sendmail 守护进程拒绝新的 SMTP 连接
    uptime请检查日志文件
  3. sendmail 守护进程未在 127.0.0.1interface/all 接口上
    使用netstatnetstat -ant | grep :25在 Debian 上)

  4. 据我所知,传入连接被防火墙或 tcpwrappers 阻止最多目前 sendmail 安装未编译 tcpwrappers 支持

答案2

这里有两个问题。不知道为什么来自服务器外部的电子邮件被拒绝,但我还是遵循了这个建议

DAEMON_OPTIONS(`Port=smtp, Addr=192.168.0.1, Name=MTA')dnl
DAEMON_OPTIONS(`Port=smtp, Addr=127.0.0.1, Name=MTA-loopback')dnl

然后,对于缓慢的 SpamAssassin 和通过 SquirrelMail 发送电子邮件,NetworkManager 列出的第一个 DNS 服务器(符号链接在 /etc/resolv.conf 中)是一个不应该由我们 IP 空间内的计算机使用的 IP。一旦我更改它,网络邮件发送只需一两秒钟。

相关内容