]> source.dussan.org Git - rspamd.git/commitdiff
* Trim brackets in forged recipients plugin
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 14 Oct 2009 15:18:43 +0000 (19:18 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 14 Oct 2009 15:18:43 +0000 (19:18 +0400)
src/plugins/lua/forged_recipients.lua

index d3463daae02069f51e5eb7cefcd54b25124059f1..82f53dd73d5fa59fac5ef944d3096e4d6ef567a9 100644 (file)
@@ -21,11 +21,15 @@ function check_forged_headers(task)
                        count = count + table.maxn(mime_cc)
                end
                -- Check recipients count
-               if count <= table.maxn(smtp_rcpt) then
+               if count < table.maxn(smtp_rcpt) then
                        task:insert_result(metric, symbol_rcpt, 1)
                else
                        -- Find pair for each smtp recipient recipient in To or Cc headers
                        for _,sr in ipairs(smtp_rcpt) do
+                               if string.byte(sr, 1) == string.byte('<') then
+                                       -- Trim brackets
+                                       sr = string.sub(sr, 2, -2)
+                               end
                                if mime_rcpt then
                                        for _,mr in ipairs(mime_rcpt) do
                                                if string.find(mr, sr) then