这里真正的挑战是阐明如何可靠地识别回复您所写内容的消息。To:
您是否对排除属于或您自己的消息感到满意Cc:
?
:0
* ^Sender: linux-kernel-owner@vger\.kernel\.org\>
* ! ^From: Your Self <you@example\.net>
* ! ^TO_you@example\.net\>
/dev/null
(显然,编辑地址以匹配您的邮件客户端实际放置的地址)。
或者您可能有一个虚荣域,在这种情况下(正确构建的)回复将在References:
?
:0
* ^Sender: linux-kernel-owner@vger\.kernel\.org\>
* ! ^From: Your Self <you@example\.net>
* ! ^TO_you@example\.net\>
* ! ^References:[ ]*<[^<>@]*@yourdomain\.example\.net>
/dev/null
(方括号内的空格应该是制表符和空格)。
或者您可以扩展一点以在 中的任何位置查找您的域References:
,如果您愿意,还可以包括对您自己的回复的回复。
或者,您可以保留所有传出 message-id:s 的本地副本并在 中查找它们References:
,但这已经是一项重大的努力,如果您不能使用上述任何一项,我只会指出这是一种可能性。(我相信它之前已经更详细地讨论过了,也许在Procmail 邮件列表中。)
顺便说一句,我会将“补丁”规则更改为仅检查该Subject:
行。任何其他标题中的“补丁”匹配极有可能是误报。如果你想检查身体,你需要额外的标志,也许像这样:
:0
* ^Sender: linux-kernel-owner@vger\.kernel\.org\>
{
:0
* ! B ?? \<patch\>
* ! ^Subject:(.*\<)?patch\>
{ } # empty "then", just so we can continue to "else"
:0E
$MAILDIR/ml.kernel_org.linux-kernel.patches/
# While we are inside these braces, let's continue with other LKML stuff
:0
* ! ^From: Your Self <you@example\.net>
* ! ^TO_you@example\.net
/dev/null
# Any additional LKML recipes? Add them here
# Anything which falls through here is regular LKML
:0
$MAILDIR/ml.kernel_org.linux-kernel/
}
(这显然可以用多种不同的方式重构。记住德摩根定律:NOT (A OR B) <=>
NOT A AND NOT B。)
作为一项安全措施,您可能希望查找实际上带有补丁作为附件的消息,而不是过滤有关此类消息的讨论?这也可能变得相当复杂,因为有许多不同的方法可以将补丁表示为 MIME 附件(有些也完全内联发送,在text/plain
其他文本中的常规部分中)但这也不是不可克服的,只是显着的苦差事。