]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Add special flag to continue filters processing on passthrough result
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Oct 2020 11:29:57 +0000 (12:29 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Oct 2020 11:50:20 +0000 (12:50 +0100)
src/libmime/scan_result.h
src/lua/lua_task.c

index edba4d491888e5f82dacc3222d7a7c704ed73c12..d82699a91a526bd575b70951d64b2140aab2f234 100644 (file)
@@ -53,6 +53,7 @@ struct rspamd_symbol_result {
 
 #define RSPAMD_PASSTHROUGH_LEAST (1u << 0u)
 #define RSPAMD_PASSTHROUGH_NO_SMTP_MESSAGE (1u << 1u)
+#define RSPAMD_PASSTHROUGH_PROCESS_ALL (1u << 2u)
 
 struct rspamd_passthrough_result {
        struct rspamd_action *action;
index 6a904352fc64dfd73d34bd4441532671f8d76d20..2bf833681ccb2ba8ea71a2d12e0ec871d7a3bb45 100644 (file)
@@ -2297,6 +2297,9 @@ lua_task_set_pre_result (lua_State * L)
                        else if (strstr (fl_str, "no_smtp_message") != NULL) {
                                flags |= RSPAMD_PASSTHROUGH_NO_SMTP_MESSAGE;
                        }
+                       else if (strstr (fl_str, "process_all") != NULL) {
+                               flags |= RSPAMD_PASSTHROUGH_PROCESS_ALL;
+                       }
                }
 
 
@@ -2311,7 +2314,7 @@ lua_task_set_pre_result (lua_State * L)
 
                /* Don't classify or filter message if pre-filter sets results */
 
-               if (res_name == NULL && !(flags & RSPAMD_PASSTHROUGH_LEAST)) {
+               if (res_name == NULL && !(flags & (RSPAMD_PASSTHROUGH_LEAST|RSPAMD_PASSTHROUGH_PROCESS_ALL))) {
                        task->processed_stages |= (RSPAMD_TASK_STAGE_CLASSIFIERS |
                                                                           RSPAMD_TASK_STAGE_CLASSIFIERS_PRE |
                                                                           RSPAMD_TASK_STAGE_CLASSIFIERS_POST);