Browse Source

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

tags/2.7
Vsevolod Stakhov 3 years ago
parent
commit
b640dd764e
2 changed files with 5 additions and 1 deletions
  1. 1
    0
      src/libmime/scan_result.h
  2. 4
    1
      src/lua/lua_task.c

+ 1
- 0
src/libmime/scan_result.h View 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;

+ 4
- 1
src/lua/lua_task.c View 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);

Loading…
Cancel
Save