]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] SpamAssassin plugin: support check_freemail_header('EnvelopeFrom', [..]) 808/head
authorAndrew Lewis <nerf@judo.za.org>
Thu, 4 Aug 2016 13:51:12 +0000 (14:51 +0100)
committerAndrew Lewis <nerf@judo.za.org>
Thu, 4 Aug 2016 13:51:12 +0000 (14:51 +0100)
src/plugins/lua/spamassassin.lua

index 618cae410faeb45cb6f74fdc87701eca3431be0e..cf17aa2476d1e02bc10437ca228dcc6b684dbe24 100644 (file)
@@ -307,7 +307,13 @@ local function gen_eval_rule(arg)
         end
 
         if arg then
-          local h = task:get_header(arg)
+          local h
+          if arg == 'EnvelopeFrom' then
+            h = task:get_from('smtp')
+            if h then h = h[1]['addr'] end
+          else
+            h = task:get_header(arg)
+          end
           if h then
             local hdr_freemail = freemail_search(string.lower(h))