aboutsummaryrefslogtreecommitdiffstats
path: root/src/filter.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-15 19:20:45 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-15 19:20:45 +0400
commit205cb6049d86f74707949ac6a3b2de64afe2850a (patch)
tree0c40e3ee9b10f2fab59f873d005dc4f966ec4d04 /src/filter.h
parentecbbd935773673d8df1f2cb8334b447f7b834b5a (diff)
downloadrspamd-205cb6049d86f74707949ac6a3b2de64afe2850a.tar.gz
rspamd-205cb6049d86f74707949ac6a3b2de64afe2850a.zip
* Add ability to assign several actions to one metric
* Report action in rspamc protocol * Mail::Rspamd::Client and rspamc can now understand Action header too * Write action to log as well
Diffstat (limited to 'src/filter.h')
-rw-r--r--src/filter.h37
1 files changed, 23 insertions, 14 deletions
diff --git a/src/filter.h b/src/filter.h
index 24feaae9e..7996f16e6 100644
--- a/src/filter.h
+++ b/src/filter.h
@@ -33,24 +33,33 @@ struct symbol {
GList *options; /**< list of symbol's options */
};
+enum rspamd_metric_action {
+ METRIC_ACTION_REJECT = 0,
+ METRIC_ACTION_SOFT_REJECT,
+ METRIC_ACTION_REWRITE_SUBJECT,
+ METRIC_ACTION_ADD_HEADER,
+ METRIC_ACTION_GREYLIST,
+ METRIC_ACTION_NOACTION
+};
+
+struct metric_action {
+ enum rspamd_metric_action action;
+ gdouble score;
+};
+
/**
* Common definition of metric
*/
struct metric {
- char *name; /**< name of metric */
- char *func_name; /**< name of consolidation function */
- metric_cons_func func; /**< c consolidation function */
- double grow_factor; /**< grow factor for metric */
- double required_score; /**< required score for this metric */
- double reject_score; /**< reject score for this metric */
- GHashTable *symbols; /**< weights of symbols in metric */
- enum {
- METRIC_ACTION_REJECT = 0,
- METRIC_ACTION_SOFT_REJECT,
- METRIC_ACTION_REWRITE_SUBJECT,
- METRIC_ACTION_ADD_HEADER,
- METRIC_ACTION_GREYLIST
- } action; /**< action to do by this metric */
+ char *name; /**< name of metric */
+ char *func_name; /**< name of consolidation function */
+ metric_cons_func func; /**< c consolidation function */
+ double grow_factor; /**< grow factor for metric */
+ double required_score; /**< required score for this metric */
+ double reject_score; /**< reject score for this metric */
+ GHashTable *symbols; /**< weights of symbols in metric */
+ enum rspamd_metric_action action; /**< action to do by this metric by default */
+ GList *actions; /**< actions that can be performed by this metric */
};
/**