aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnton Yuzhaninov <citrin+git@citrin.ru>2020-12-22 13:05:58 +0000
committerAnton Yuzhaninov <citrin+git@citrin.ru>2020-12-22 13:05:58 +0000
commita9e9703a896161f1ff96af4d26223428e57f13ad (patch)
tree0338e955cbfdd1a94df4a0139f79d395f4ae0c31 /src
parent5cd7131d26a4859953e6b886c6f254676b4da54a (diff)
downloadrspamd-a9e9703a896161f1ff96af4d26223428e57f13ad.tar.gz
rspamd-a9e9703a896161f1ff96af4d26223428e57f13ad.zip
[Minor] Use task:has_header instead of task:get_header
Use task:has_header() to check if header is exists.
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/maillist.lua12
-rw-r--r--src/plugins/lua/spamassassin.lua2
2 files changed, 2 insertions, 12 deletions
diff --git a/src/plugins/lua/maillist.lua b/src/plugins/lua/maillist.lua
index 1fdfef010..a5d879d05 100644
--- a/src/plugins/lua/maillist.lua
+++ b/src/plugins/lua/maillist.lua
@@ -169,17 +169,7 @@ end
-- RFC 2919 headers exist
--
local function check_ml_googlegroup(task)
- local header = task:get_header('X-Google-Loop')
-
- if not header then
- header = task:get_header('X-Google-Group-Id')
-
- if not header then
- return false
- end
- end
-
- return true
+ return task:has_header('X-Google-Loop') or task:has_header('X-Google-Group-Id')
end
-- CGP detector
diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua
index 5a8615d6c..911661ed9 100644
--- a/src/plugins/lua/spamassassin.lua
+++ b/src/plugins/lua/spamassassin.lua
@@ -586,7 +586,7 @@ local function maybe_parse_sa_function(line)
end
for _,h in ipairs(hdrs_check) do
- if task:get_header(h) then
+ if task:has_header(h) then
return 1
end
end