From 96f30a7662a6702c75474b04fa46bff0300fba19 Mon Sep 17 00:00:00 2001 From: Dmitriy Alekseev <1865999+dragoangel@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:33:48 +0200 Subject: do not allow empty from --- src/plugins/lua/elastic.lua | 16 ++++++++-------- 1 file 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, -- cgit v1.2.3