diff options
author | Andrew Lewis <nerf@judo.za.org> | 2017-07-10 18:47:15 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2017-07-10 18:47:15 +0200 |
commit | cfc78aeb4a7fe473a27e025facd29dfde2bf5d6d (patch) | |
tree | f4b41ad0b245a9e0a276bb0ba8ca792d568cf180 /rules | |
parent | 39cf5ce1d8cd5b08d5f73b561600a4a586470192 (diff) | |
download | rspamd-cfc78aeb4a7fe473a27e025facd29dfde2bf5d6d.tar.gz rspamd-cfc78aeb4a7fe473a27e025facd29dfde2bf5d6d.zip |
[Fix] Header checks: REPLYTO_UNPARSEABLE rule
Diffstat (limited to 'rules')
-rw-r--r-- | rules/headers_checks.lua | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/rules/headers_checks.lua b/rules/headers_checks.lua index d8c8c039c..7932afc90 100644 --- a/rules/headers_checks.lua +++ b/rules/headers_checks.lua @@ -185,21 +185,19 @@ local check_replyto_id = rspamd_config:register_callback_symbol('CHECK_REPLYTO', local replyto = get_raw_header(task, 'Reply-To') if not replyto then return false end local rt = util.parse_mail_address(replyto) - if not (rt and rt[1]) then + if not (rt and rt[1] and (string.len(rt[1].addr) > 0)) then task:insert_result('REPLYTO_UNPARSEABLE', 1.0) return false else local rta = rt[1].addr task:insert_result('HAS_REPLYTO', 1.0, rta) - if rta then - -- Check if Reply-To address starts with title seen in display name - local sym = task:get_symbol('FROM_NAME_HAS_TITLE') - local title = (((sym or E)[1] or E).options or E)[1] - if title then - rta = rta:lower() - if rta:find('^' .. title) then - task:insert_result('REPLYTO_EMAIL_HAS_TITLE', 1.0) - end + -- Check if Reply-To address starts with title seen in display name + local sym = task:get_symbol('FROM_NAME_HAS_TITLE') + local title = (((sym or E)[1] or E).options or E)[1] + if title then + rta = rta:lower() + if rta:find('^' .. title) then + task:insert_result('REPLYTO_EMAIL_HAS_TITLE', 1.0) end end end |