我刚刚从旧的 Ubuntu 10.4 VPS 迁移到全新的 Ubuntu 14.04。
经过一些工作,除了带有筛子的鸽舍之外,我让所有东西都运行起来了。
这个问题是关于通过 exim 筛选传递给 dovecot 的消息
预期行为:Exim 收到一封邮件,对其进行垃圾邮件检查,然后通过 /var/run/dovecot/deliver 将其发送给 dovecot... 然后,Dovecot 对该邮件应用筛选过滤规则,并将邮件存储到过滤脚本定义的适当文件夹中。
实际行为:Exim 将邮件投递到 dovecot.... 对邮件进行筛选过滤
Sep 25 18:41:57 myHostxxx dovecot: lda(timmeey): Debug: sieve: Pigeonhole version 0.4.2 initializing
Sep 25 18:41:57 myHostxxx dovecot: lda(timmeey): Debug: sieve: include: sieve_global_dir is not set; it is currently not possible to include `:global' scripts.
Sep 25 18:41:57 myHostxxx dovecot: lda(timmeey): Debug: sieve: using the following location for user's Sieve script: /var/mail/timmeey/sieve/.dovecot.sieve;name=main script
Sep 25 18:41:57 myHostxxx dovecot: lda(timmeey): Debug: sieve: loading script /var/mail/timmeey/sieve/.dovecot.sieve;name=main script
Sep 25 18:41:57 myHostxxx dovecot: lda(timmeey): Debug: sieve: script binary /var/mail/timmeey/sieve/.dovecot.svbin successfully loaded
Sep 25 18:41:57 myHostxxx dovecot: lda(timmeey): Debug: sieve: binary save: not saving binary /var/mail/timmeey/sieve/.dovecot.svbin, because it is already stored
Sep 25 18:41:57 myHostxxx dovecot: lda(timmeey): Debug: sieve: executing script from /var/mail/timmeey/sieve/.dovecot.svbin
Sep 25 18:41:57 myHostxxx dovecot: lda(timmeey): sieve: msgid=<[email protected]>: stored mail into mailbox 'INBOX'
但最后它似乎忽略了我的规则,只是将消息存储到收件箱中。但有时它会应用过滤器并将消息存储到适当的文件夹中。但到目前为止,我还没有找到确定的规则来确定它何时有效,何时无效。
通常我会认为我的规则可能被破坏了。但是当我用 sieve-test 测试过滤器时
sieve-test /var/mail/timmeey/sieve/.dovecot.sieve ./mail1 -D
sieve-test(timmeey): Debug: Effective uid=1000, gid=1000, home=/home/timmeey
sieve-test(timmeey): Debug: sieve: Pigeonhole version 0.4.2 initializing
sieve-test(timmeey): Debug: sieve: include: sieve_global_dir is not set; it is currently not possible to include `:global' scripts.
debug: script binary /var/mail/timmeey/sieve/.dovecot.svbin successfully loaded.
debug: binary save: not saving binary /var/mail/timmeey/sieve/.dovecot.svbin, because it is already stored.
sieve-test(timmeey): Debug: none: root=, index=, indexpvt=, control=, inbox=, alt=
Performed actions:
* store message in folder: pool/wichtig
Implicit keep:
(none)
sieve-test(timmeey): Info: final result: success
测试表明一切正常。(我将来自 thunderbird 的邮件源复制到文本文件“mail1”中
下面是一个发挥作用的例子
Sep 25 18:24:41 myHostxxx dovecot: lda(timmeey): Debug: sieve: Pigeonhole version 0.4.2 initializing
Sep 25 18:24:41 myHostxxx dovecot: lda(timmeey): Debug: sieve: include: sieve_global_dir is not set; it is currently not possible to include `:gl
obal' scripts.
Sep 25 18:24:41 h2339537 dovecot: lda(timmeey): Debug: sieve: using the following location for user's Sieve script: /var/mail/timmeey/sieve/.dov
ecot.sieve;name=main script
Sep 25 18:24:41 myHostxxx dovecot: lda(timmeey): Debug: sieve: loading script /var/mail/timmeey/sieve/.dovecot.sieve;name=main script
Sep 25 18:24:41 myHostxxx dovecot: lda(timmeey): Debug: sieve: script binary /var/mail/timmeey/sieve/.dovecot.svbin successfully loaded
Sep 25 18:24:41 myHostxxx dovecot: lda(timmeey): Debug: sieve: binary save: not saving binary /var/mail/timmeey/sieve/.dovecot.svbin, because it
is already stored
Sep 25 18:24:41 myHostxxx dovecot: lda(timmeey): Debug: sieve: executing script from /var/mail/timmeey/sieve/.dovecot.svbin
Sep 25 18:24:41 myHostxxx dovecot: lda(timmeey): sieve: msgid=<[email protected]>: stored mail into mailbox 'listen/owncloud-user'
Dovecot 2.2.9 Ubuntu 14.04
我真的没有主意了……在我的旧 VPS 上一切都运行良好。我甚至重启了服务器……
提前致谢。
编辑: 这会变得相当冗长,抱歉。
首先,这是过滤器应触发的标题。(我从邮件中删除了所有其他噪音,显然还删除了一些个人信息,因为我已经收到足够的垃圾邮件 :-P 但这不应该影响过滤器
邮箱无法使用
因此,当我对第一封邮件运行 test-sieve 时,它会触发过滤器。它会将其存储到“pool/wichtig”中
Return-path: <[email protected]>
Envelope-to: [email protected]
Delivery-date: Sat, 27 Sep 2014 01:46:12 +0200
[...]
> $ sieve-test /var/mail/timmeey/sieve/.dovecot.sieve ./poolMail -D -t -Tlevel=tests
sieve-test(timmeey): Debug: Effective uid=1000, gid=1000, home=/home/timmeey
sieve-test(timmeey): Debug: sieve: Pigeonhole version 0.4.2 initializing
sieve-test(timmeey): Debug: sieve: include: sieve_global_dir is not set; it is currently not possible to include `:global' scripts.
debug: script binary /var/mail/timmeey/sieve/.dovecot.svbin successfully loaded.
debug: binary save: not saving binary /var/mail/timmeey/sieve/.dovecot.svbin, because it is already stored.
sieve-test(timmeey): Debug: none: root=, index=, indexpvt=, control=, inbox=, alt=
Performed actions:
* store message in folder: pool/wichtig
Implicit keep:
(none)
sieve-test(timmeey): Info: final result: success
这是我实际收到邮件时的日志输出。无论出于什么原因,它都没有触发。(过滤器设置正确
lrwxrwxrwx 1 timmeey timmeey 21 Sep 27 01:45 .dovecot.sieve -> serverFaultTest.sieve
)
Sep 27 01:46:12 h6666666 dovecot: lda: Debug: Loading modules from directory: /usr/lib/dovecot/modules
Sep 27 01:46:12 h6666666 dovecot: lda: Debug: Module loaded: /usr/lib/dovecot/modules/lib90_sieve_plugin.so
Sep 27 01:46:12 h6666666 dovecot: lda(timmeey): Debug: Effective uid=1000, gid=1000, home=/home/timmeey
Sep 27 01:46:12 h6666666 dovecot: lda(timmeey): Debug: mbox: INBOX defaulted to /var/mail/timmeey/timmeey/inbox
Sep 27 01:46:12 h6666666 dovecot: lda(timmeey): Debug: fs: root=/var/mail/timmeey/timmeey, index=, indexpvt=, control=, inbox=/var/mail/timmeey/timmeey/inbox, alt=
Sep 27 01:46:12 h6666666 dovecot: lda(timmeey): Debug: userdb lookup skipped, username taken from USER environment
Sep 27 01:46:12 h6666666 dovecot: lda(timmeey): Debug: none: root=, index=, indexpvt=, control=, inbox=, alt=
Sep 27 01:46:12 h6666666 dovecot: lda(timmeey): Debug: Destination address: [email protected] (source: user@hostname)
Sep 27 01:46:12 h6666666 dovecot: lda(timmeey): Debug: sieve: Pigeonhole version 0.4.2 initializing
Sep 27 01:46:12 h6666666 dovecot: lda(timmeey): Debug: sieve: include: sieve_global_dir is not set; it is currently not possible to include `:global' scripts.
Sep 27 01:46:12 h6666666 dovecot: lda(timmeey): Debug: sieve: using the following location for user's Sieve script: /var/mail/timmeey/sieve/.dovecot.sieve;name=main script
Sep 27 01:46:12 h6666666 dovecot: lda(timmeey): Debug: sieve: loading script /var/mail/timmeey/sieve/.dovecot.sieve;name=main script
Sep 27 01:46:12 h6666666 dovecot: lda(timmeey): Debug: sieve: script binary /var/mail/timmeey/sieve/.dovecot.svbin is not up-to-date
Sep 27 01:46:12 h6666666 dovecot: lda(timmeey): Debug: sieve: script `main script' from /var/mail/timmeey/sieve/.dovecot.sieve;name=main script successfully compiled
Sep 27 01:46:12 h6666666 dovecot: lda(timmeey): Debug: sieve: executing script from /var/mail/timmeey/sieve/.dovecot.sieve;name=main script
Sep 27 01:46:12 h6666666 dovecot: lda(timmeey): sieve: msgid=<[email protected]>: stored mail into mailbox 'INBOX'
确实有效的邮件
这里有一封 Facebook 邮件,它在测试时起作用并触发了过滤器,当我收到实际邮件时
Return-path: <xxx@xxx>
Envelope-to: [email protected]
Delivery-date: Fri, 26 Sep 2014 20:52:30 +0200
Received: from facebook.com (ugG7XsRqKzRYl9dQStMUIo10vkuNI1jSm7GtZghIpww+XBdr3TIkc02H/roiAJF9 10.158.104.67)
by facebook.com with Thrift id 3bd81b8845ae11e483660002c9550d78-92fed3e0;
Fri, 26 Sep 2014 11:52:15 -0700
X-Facebook: from 10.88.41.65 ([MTI3LjAuMC4x])
by async.facebook.com with HTTP (ZuckMail);
Date: Fri, 26 Sep 2014 11:52:15 -0700
To: Kurdistan Charity Minigolf-Turnier im Bunker <xxx@xxx>
From: "XXXX XXXXX" <[email protected]>
Reply-to: Reply to comment <g+40tymmuw000zg3h03tug003o44m2mbkn000000gpc3xb2qd46@groups.facebook.com>
> $ sieve-test /var/mail/timmeey/sieve/.dovecot.sieve ./facebookMail -D -t -Tlevel=tests
sieve-test(timmeey): Debug: Effective uid=1000, gid=1000, home=/home/timmeey
sieve-test(timmeey): Debug: sieve: Pigeonhole version 0.4.2 initializing
sieve-test(timmeey): Debug: sieve: include: sieve_global_dir is not set; it is currently not possible to include `:global' scripts.
debug: script binary /var/mail/timmeey/sieve/.dovecot.svbin successfully loaded.
debug: binary save: not saving binary /var/mail/timmeey/sieve/.dovecot.svbin, because it is already stored.
sieve-test(timmeey): Debug: none: root=, index=, indexpvt=, control=, inbox=, alt=
Performed actions:
* store message in folder: facebook
Implicit keep:
(none)
sieve-test(timmeey): Info: final result: success
看到了吗?这封邮件是在测试时触发的
Sep 26 20:52:30 h6666666 dovecot: lda(timmeey): Debug: sieve: Pigeonhole version 0.4.2 initializing
Sep 26 20:52:30 h6666666 dovecot: lda(timmeey): Debug: sieve: include: sieve_global_dir is not set; it is currently not possible to include `:global' scripts.
Sep 26 20:52:30 h6666666 dovecot: lda(timmeey): Debug: sieve: using the following location for user's Sieve script: /var/mail/timmeey/sieve/.dovecot.sieve;name=main script
Sep 26 20:52:30 h6666666 dovecot: lda(timmeey): Debug: sieve: loading script /var/mail/timmeey/sieve/.dovecot.sieve;name=main script
Sep 26 20:52:30 h6666666 dovecot: lda(timmeey): Debug: sieve: script binary /var/mail/timmeey/sieve/.dovecot.svbin successfully loaded
Sep 26 20:52:30 h6666666 dovecot: lda(timmeey): Debug: sieve: binary save: not saving binary /var/mail/timmeey/sieve/.dovecot.svbin, because it is already stored
Sep 26 20:52:30 h6666666 dovecot: lda(timmeey): Debug: sieve: executing script from /var/mail/timmeey/sieve/.dovecot.svbin
Sep 26 20:52:30 h6666666 dovecot: lda(timmeey): sieve: msgid=<[email protected]>: stored mail into mailbox 'facebook'
并且它在接收实际邮件时触发(将其存储到“facebook”
这里我们有测试过滤器
require ["fileinto","envelope"];
if address :domain :contains ["From"] "facebookmail.com"
{
fileinto "facebook";
}
if envelope :contains ["To"] "[email protected]"
{
fileinto "pool/wichtig";
stop;
}
编辑2: 我想我在这里找到了一个规则。当我检查类似这样的地址时
address :contains ["To"] "[email protected]"
它在测试和处理实际邮件时都能发挥作用。
但测试一些信封条件
envelope :contains ["To"] "[email protected]"
它只在筛选测试时起作用,但不适用于实际邮件。
我不知道为什么。这个问题还没有解决,但我可能找到了一种解决这个问题的方法。有人使用信封内容进行过滤吗?它坏了吗?
答案1
我也看到了同样的情况。我使用的envelope :contains "To"
是筛分试验但不能实时运行。如果我按照你的建议进行更改address :contains "To"
,它也能实时运行。这看起来像是一个筛虫。