我已经安装了 SpamAssassin 并将其配置为从 sql 读取首选项。我意识到它没有读取用户的首选项,并检查了我看到spamc
客户端发送的所有请求都作为 spamd 用户执行的日志。
这是 spamc 客户端如何按照master.cf
文件中的配置执行(后缀):
spamassassin unix - n n - - pipe
user=spamd argv=/usr/bin/spamc -f -e
/usr/sbin/sendmail -oi -f ${sender} ${recipient}
我添加-u ${recipient}
到 spamc,并在日志中看到它有效,现在用户的首选项已正确获取。
但是,这种方式会破坏我对别名的传递。
考虑[email protected]
成为[email protected]
和 to的后缀别名[email protected]
。添加上述内容-u
会spamc
导致电子邮件无法发送到别名。
当它不发送电子邮件时,这里有很多后缀:
Feb 14 21:12:36 mail postfix/qmgr[51620]: 6EFD11003F5: from=<[email protected]>, size=2588, nrcpt=2 (queue active)
Feb 14 21:12:37 mail postfix/pipe[51637]: 6EFD11003F5: to=<[email protected]>, orig_to=<[email protected]>, relay=spamassassin, delay=1.3, delays=0.03/0/0/1.3, dsn=2.0.0, status=sent (delivered via spamassassin service (X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ha))
Feb 14 21:12:37 mail postfix/pipe[51637]: 6EFD11003F5: to=<[email protected]>, orig_to=<[email protected]>, relay=spamassassin, delay=1.3, delays=0.03/0/0/1.3, dsn=2.0.0, status=sent (delivered via spamassassin service (X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ha))
Feb 14 21:12:37 mail postfix/qmgr[51620]: 6EFD11003F5: removed
我删除了-u ${recipient}
, 事情又可以工作了,但我无法从以下日志中找到太多帮助:
Feb 14 21:14:36 mail postfix/master[51877]: daemon started -- version 3.4.13, configuration /etc/postfix
Feb 14 21:15:26 mail postfix/qmgr[51880]: B9C531003F5: from=<[email protected]>, size=2580, nrcpt=2 (queue active)
Feb 14 21:15:27 mail postfix/pipe[51932]: B9C531003F5: to=<[email protected]>, orig_to=<[email protected]>, relay=spamassassin, delay=1.2, delays=0.04/0.01/0/1.1, dsn=2.0.0, status=sent (delivered via spamassassin service)
Feb 14 21:15:27 mail postfix/pipe[51932]: B9C531003F5: to=<[email protected]>, orig_to=<[email protected]>, relay=spamassassin, delay=1.2, delays=0.04/0.01/0/1.1, dsn=2.0.0, status=sent (delivered via spamassassin service)
Feb 14 21:15:27 mail postfix/qmgr[51880]: B9C531003F5: removed
Feb 14 21:15:27 mail postfix/qmgr[51880]: E19B7106C31: from=<[email protected]>, size=2969, nrcpt=2 (queue active)
Feb 14 21:15:28 mail postfix/qmgr[51880]: 01875106C30: from=<[email protected]>, size=3336, nrcpt=1 (queue active)
spamassassin 日志,当它不起作用时,是这些:
Sun Feb 14 21:12:36 2021 [50514] info: spamd: processing message <[email protected]> for [email protected]:5000
Sun Feb 14 21:12:36 2021 [50514] info: dns: no callback for id 21026/IN/A/bluetreehotels.com.br.dbl.spamhaus.org, ignored, packet on next debug line
Sun Feb 14 21:12:36 2021 [50514] info: dns: no likely matching queries for id 21026
Sun Feb 14 21:12:37 2021 [51696] info: util: setuid: ruid=5000 euid=5000 rgid=5000 5000 5000 egid=5000 5000 5000
Sun Feb 14 21:12:37 2021 [50514] info: spamd: clean message (-1.9/3.0) for [email protected]:5000 in 1.3 seconds, 2502 bytes.
Sun Feb 14 21:12:37 2021 [50514] info: spamd: result: . -1 - BAYES_00,SPF_HELO_PASS scantime=1.3,size=2502,[email protected],uid=5000,required_score=3.0,rhost=127.0.0.1,raddr=127.0.0.1,rport=43164,mid=<[email protected]>,bayes=0.000000,autolearn=ham autolearn_force=no
Sun Feb 14 21:12:37 2021 [50512] info: prefork: child states: II
当它工作正常时,如下所示:
Sun Feb 14 21:15:26 2021 [50514] info: spamd: connection from 127.0.0.1 [127.0.0.1]:43402 to port 783, fd 5
Sun Feb 14 21:15:26 2021 [50514] info: spamd: processing message <[email protected]> for spamd:5000
Sun Feb 14 21:15:26 2021 [51934] info: util: setuid: ruid=5000 euid=5000 rgid=5000 5000 5000 egid=5000 5000 5000
Sun Feb 14 21:15:27 2021 [50514] info: spamd: clean message (-0.0/5.0) for spamd:5000 in 1.1 seconds, 2494 bytes.
Sun Feb 14 21:15:27 2021 [50514] info: spamd: result: . 0 - SPF_HELO_PASS scantime=1.1,size=2494,user=spamd,uid=5000,required_score=5.0,rhost=127.0.0.1,raddr=127.0.0.1,rport=43402,mid=<[email protected]>,autolearn=ham autolearn_force=no
关于为什么会发生这种情况的任何线索?这里明显的区别是,在 spamassassin 日志上,当它不起作用时,我们看到它spamc
是由用户调用的[email protected]
(而不是 with[email protected]
和 not with [email protected]
)。别名所代表的收件人都没有收到电子邮件。在第二次尝试时,没有-u
参数,然后 spamc 被执行而不发送用户名(失败进入默认spamd
用户),并且邮件被传递给用户a
和b
.
可以sendmail
吗?
最好的,
弗朗西斯
我想我修好了。添加
spamassassin_destination_recipient_limit = 1
到main.cf
(后缀)就可以了。