diff -urN src.orig/plugins/lua/forged_recipients.lua src/plugins/lua/forged_recipients.lua --- src.orig/plugins/lua/forged_recipients.lua 2011-02-02 15:31:06.000000000 +0200 +++ src/plugins/lua/forged_recipients.lua 2011-02-15 10:45:15.000000000 +0200 @@ -31,7 +31,19 @@ end if mime_rcpt then for _,mr in ipairs(mime_rcpt) do - if string.find(mr, sr) then +------ if string.find(mr, sr) then +---- if string.find(string.lower(mr), string.lower(sr), 1, true) then +-- local addr = string.match(mr, '<(.+?)>') +-- if addr then mr = addr end + local i = string.find(mr, '<', 1, true) + if i then + local j = string.find(mr, '>', i, true) + if j then + mr = string.sub(mr, i+1, j-1) + end + end + + if string.lower(mr) == string.lower(sr) then res = true break end @@ -39,7 +51,18 @@ end if mime_cc then for _,mr in ipairs(mime_cc) do - if string.find(mr, sr) then +------ if string.find(mr, sr) then +---- if string.find(string.lower(mr), string.lower(sr), 1, true) then +-- local addr = string.match(mr, '<(.+?)>') +-- if addr then mr = addr end + local i = string.find(mr, '<', 1, true) + if i then + local j = string.find(mr, '>', i, true) + if j then + mr = string.sub(mr, i+1, j-1) + end + end + if string.lower(mr) == string.lower(sr) then res = true break end @@ -57,7 +80,18 @@ local smtp_from = task:get_from() if smtp_form then local mime_from = msg:get_header('From') - if not mime_from or not string.find(mime_from[0], smtp_from) then +------ if not mime_from or not string.find(mime_from[0], smtp_from) then +---- if not mime_from or not string.find(string.lower(mime_from[0]), string.lower(smtp_from), 1, true) then +-- local addr = string.match(mime_from[0], '<(.+?)>') +-- if addr then mime_from[0] = addr end + local i = string.find(mime_from[0], '<', 1, true) + if i then + local j = string.find(mime_from[0], '>', i, true) + if j then + mime_from[0] = string.sub(mime_from[0], i+1, j-1) + end + end + if not mime_from or not (string.lower(mime_from[0]) == string.lower(smtp_from)) then task:insert_result(symbol_sender, 1) end end