va_list ap;
guchar cmd, *pos;
rspamd_fstring_t *reply = NULL;
+ gsize len;
GString *name, *value;
+ const char *reason;
struct rspamd_milter_outbuf *obuf;
struct rspamd_milter_private *priv = session->priv;
/* No additional arguments */
SET_COMMAND (cmd, 0, reply, pos);
break;
+ case RSPAMD_MILTER_QUARANTINE:
+ reason = va_arg (ap, const char *);
+
+ if (reason == NULL) {
+ reason = "";
+ }
+
+ len = strlen (reason);
+ SET_COMMAND (cmd, len + 1, reply, pos);
+ memcpy (pos, reason, len + 1);
+ break;
case RSPAMD_MILTER_ADDHEADER:
name = va_arg (ap, GString *);
value = va_arg (ap, GString *);
rspamd_milter_send_action (session, RSPAMD_MILTER_DISCARD);
}
else if (priv->quarantine_on_reject) {
- /* TODO: need to add quarantine message */
- rspamd_milter_send_action (session, RSPAMD_MILTER_QUARANTINE);
+ /* TODO: be more flexible about SMTP messages */
+ rspamd_milter_send_action (session, RSPAMD_MILTER_QUARANTINE,
+ RSPAMD_MILTER_QUARANTINE_MESSAGE);
}
else {
rcode = rspamd_fstring_new_init (RSPAMD_MILTER_RCODE_REJECT,
#define RSPAMD_MILTER_XCODE_REJECT "5.7.1"
#define RSPAMD_MILTER_XCODE_TEMPFAIL "4.7.1"
#define RSPAMD_MILTER_REJECT_MESSAGE "Spam message rejected"
+#define RSPAMD_MILTER_QUARANTINE_MESSAGE "Spam message quarantined"
#define RSPAMD_MILTER_TEMPFAIL_MESSAGE "Try again later"
#define RSPAMD_MILTER_SPAM_HEADER "X-Spam"
#define RSPAMD_MILTER_DKIM_HEADER "DKIM-Signature"