]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Disable multiple autolearn checks
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 22 Jun 2016 11:20:38 +0000 (12:20 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 22 Jun 2016 11:20:38 +0000 (12:20 +0100)
Issue: #674
Reported by: @moisseev

src/libserver/task.c

index f8ebe81f18bf0deac3670e204121b350e8c35052..0f954ad34151fd5223637afbf7f1b11062f60d6a 100644 (file)
@@ -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;