aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-05 18:51:15 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-05 18:51:15 +0100
commitdd01c15d5502f606441859dc33a89f8c607e142f (patch)
tree30c87bb5377c3b433dc4b08843f09845ea51d17d
parent41a715a7018ba3474ee339eb506bc8732d31059d (diff)
downloadrspamd-dd01c15d5502f606441859dc33a89f8c607e142f.tar.gz
rspamd-dd01c15d5502f606441859dc33a89f8c607e142f.zip
[Feature] Add generic maillist detector
Issue: #584 Reported by: @piwats
-rw-r--r--src/plugins/lua/maillist.lua17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/plugins/lua/maillist.lua b/src/plugins/lua/maillist.lua
index c8515f199..5f683a003 100644
--- a/src/plugins/lua/maillist.lua
+++ b/src/plugins/lua/maillist.lua
@@ -63,9 +63,9 @@ end
-- List-Help: <mailto:
-- List-Post: <mailto:
-- List-Subscribe: .*<mailto:.*=subscribe>
--- List-Id:
+-- List-Id:
-- List-Unsubscribe: .*<mailto:.*=unsubscribe>
--- List-Archive:
+-- List-Archive:
-- X-Mailman-Version: \d
local function check_ml_mailman(task)
-- Mailing-List
@@ -241,6 +241,15 @@ local function check_ml_cgp(task)
return check_rfc2919(task)
end
+local function check_ml_generic(task)
+ local header = task:get_header('Precedence')
+ if not header or (header ~= 'list' and header ~= 'bulk') then
+ return false
+ end
+
+ return check_rfc2919(task)
+end
+
local function check_maillist(task)
if check_ml_ezmlm(task) then
task:insert_result(symbol, 1, 'ezmlm')
@@ -254,6 +263,8 @@ local function check_maillist(task)
task:insert_result(symbol, 1, 'majordomo')
elseif check_ml_cgp(task) then
task:insert_result(symbol, 1, 'cgp')
+ elseif check_ml_generic(task) then
+ task:insert_result(symbol, 0.5, 'generic')
end
end
-- Registration
@@ -265,7 +276,7 @@ end
-- Configuration
local opts = rspamd_config:get_all_opt('maillist')if opts then
if opts['symbol'] then
- symbol = opts['symbol']
+ symbol = opts['symbol']
rspamd_config:register_symbol(symbol, 1.0, check_maillist)
end
end