From 0ce0e854ccf8637f99370b9dd5c8322bd9ef9b76 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 14 Oct 2009 19:18:43 +0400 Subject: * Trim brackets in forged recipients plugin --- src/plugins/lua/forged_recipients.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/lua/forged_recipients.lua b/src/plugins/lua/forged_recipients.lua index d3463daae..82f53dd73 100644 --- a/src/plugins/lua/forged_recipients.lua +++ b/src/plugins/lua/forged_recipients.lua @@ -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 -- cgit v1.2.3