summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-05-30 14:23:22 +0100
committerGitHub <noreply@github.com>2017-05-30 14:23:22 +0100
commit315a73241aee8363b8494616293c3dabc828e876 (patch)
tree98fa138203e3976a4ed0f409865902062ae0fae5
parentea4b010734ca734804a0a4520b8b4720db59f10b (diff)
parent7a15bd172cc671dc3b36872850d18a2d3f5b2465 (diff)
downloadrspamd-315a73241aee8363b8494616293c3dabc828e876.tar.gz
rspamd-315a73241aee8363b8494616293c3dabc828e876.zip
Merge pull request #1658 from julienschmidt/master
[Minor] Validate assumed spoofed display name domains to contain a dot
-rw-r--r--rules/misc.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/rules/misc.lua b/rules/misc.lua
index fff5d04cc..509a56e67 100644
--- a/rules/misc.lua
+++ b/rules/misc.lua
@@ -515,13 +515,12 @@ local check_from_display_name = rspamd_config:register_symbol{
-- Be careful with undisclosed-recipients:; as domain will be an empty string
if to[1]['domain'] ~= '' and util.strequal_caseless(to[1]['domain'], parsed[1]['domain']) then
task:insert_result('SPOOF_DISPLAY_NAME', 1.0, from[1]['domain'], parsed[1]['domain'])
- else
- task:insert_result('FROM_NEQ_DISPLAY_NAME', 1.0, from[1]['domain'], parsed[1]['domain'])
+ return false
end
- return false
- else
- task:insert_result('FROM_NEQ_DISPLAY_NAME', 1.0, from[1]['domain'], parsed[1]['domain'])
end
+ -- Make sure we did not mistake e.g. <something>@<name> for an email address
+ if not parsed[1]['domain']:find('%.') then return false end
+ task:insert_result('FROM_NEQ_DISPLAY_NAME', 1.0, from[1]['domain'], parsed[1]['domain'])
end
return false
end,