diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2022-01-29 12:27:41 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2022-01-29 12:27:41 +0000 |
commit | bb5e5fb4149df13488fa04623a50eca3ada13f7e (patch) | |
tree | 7410848ae7e4f2fb2f482743b258cae69f5b87f1 /src/libmime/scan_result.h | |
parent | b1c259630635d5cf262cc942e1faada1616da36f (diff) | |
download | rspamd-bb5e5fb4149df13488fa04623a50eca3ada13f7e.tar.gz rspamd-bb5e5fb4149df13488fa04623a50eca3ada13f7e.zip |
[Rework] Allow to set a different behaviour for actions from settings
Issue: #4025
Diffstat (limited to 'src/libmime/scan_result.h')
-rw-r--r-- | src/libmime/scan_result.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/libmime/scan_result.h b/src/libmime/scan_result.h index c8bacf3e8..2f982fd1b 100644 --- a/src/libmime/scan_result.h +++ b/src/libmime/scan_result.h @@ -66,8 +66,15 @@ struct rspamd_passthrough_result { struct rspamd_passthrough_result *prev, *next; }; -struct rspamd_action_result { + +enum rspamd_action_config_flags { + RSPAMD_ACTION_RESULT_DEFAULT = 0, + RSPAMD_ACTION_RESULT_NO_THRESHOLD = (1u << 0u), + RSPAMD_ACTION_RESULT_DISABLED = (1u << 1u), +}; +struct rspamd_action_config { gdouble cur_limit; + int flags; struct rspamd_action *action; }; @@ -83,7 +90,7 @@ struct rspamd_scan_result { double negative_score; struct kh_rspamd_symbols_hash_s *symbols; /**< symbols of metric */ struct kh_rspamd_symbols_group_hash_s *sym_groups; /**< groups of symbols */ - struct rspamd_action_result *actions_limits; + struct rspamd_action_config *actions_config; const gchar *name; /**< for named results, NULL is the default result */ struct rspamd_task *task; /**< back reference */ gint symbol_cbref; /**< lua function that defines if a symbol can be inserted, -1 if unused */ @@ -121,7 +128,7 @@ struct rspamd_scan_result *rspamd_find_metric_result (struct rspamd_task *task, * @param message * @param module */ -void rspamd_add_passthrough_result (struct rspamd_task *task, +bool rspamd_add_passthrough_result (struct rspamd_task *task, struct rspamd_action *action, guint priority, double target_score, const gchar *message, const gchar *module, guint flags, |