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)
{
* 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
}
for (i = 0; i < METRIC_ACTION_MAX; i++) {
- elt = ucl_object_lookup (act, rspamd_action_to_str (i));
+ elt = ucl_object_lookup_any (act, rspamd_action_to_str (i),
+ rspamd_action_to_str_alt (i), NULL);
if (elt) {
mres->actions_limits[i] = ucl_object_todouble (elt);