From: Dmitriy Alekseev <1865999+dragoangel@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:33:48 +0000 (+0200) Subject: do not allow empty from X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=96f30a7662a6702c75474b04fa46bff0300fba19;p=rspamd.git do not allow empty from --- 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,