g_queue_push_tail ((o), nh); \
} while (0)
+#define ADD_CLIENT_FLAG(str, n) do { \
+ g_string_append ((str), (n)); \
+} while (0)
+
static gboolean rspamc_password_callback (const gchar *option_name,
const gchar *value,
gpointer data,
{
GString *numbuf;
gchar **hdr, **rcpt;
+ GString *flagbuf = g_string_new (NULL);
if (ip != NULL) {
rspamd_inet_addr_t *addr = NULL;
}
if (pass_all) {
- ADD_CLIENT_HEADER (opts, "Pass", "all");
+ ADD_CLIENT_FLAG (flagbuf, "pass_all");
}
if (classifier) {
}
if (profile) {
- ADD_CLIENT_HEADER (opts, "Profile", "true");
+ ADD_CLIENT_FLAG (flagbuf, "profile");
}
if (skip_images) {
hdr ++;
}
+
+ if (flagbuf->len > 0) {
+ goffset last = flagbuf->len - 1;
+
+ if (flagbuf->str[last] == ',') {
+ flagbuf->str[last] = '\0';
+ flagbuf->len --;
+ }
+
+ ADD_CLIENT_HEADER (opts, "Flags", flagbuf->str);
+ }
+
+ g_string_free (flagbuf, TRUE);
}
static void
CHECK_TASK_FLAG("skip", RSPAMD_TASK_FLAG_NO_LOG);
CHECK_TASK_FLAG("no_stat", RSPAMD_TASK_FLAG_NO_STAT);
CHECK_TASK_FLAG("ssl", RSPAMD_TASK_FLAG_SSL);
+ CHECK_TASK_FLAG("profile", RSPAMD_TASK_FLAG_PROFILE);
CHECK_PROTOCOL_FLAG("milter", RSPAMD_TASK_PROTOCOL_FLAG_MILTER);
CHECK_PROTOCOL_FLAG("zstd", RSPAMD_TASK_PROTOCOL_FLAG_COMPRESSED);