METRIC_ACTION_NOACTION,
METRIC_ACTION_MAX,
METRIC_ACTION_CUSTOM = 999,
+ METRIC_ACTION_MILTER_DISCARD,
+ METRIC_ACTION_MILTER_QUARANTINE
};
enum rspamd_action_flags {
RSPAMD_ACTION_NO_THRESHOLD = (1u << 0),
RSPAMD_ACTION_THRESHOLD_ONLY = (1u << 1),
RSPAMD_ACTION_HAM = (1u << 2),
+ RSPAMD_ACTION_MILTER = (1u << 3),
};
}
}
}
+
+ elt = ucl_object_lookup (obj, "milter");
+
+ if (elt) {
+ const gchar *milter_action = ucl_object_tostring (elt);
+
+ if (strcmp (milter_action, "discard") == 0) {
+ flags |= RSPAMD_ACTION_MILTER;
+ act->action_type = METRIC_ACTION_MILTER_DISCARD;
+ }
+ else if (strcmp (milter_action, "quarantine") == 0) {
+ flags |= RSPAMD_ACTION_MILTER;
+ act->action_type = METRIC_ACTION_MILTER_QUARANTINE;
+ }
+ else {
+ msg_warn_config ("unknown milter action: %s", milter_action);
+ }
+ }
}
else if (obj_type == UCL_FLOAT || obj_type == UCL_INT) {
threshold = ucl_object_todouble (obj);
act->threshold = threshold;
act->flags = flags;
- if (rspamd_action_from_str (act->name, &std_act)) {
- act->action_type = std_act;
- }
- else {
- act->action_type = METRIC_ACTION_CUSTOM;
+ if (!(flags & RSPAMD_ACTION_MILTER)) {
+ if (rspamd_action_from_str (act->name, &std_act)) {
+ act->action_type = std_act;
+ } else {
+ act->action_type = METRIC_ACTION_CUSTOM;
+ }
}
return TRUE;