diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-10-14 19:18:43 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-10-14 19:18:43 +0400 |
commit | 0ce0e854ccf8637f99370b9dd5c8322bd9ef9b76 (patch) | |
tree | 9ad7d80de450ff5693d3adbbe15a4eff858db1af /src | |
parent | 9ebf3a1a948f328543101ff1d2ab0f7521de8963 (diff) | |
download | rspamd-0ce0e854ccf8637f99370b9dd5c8322bd9ef9b76.tar.gz rspamd-0ce0e854ccf8637f99370b9dd5c8322bd9ef9b76.zip |
* Trim brackets in forged recipients plugin
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/forged_recipients.lua | 6 |
1 files changed, 5 insertions, 1 deletions
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 |