]> source.dussan.org Git - rspamd.git/commitdiff
Add additional checks for mail addresses
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 26 Nov 2015 14:20:08 +0000 (14:20 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 26 Nov 2015 14:20:08 +0000 (14:20 +0000)
src/plugins/lua/forged_recipients.lua

index 89331ab750cc18171e857b8ff738abe5357bcf71..b55940c622e02bb40662367f55cfe5542852a803 100644 (file)
@@ -49,10 +49,12 @@ local function check_forged_headers(task)
                        for _,sr in ipairs(smtp_rcpt) do
                                if mime_rcpt then
                                        for _,mr in ipairs(mime_rcpt) do
-                                               if string.lower(mr['addr']) == string.lower(sr['addr']) then
+                                               if mr['addr'] and sr['addr'] and
+                                                               string.lower(mr['addr']) == string.lower(sr['addr']) then
                                                        res = true
                                                        break
-                                               elseif string.lower(mr['user']) == string.lower(sr['user']) then
+                                               elseif mr['user'] and sr['user'] and
+                                                               string.lower(mr['user']) == string.lower(sr['user']) then
                                                        -- If we have the same username but for another domain, then
                                                        -- lower the overall score
                                                        score = score / 2