From 9f76a30c016b55103f443bc6858f6b557cc5eb36 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 16 Jan 2016 22:43:16 +0000 Subject: [PATCH] Don't write URLs by default as it is too verbose --- src/libserver/protocol.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index 35a74208f..e3f39899c 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -977,13 +977,16 @@ rspamd_protocol_write_ucl (struct rspamd_task *task) ucl_object_insert_key (top, rspamd_str_list_ucl ( task->messages), "messages", 0, false); } - if (g_hash_table_size (task->urls) > 0) { - ucl_object_insert_key (top, rspamd_urls_tree_ucl (task->urls, - task), "urls", 0, false); - } - if (g_hash_table_size (task->emails) > 0) { - ucl_object_insert_key (top, rspamd_emails_tree_ucl (task->emails, task), - "emails", 0, false); + + if (task->cfg->log_urls || (task->flags & RSPAMD_TASK_FLAG_EXT_URLS)) { + if (g_hash_table_size (task->urls) > 0) { + ucl_object_insert_key (top, rspamd_urls_tree_ucl (task->urls, + task), "urls", 0, false); + } + if (g_hash_table_size (task->emails) > 0) { + ucl_object_insert_key (top, rspamd_emails_tree_ucl (task->emails, task), + "emails", 0, false); + } } ucl_object_insert_key (top, ucl_object_fromstring (task->message_id), -- 2.39.5