]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Add generic maillist detector
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 5 Apr 2016 17:51:15 +0000 (18:51 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 5 Apr 2016 17:51:15 +0000 (18:51 +0100)
Issue: #584
Reported by: @piwats

src/plugins/lua/maillist.lua

index c8515f199f1ea990c3d27e010055843fddafe113..5f683a0039ffc62451c6194f1f4289bc27a6a26f 100644 (file)
@@ -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