1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-03-03 14:52:36 +02:00

Fix spam filtering when the score is negative

This commit is contained in:
Pierre Jaury 2016-08-19 21:58:40 +02:00
parent 2602ef2883
commit bfe9ededbc

View File

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