aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-21 09:14:36 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-21 09:14:36 +0100
commit9f7ac8960eb18e4cc152cd52f102f621010b9c36 (patch)
tree1a4444540568e11093bdb849e41e2e61e7834f07 /src/libmime
parentc90ebed0c331c71f57eda2d2dcf092e95cdaae45 (diff)
downloadrspamd-9f7ac8960eb18e4cc152cd52f102f621010b9c36.tar.gz
rspamd-9f7ac8960eb18e4cc152cd52f102f621010b9c36.zip
[Feature] Allow underscore separated names in settings
Diffstat (limited to 'src/libmime')
-rw-r--r--src/libmime/filter.c23
-rw-r--r--src/libmime/filter.h1
2 files changed, 24 insertions, 0 deletions
diff --git a/src/libmime/filter.c b/src/libmime/filter.c
index 6aaa19aaf..5b998406f 100644
--- a/src/libmime/filter.c
+++ b/src/libmime/filter.c
@@ -330,6 +330,29 @@ rspamd_action_to_str (enum rspamd_metric_action action)
return "unknown action";
}
+const gchar *
+rspamd_action_to_str_alt (enum rspamd_metric_action action)
+{
+ switch (action) {
+ case METRIC_ACTION_REJECT:
+ return "reject";
+ case METRIC_ACTION_SOFT_REJECT:
+ return "soft_reject";
+ case METRIC_ACTION_REWRITE_SUBJECT:
+ return "rewrite_subject";
+ case METRIC_ACTION_ADD_HEADER:
+ return "add_header";
+ case METRIC_ACTION_GREYLIST:
+ return "greylist";
+ case METRIC_ACTION_NOACTION:
+ return "no action";
+ case METRIC_ACTION_MAX:
+ return "invalid max action";
+ }
+
+ return "unknown action";
+}
+
enum rspamd_metric_action
rspamd_check_action_metric (struct rspamd_task *task, struct metric_result *mres)
{
diff --git a/src/libmime/filter.h b/src/libmime/filter.h
index 280c54879..6c61f5d6f 100644
--- a/src/libmime/filter.h
+++ b/src/libmime/filter.h
@@ -93,6 +93,7 @@ gboolean rspamd_action_from_str (const gchar *data, gint *result);
* Return textual representation of action enumeration
*/
const gchar * rspamd_action_to_str (enum rspamd_metric_action action);
+const gchar * rspamd_action_to_str_alt (enum rspamd_metric_action action);
/*
* Get action for specific metric