diff options
author | Julien Schmidt <git@julienschmidt.com> | 2017-05-30 19:32:12 +0800 |
---|---|---|
committer | Julien Schmidt <git@julienschmidt.com> | 2017-05-30 19:32:12 +0800 |
commit | 7a15bd172cc671dc3b36872850d18a2d3f5b2465 (patch) | |
tree | 98fa138203e3976a4ed0f409865902062ae0fae5 /rules | |
parent | ea4b010734ca734804a0a4520b8b4720db59f10b (diff) | |
download | rspamd-7a15bd172cc671dc3b36872850d18a2d3f5b2465.tar.gz rspamd-7a15bd172cc671dc3b36872850d18a2d3f5b2465.zip |
[Minor] Validate assumed spoofed display name domains to contain a dot
A displayname of the form <something>@<name> might have been mistaken
for an email address
Diffstat (limited to 'rules')
-rw-r--r-- | rules/misc.lua | 9 |
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, |