summaryrefslogtreecommitdiffstats
path: root/rules/headers_checks.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-07-29 16:22:46 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-07-29 16:22:46 +0100
commite9261b7c8ebcea93e0b8bbe6fc847d1168a25a4d (patch)
tree622631af5b26818f7ca72e02402280e690b39d62 /rules/headers_checks.lua
parentb44510d2396fe86ffde9e55fad53154ba709a329 (diff)
downloadrspamd-e9261b7c8ebcea93e0b8bbe6fc847d1168a25a4d.tar.gz
rspamd-e9261b7c8ebcea93e0b8bbe6fc847d1168a25a4d.zip
[Minor] Some more minor fixes to lua
Diffstat (limited to 'rules/headers_checks.lua')
-rw-r--r--rules/headers_checks.lua15
1 files changed, 6 insertions, 9 deletions
diff --git a/rules/headers_checks.lua b/rules/headers_checks.lua
index 2e4bae307..25cb263ff 100644
--- a/rules/headers_checks.lua
+++ b/rules/headers_checks.lua
@@ -920,15 +920,12 @@ rspamd_config.CTYPE_MIXED_BOGUS = {
local found = false
-- Check each part and look for a part that isn't multipart/* or text/plain or text/html
for _,p in ipairs(parts) do
- local ct = p:get_header('Content-Type')
- if (ct) then
- ct = ct:lower()
- if (ct:match('^multipart/') or
- ct:match('^text/plain') or
- ct:match('^text/html'))
- then
- -- Nothing
- else
+ local pct = p:get_header('Content-Type')
+ if (pct) then
+ pct = pct:lower()
+ if not ((pct:match('^multipart/') or
+ pct:match('^text/plain') or
+ pct:match('^text/html'))) then
found = true
end
end