From 93f33e956d01de148421a45696746216b1e73fa2 Mon Sep 17 00:00:00 2001 From: Pierre Jaury Date: Thu, 18 Aug 2016 20:14:03 +0200 Subject: [PATCH] Filter spam before forward and auto-reply --- dovecot/sieve/after.sieve | 12 ------------ dovecot/sieve/before.sieve | 12 +++++++++++- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/dovecot/sieve/after.sieve b/dovecot/sieve/after.sieve index 44d62265..e69de29b 100644 --- a/dovecot/sieve/after.sieve +++ b/dovecot/sieve/after.sieve @@ -1,12 +0,0 @@ -require ["variables", "fileinto", "envelope", "mailbox", "imap4flags", "regex", "relational", "comparator-i;ascii-numeric", "vnd.dovecot.extdata"]; - - -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; - } - } -} diff --git a/dovecot/sieve/before.sieve b/dovecot/sieve/before.sieve index 43db1145..b0075c5c 100644 --- a/dovecot/sieve/before.sieve +++ b/dovecot/sieve/before.sieve @@ -1,4 +1,14 @@ -require ["variables", "vacation", "vnd.dovecot.extdata"]; +require ["variables", "vacation", "fileinto", "envelope", "mailbox", "imap4flags", "regex", "relational", "comparator-i;ascii-numeric", "vnd.dovecot.extdata"]; + +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; + } + } +} if string :is "${extdata.reply_enabled}" "1" { vacation :days 1 :subject "${extdata.reply_subject}" "${extdata.reply_body}";