]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Header checks: REPLYTO_UNPARSEABLE rule
authorAndrew Lewis <nerf@judo.za.org>
Mon, 10 Jul 2017 16:47:15 +0000 (18:47 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Mon, 10 Jul 2017 16:47:15 +0000 (18:47 +0200)
rules/headers_checks.lua

index d8c8c039c3f2289c4f01b6493016d4af8bc97593..7932afc9061f44dbf18eb81a1aa8013722e7b66a 100644 (file)
@@ -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