Fix spam filtering when the score is negative

master
Pierre Jaury 8 years ago
parent 2602ef2883
commit bfe9ededbc

@ -9,13 +9,14 @@ require "relational";
require "comparator-i;ascii-numeric"; require "comparator-i;ascii-numeric";
require "vnd.dovecot.extdata"; require "vnd.dovecot.extdata";
if string :is "${extdata.spam_enabled}" "1" { if allof (string :is "${extdata.spam_enabled}" "1",
if header :matches "X-Spam-Status" "* score=*" { not header :matches "X-Spam-Status" "* score=-*",
if string :value "ge" :comparator "i;ascii-numeric" "${2}" "${extdata.spam_threshold}" { header :matches "X-Spam-Status" "* score=*")
setflag "\\seen"; {
fileinto :create "Junk"; if string :value "ge" :comparator "i;ascii-numeric" "${2}" "${extdata.spam_threshold}" {
stop; setflag "\\seen";
} fileinto :create "Junk";
stop;
} }
} }

Loading…
Cancel
Save