guint32 scan_milliseconds; /**< how much milliseconds passed */
gboolean view_checked;
gboolean pass_all_filters; /**< pass task throught every rule */
+ gboolean no_log; /**< do not log or write this task to the history */
guint32 parser_recursion; /**< for avoiding recursion stack overflow */
gboolean (*fin_callback)(void *arg); /**< calback for filters finalizing */
void *fin_arg; /**< argument for fin callback */
#define JSON_HEADER "Json"
#define HOSTNAME_HEADER "Hostname"
#define DELIVER_TO_HEADER "Deliver-To"
+#define NO_LOG_HEADER "Log"
static GList *custom_commands = NULL;
res = FALSE;
}
break;
+ case 'l':
+ case 'L':
+ if (g_ascii_strcasecmp (headern, NO_LOG_HEADER) == 0) {
+ if (g_ascii_strcasecmp (h->value->str, "no") == 0) {
+ task->no_log = TRUE;
+ }
+ }
+ else {
+ res = FALSE;
+ }
+ break;
default:
debug_task ("wrong header: %s", headern);
res = FALSE;
rspamd_printf_gstring (logbuf, "user: %s, ", task->user);
}
- rspamd_roll_history_update (task->worker->srv->history, task);
+ if (!task->no_log) {
+ rspamd_roll_history_update (task->worker->srv->history, task);
+ }
g_hash_table_iter_init (&hiter, task->results);
/* Convert results to an ucl object */
top = ucl_object_insert_key (top, ucl_object_fromstring (task->message_id), "message-id", 0, false);
write_hashes_to_log (task, logbuf);
- msg_info ("%v", logbuf);
+ if (!task->no_log) {
+ msg_info ("%v", logbuf);
+ }
g_string_free (logbuf, TRUE);
msg->body = g_string_sized_new (BUFSIZ);