]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] SA uses mime recipients/senders for everything
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 8 Mar 2016 11:51:57 +0000 (11:51 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 8 Mar 2016 11:51:57 +0000 (11:51 +0000)
src/plugins/lua/spamassassin.lua

index 0039a988aedfcb5121e5f9905c204c7832c51e72..f12b0cb24a1490dec99eb20feaa2a8517de87bf7 100644 (file)
@@ -283,7 +283,7 @@ end
 local function gen_eval_rule(arg)
   local eval_funcs = {
     {'check_freemail_from', function(task, remain)
-        local from = task:get_from()
+        local from = task:get_from('mime')
         if from then
           return freemail_search(from[1]['addr'])
         end
@@ -330,7 +330,7 @@ local function gen_eval_rule(arg)
     {
       'check_for_missing_to_header',
       function (task, remain)
-        if not task:get_from(1) then
+        if not task:get_recipients('mime') then
           return 1
         end
 
@@ -412,7 +412,7 @@ local function gen_eval_rule(arg)
     {
       'check_from_in_blacklist',
       function(task, remain)
-        local from = task:get_from()
+        local from = task:get_from('mime')
         if from and from[1] and from[1]['addr'] then
           if sa_lists['from_blacklist'][from[1]['addr']] then
             return 1
@@ -425,7 +425,7 @@ local function gen_eval_rule(arg)
     {
       'check_from_in_whitelist',
       function(task, remain)
-        local from = task:get_from()
+        local from = task:get_from('mime')
         if from and from[1] and from[1]['addr'] then
           if sa_lists['from_whitelist'][from[1]['addr']] then
             return 1
@@ -438,7 +438,7 @@ local function gen_eval_rule(arg)
     {
       'check_from_in_default_whitelist',
       function(task, remain)
-        local from = task:get_from()
+        local from = task:get_from('mime')
         if from and from[1] and from[1]['addr'] then
           if sa_lists['from_def_whitelist'][from[1]['addr']] then
             return 1
@@ -451,7 +451,7 @@ local function gen_eval_rule(arg)
     {
       'check_to_in_blacklist',
       function(task, remain)
-        local rcpt = task:get_recipients()
+        local rcpt = task:get_recipients('mime')
         if rcpt then
           for i,r in ipairs(rcpt) do
             if sa_lists['from_blacklist'][r['addr']] then
@@ -466,7 +466,7 @@ local function gen_eval_rule(arg)
     {
       'check_to_in_whitelist',
       function(task, remain)
-        local rcpt = task:get_recipients()
+        local rcpt = task:get_recipients('mime')
         if rcpt then
           for i,r in ipairs(rcpt) do
             if sa_lists['from_whitelist'][r['addr']] then