From: Vsevolod Stakhov Date: Wed, 22 Jun 2016 11:20:38 +0000 (+0100) Subject: [Fix] Disable multiple autolearn checks X-Git-Tag: 1.3.0~284 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a09c608e4ccc7c9c83f54cd938ee0f31e76f0e5;p=thirdparty%2Frspamd.git [Fix] Disable multiple autolearn checks Issue: #674 Reported by: @moisseev --- diff --git a/src/libserver/task.c b/src/libserver/task.c index f8ebe81f18..0f954ad341 100644 --- a/src/libserver/task.c +++ b/src/libserver/task.c @@ -604,7 +604,8 @@ rspamd_task_process (struct rspamd_task *task, guint stages) case RSPAMD_TASK_STAGE_POST_FILTERS: rspamd_lua_call_post_filters (task); if ((task->flags & RSPAMD_TASK_FLAG_LEARN_AUTO) && - !RSPAMD_TASK_IS_EMPTY (task)) { + !RSPAMD_TASK_IS_EMPTY (task) && + !(task->flags & (RSPAMD_TASK_FLAG_LEARN_SPAM|RSPAMD_TASK_FLAG_LEARN_HAM))) { rspamd_stat_check_autolearn (task); } break; @@ -622,6 +623,9 @@ rspamd_task_process (struct rspamd_task *task, guint stages) if (!(task->flags & RSPAMD_TASK_FLAG_LEARN_AUTO)) { task->err = stat_error; } + else if (stat_error) { + g_error_free (stat_error); + } msg_err_task ("learn error: %e", stat_error); task->processed_stages |= RSPAMD_TASK_STAGE_DONE;