aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitriy Alekseev <1865999+dragoangel@users.noreply.github.com>2024-10-21 13:33:48 +0200
committerDmitriy Alekseev <1865999+dragoangel@users.noreply.github.com>2024-10-21 14:09:16 +0200
commit96f30a7662a6702c75474b04fa46bff0300fba19 (patch)
treef2ec05268431f5a3b7acedf84c3bc5749ad844cc
parentaf7e5e4b3567a93e42e70de33e46e6e67792553a (diff)
downloadrspamd-96f30a7662a6702c75474b04fa46bff0300fba19.tar.gz
rspamd-96f30a7662a6702c75474b04fa46bff0300fba19.zip
do not allow empty from
-rw-r--r--src/plugins/lua/elastic.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/lua/elastic.lua b/src/plugins/lua/elastic.lua
index c1935b1f0..ea6d069c2 100644
--- a/src/plugins/lua/elastic.lua
+++ b/src/plugins/lua/elastic.lua
@@ -518,23 +518,23 @@ local function get_general_metadata(task)
r.rcpt = empty
end
- r.from_domain = empty
r.from_user = empty
+ r.from_domain = empty
if task:has_from('smtp') then
local from = task:get_from({ 'smtp', 'orig' })[1]
if from then
- r.from_user = from['user']
- r.from_domain = from['domain']:lower()
+ r.from_user = from['user'] or empty
+ r.from_domain = from['domain']:lower() or empty
end
end
- r.mime_from_domain = empty
r.mime_from_user = empty
+ r.mime_from_domain = empty
if task:has_from('mime') then
local mime_from = task:get_from({ 'mime', 'orig' })[1]
if mime_from then
- r.mime_from_user = mime_from['user']
- r.mime_from_domain = mime_from['domain']:lower()
+ r.mime_from_user = mime_from['user'] or empty
+ r.mime_from_domain = mime_from['domain']:lower() or empty
end
end
@@ -1267,10 +1267,10 @@ local function configure_index_template(cfg, ev_base)
sender_ip = t_ip,
message_id = t_text_with_keyword,
rcpt = t_text_with_keyword,
- from_domain = t_keyword,
from_user = t_keyword,
- mime_from_domain = t_keyword,
+ from_domain = t_keyword,
mime_from_user = t_keyword,
+ mime_from_domain = t_keyword,
settings_id = t_keyword,
asn = asn_obj,
scan_time = t_float,