]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Don't write URLs by default as it is too verbose
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 16 Jan 2016 22:43:16 +0000 (22:43 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 16 Jan 2016 22:43:16 +0000 (22:43 +0000)
src/libserver/protocol.c

index 35a74208f911d1eaa1d57977b8dc6306e3cd808c..e3f39899c203c746d39c7f05edf30565dfc29a36 100644 (file)
@@ -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),