Honor per-user spam settings, fixes #21

This commit is contained in:
Pierre Jaury
2016-08-18 20:09:11 +02:00
parent 2a3f62fc65
commit daf8c4bad3
3 changed files with 26 additions and 4 deletions

View File

@@ -1,6 +1,12 @@
require ["fileinto", "envelope", "mailbox", "imap4flags"];
require ["variables", "fileinto", "envelope", "mailbox", "imap4flags", "regex", "relational", "comparator-i;ascii-numeric", "vnd.dovecot.extdata"];
if header :contains "X-Spam" "YES" {
setflag "\\seen";
fileinto :create "Junk";
if string :is "${extdata.spam_enabled}" "1" {
if header :matches "X-Spam-Status" "* score=*" {
if string :value "ge" :comparator "i;ascii-numeric" "${2}" "${extdata.spam_threshold}" {
setflag "\\seen";
fileinto :create "Junk";
stop;
}
}
}