我是一名新手,正在尝试在只有我一个人的笔记本电脑上解决以下邮件解决方案:
getmail - spamassassin - procmail - mu4e (an emacs mail program)
现在我成功地
getmail - mu4e
使用我以前的邮件程序(emacs gnus),我成功地将 spamassassin 作为spamd
守护进程实现。
我认为我理解如何getmail
通过 spamassassin 过滤邮件并将其发送到我procmail.
应该如何编写.procmailrc
文件以便将 spamassassin 处理的邮件发送到我的电子邮件程序中的最终“垃圾邮件”或“非垃圾邮件”目的地?
答案1
我建议使用 fetchmail(带mda
选项)而不是 getmail。
getmail 配置:~/.getmail/getmailrc
- 通过 procmail 发送
要使用外部 MDA 进行交付:
[destination]
type = MultiDestination
destinations = ("[procmail-as-bob]", )
[procmail-as-bob]
type = MDA_external
path = /path/to/procmail
arguments = ('~bob/.procmailrc', '-f', '%(sender)')
user = bob
使用 spamassassin/spamc 进行 procmail 配置:~/.procmailrc
# default/fallback delivery destination
DEFAULT=Maildir/
# rewrite message using spamassassin or spamc
# :spamassassin.lock lock is not necessary for spamc
# (it makes some sense for spamassassin)
:0fw: spamassassin.lock
* < 256000
| spamc
# Mails with a score of 15 or higher are almost certainly spam (with 0.05%
# false positives according to rules/STATISTICS.txt). Let's put them in a
# different mailbox. (This one is optional.)
# locking (trailing : ) is not necessary for deliveries to maildir
:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
Maildir/almost-certainly-spam/
# All mail tagged as spam (eg. with a score higher than the set threshold)
# is moved to "probably-spam".
# locking (trailing : ) is not necessary for deliveries to maildir
:0:
* ^X-Spam-Status: Yes
Maildir/probably-spam/