Browse Source

Fix forged recipients plugin for the modern rspamd.

tags/0.9.0
Vsevolod Stakhov 9 years ago
parent
commit
a7e832b5dd
1 changed files with 6 additions and 14 deletions
  1. 6
    14
      src/plugins/lua/forged_recipients.lua

+ 6
- 14
src/plugins/lua/forged_recipients.lua View File

@@ -27,10 +27,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-- Plugin for comparing smtp dialog recipients and sender with recipients and sender
-- in mime headers

local logger = require "rspamd_logger"
local symbol_rcpt = 'FORGED_RECIPIENTS'
local symbol_sender = 'FORGED_SENDER'

function check_forged_headers(task)
local function check_forged_headers(task)
local smtp_rcpt = task:get_recipients(1)
local res = false
@@ -85,21 +86,12 @@ if opts then
if opts['symbol_rcpt'] or opts['symbol_sender'] then
if opts['symbol_rcpt'] then
symbol_rcpt = opts['symbol_rcpt']
if type(rspamd_config.get_api_version) ~= 'nil' then
rspamd_config:register_virtual_symbol(symbol_rcpt, 1.0, 'check_forged_headers')
end
rspamd_config:register_virtual_symbol(symbol_rcpt, 1.0, check_forged_headers)
end
if opts['symbol_sender'] then
symbol_sender = opts['symbol_sender']
if type(rspamd_config.get_api_version) ~= 'nil' then
rspamd_config:register_virtual_symbol(symbol_sender, 1.0)
end
rspamd_config:register_virtual_symbol(symbol_sender, 1.0)
end
if type(rspamd_config.get_api_version) ~= 'nil' then
rspamd_config:register_callback_symbol('FORGED_RECIPIENTS', 1.0, 'check_forged_headers')
else
rspamd_config:register_symbol('FORGED_RECIPIENTS', 1.0, 'check_forged_headers')
end
rspamd_config:register_callback_symbol('FORGED_RECIPIENTS', 1.0, check_forged_headers)
end
end
end

Loading…
Cancel
Save