aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-13 10:57:14 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-13 10:57:14 +0100
commita7e832b5dd9f11bb81ebbf593fa1ea786a5b5aa1 (patch)
tree37b999bb4cba9ff4ef732123e6cb0efe6af857d9
parent43b2606d44f014b16cc64603068253ee71d05e0c (diff)
downloadrspamd-a7e832b5dd9f11bb81ebbf593fa1ea786a5b5aa1.tar.gz
rspamd-a7e832b5dd9f11bb81ebbf593fa1ea786a5b5aa1.zip
Fix forged recipients plugin for the modern rspamd.
-rw-r--r--src/plugins/lua/forged_recipients.lua20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/plugins/lua/forged_recipients.lua b/src/plugins/lua/forged_recipients.lua
index b7f283cf8..6c553aa04 100644
--- a/src/plugins/lua/forged_recipients.lua
+++ b/src/plugins/lua/forged_recipients.lua
@@ -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 \ No newline at end of file