19

我是 Exim 的新手,我将它用作智能主机(接收用户的电子邮件并将其发送给我的 ISP)。 在此处输入图像描述

系统工作正常,但我遇到了一些冻结消息的问题。我有时会查看队列,并且有一些没有发件人的冻结消息,因此 Exim 无法发送它们,因为如果没有发件人,它就无法通过 ISP 进行身份验证。

我可以从哪里开始调试呢?

谢谢一百万。

4

3 回答 3

24

这些是退回邮件。有些东西正在通过您的邮件服务器发送邮件,但收件人不接受它,因此您的系统会生成退回邮件。这些退回邮件也被拒绝,因此它们被 exim MTA “冻结”。您需要弄清楚消息最初来自哪里,并阻止那些未经授权的消息的流动。

exigrep 1UorWC-0002Nz-Mz /var/log/exim/main.log(或者无论你的路径是什么)

这将在邮件日志中找到退回邮件。我以邮件队列中的一条冻结消息为例(1UosOk-0000ej-KG):

# exigrep 1UosOk-0000ej-KG /var/log/exim/main.log
+++ 1UosOk-0000ej-KG has not completed +++
2013-06-18 09:40:22 1UosOk-0000ej-KG <= <> R=1UosOf-0000bX-BV U=www P=local S=894 
2013-06-18 09:40:24 1UosOk-0000ej-KG ** origsender@example.biz P=<> R=dnslookup_forwarder 
  T=remote_smtp_forwarder: SMTP error from remote mail server after RCPT TO:<origsender@example.biz>: 
  host mail.example.biz [80.76.197.72]: 554 5.7.1 <origsender@example.biz>: Relay access denied
2013-06-18 09:40:24 1UosOk-0000ej-KG Frozen (delivery error message)

第一行表示退回消息1UosOk-0000ej-KG是为响应消息1UosOf-0000bX-B而创建的(这就是 <= 行中的 R= 短语的含义)。现在搜索THAT message id 以找出该消息的实际来源。就我而言,这不是退回邮件,而是客户的自动回复:

# exigrep 1UosOf-0000bX-BV /var/log/exim/main.log
2013-06-18 09:40:18 1UosOf-0000bX-BV H=example.biz [62.189.29.157] Warning: SPF PASS (pass) to m.ivenue.com: 
  domain of example.biz designates 62.189.29.157 as permitted sender
2013-06-18 09:40:22 1UosOf-0000bX-BV <= origsender@example.biz H=example.biz [62.189.29.157] P=esmtp S=17624
2013-06-18 09:40:22 1UosOf-0000bX-BV => /netapp3/mail/maildirs/b/o/y/boyexample.com/sarah/Maildir/ 
  (sarah@boyexample.com) <sarah@boyexample.com> P=<origsender@example.biz> R=virtual_user T=address_directory
2013-06-18 09:40:22 1UosOf-0000bX-BV => sarah <sarah@boyexample.com> P=<origsender@example.biz> 
  R=autoresponder_always T=autoresponder_always_t
2013-06-18 09:40:22 1UosOf-0000bX-BV Completed

一旦你发现通过你的系统发送这些消息的过程是什么,你可以采取措施阻止它们,假设它们一开始就不是有效的消息。您采取的步骤将在很大程度上取决于您的发现。

通常您不想尝试重新发送这些冻结的消息。但是,如果消息由于某些临时网络或配置错误而被冻结,并且您想让 exim 重新发送它们,那么您需要生成一个冻结消息列表并告诉 Exim 发送它们。最简单的方法是使用 exiqgrep 程序:

exiqgrep -z -i | xargs -n 1 exim -M
于 2013-06-18T12:59:58.587 回答
16

冻结的邮件在 exim 队列中没有用。您可以删除所有这些以减少 exim 队列列表。

以下命令将删除所有冻结的邮件:

exim -bpr | grep frozen | awk {'print $3'} | xargs exim -Mrm

或者

exiqgrep -z -i | xargs exim -Mrm

如果要删除超过特定时间(例如 24 小时)的冻结邮件:

exiqgrep -zi -o 86400 | xargs exim -Mrm

86400 表示以秒为单位的 24 小时。这可以相应地改变。

于 2013-06-23T06:48:45.353 回答
6

ignore_bounce_errors_after通过将配置选项设置为合适的值,exim 可以自动清除冻结的反弹,例如

ignore_bounce_errors_after = 12h

将在 12 小时后自动删除这些退回错误。

于 2014-04-15T10:21:41.480 回答