diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-13 19:15:22 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-13 19:16:10 +0100 |
commit | a7a8f2c9187288e7cedd48c8faa9cf5773bfc90b (patch) | |
tree | c44abf6d5b18e545ff054bf87ad7f52bc1177f39 /src | |
parent | af089efeeae85030400beb88f69ecd9ef3d6139d (diff) | |
download | rspamd-a7a8f2c9187288e7cedd48c8faa9cf5773bfc90b.tar.gz rspamd-a7a8f2c9187288e7cedd48c8faa9cf5773bfc90b.zip |
[Fix] Fix processing of idempotent rules when autolearn fails
Issue: #1846
Diffstat (limited to 'src')
-rw-r--r-- | src/libserver/task.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/libserver/task.c b/src/libserver/task.c index 4aa2e21ad..04ce2b759 100644 --- a/src/libserver/task.c +++ b/src/libserver/task.c @@ -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; + } } } } |