我需要使用以下三条规则来分类我的电子邮件:
我正在使用鸽舍筛分规则来做到这一点。
还有一个额外的条件:上面的三条规则必须适用于电子邮件中的每个“收件人:”地址…所以在最复杂的情况下,应该将电子邮件复制到三个文件夹中
例如:以下电子邮件应该被复制到三个文件夹:
From: [email protected] To: [email protected], [email protected], [email protected] Subject: Test Email This is a test email
要求和第一条规则很简单:
require ["fileinto","copy"]; if address :is :domain "to" "somedomain.tld" { fileinto :copy "somedomain_tld"; }
但第二个不知道该怎么做:
if address :matches :domain "to" "*.tld" { fileinto :copy "others_tlds"; }
将匹配somedomain.tld,这不是什么意图…(如果我有一个电子邮件与“To:[email protected]”它将被复制到somedomain_tld(OK)和others_tlds(BUG))
对于#3我没有线索。
我也正在考虑正则expression式,但是我不知道如何用正则expression式(或任何其他正则expression式)来expression“除此以外的每个领域”
有没有人知道如何弯曲dovecot的筛子做1,2,3?
require ["fileinto"]; if header :contains "To" "domain.tld" { fileinto "INBOX/domain_tld"; stop; } if header :contains "To" ".tld" { fileinto "INBOX/other_tld"; stop; } if true { fileinto "INBOX/rest"; stop; }