priv->discard_on_reject = FALSE;
}
}
+
+ elt = ucl_object_lookup (obj, "no_action");
+
+ if (elt && ucl_object_type (elt) == UCL_BOOLEAN) {
+ priv->no_action = ucl_object_toboolean (elt);
+ }
}
if (action == METRIC_ACTION_ADD_HEADER) {
goto cleanup;
}
+ if (priv->no_action) {
+ msg_info_milter ("do not apply action %s, no_action is set",
+ str_action);
+ hname = g_string_new (RSPAMD_MILTER_ACTION_HEADER);
+ hvalue = g_string_new (str_action);
+
+ rspamd_milter_send_action (session, RSPAMD_MILTER_ADDHEADER,
+ hname, hvalue);
+ g_string_free (hname, TRUE);
+ g_string_free (hvalue, TRUE);
+ rspamd_milter_send_action (session, RSPAMD_MILTER_ACCEPT);
+
+ goto cleanup;
+ }
+
switch (action) {
case METRIC_ACTION_REJECT:
if (priv->discard_on_reject) {
enum rspamd_milter_io_state state;
int fd;
gboolean discard_on_reject;
+ gboolean no_action;
};
enum rspamd_milter_io_cmd {
#define RSPAMD_MILTER_TEMPFAIL_MESSAGE "Try again later"
#define RSPAMD_MILTER_SPAM_HEADER "X-Spam"
#define RSPAMD_MILTER_DKIM_HEADER "DKIM-Signature"
+#define RSPAMD_MILTER_ACTION_HEADER "X-Rspamd-Action"
#endif