]> source.dussan.org Git - rspamd.git/commitdiff
Check smtp recipients before indexing.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 May 2015 11:58:33 +0000 (12:58 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 May 2015 11:58:33 +0000 (12:58 +0100)
src/plugins/lua/forged_recipients.lua

index 913cd4d4e6f0deaa12360fb3ca28372297eceb2e..b7f283cf8d0681b35c5ce7410ef8e5c002e0d228 100644 (file)
@@ -62,9 +62,10 @@ function check_forged_headers(task)
        end
        -- Check sender
        local smtp_from = task:get_from(1)
-       if smtp_from then
+       if smtp_from and smtp_from[1] then
                local mime_from = task:get_from(2)
-               if not mime_from or not mime_from[1] or not (string.lower(mime_from[1]['addr']) == string.lower(smtp_from[1]['addr'])) then
+               if not mime_from or not mime_from[1] or 
+                 not (string.lower(mime_from[1]['addr']) == string.lower(smtp_from[1]['addr'])) then
                        task:insert_result(symbol_sender, 1)
                end
        end