From: Andrew Lewis Date: Mon, 10 Jul 2017 16:47:15 +0000 (+0200) Subject: [Fix] Header checks: REPLYTO_UNPARSEABLE rule X-Git-Tag: 1.6.3~3^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=26f2916dd3cb4df2f50a657131e543806183dd2b;p=thirdparty%2Frspamd.git [Fix] Header checks: REPLYTO_UNPARSEABLE rule --- diff --git a/rules/headers_checks.lua b/rules/headers_checks.lua index d8c8c039c3..7932afc906 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