commit b640dd7: [Minor] Add special flag to continue filters processing on passthrough result

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Oct 15 11:56:07 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-10-15 12:29:57 +0100
URL: https://github.com/rspamd/rspamd/commit/b640dd764eae28ba67d1977196a46ca98d3de66b

[Minor] Add special flag to continue filters processing on passthrough result

---
 src/libmime/scan_result.h | 1 +
 src/lua/lua_task.c        | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/libmime/scan_result.h b/src/libmime/scan_result.h
index edba4d491..d82699a91 100644
--- a/src/libmime/scan_result.h
+++ b/src/libmime/scan_result.h
@@ -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;
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 6a904352f..2bf833681 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -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);


More information about the Commits mailing list