]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix processing of idempotent rules when autolearn fails
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 13 Oct 2017 18:15:22 +0000 (19:15 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 13 Oct 2017 18:16:10 +0000 (19:16 +0100)
Issue: #1846

src/libserver/task.c

index 4aa2e21ad243ee821b3b64d7315a25c8c533d1a8..04ce2b7599db29186047436e1f84e61c476a4024 100644 (file)
@@ -768,12 +768,18 @@ rspamd_task_process (struct rspamd_task *task, guint stages)
 
                                        if (!(task->flags & RSPAMD_TASK_FLAG_LEARN_AUTO)) {
                                                task->err = stat_error;
+                                               task->processed_stages |= RSPAMD_TASK_STAGE_DONE;
                                        }
-                                       else if (stat_error) {
-                                               g_error_free (stat_error);
-                                       }
+                                       else {
+                                               /* Do not skip idempotent in case of learn error */
+                                               if (stat_error) {
+                                                       g_error_free (stat_error);
+                                               }
 
-                                       task->processed_stages |= RSPAMD_TASK_STAGE_DONE;
+                                               task->processed_stages |= RSPAMD_TASK_STAGE_LEARN|
+                                                               RSPAMD_TASK_STAGE_LEARN_PRE|
+                                                               RSPAMD_TASK_STAGE_LEARN_POST;
+                                       }
                                }
                        }
                }