struct rspamd_http_message *msg)
{
gchar *headern, *tmp;
- gboolean res = TRUE, validh, fl;
+ gboolean res = TRUE, validh, fl, has_ip = FALSE;
struct rspamd_http_header *h;
LL_FOREACH (msg->headers, h)
return FALSE;
}
debug_task ("read IP header, value: %s", tmp);
+ has_ip = TRUE;
}
else {
debug_task ("wrong header: %s", headern);
task->hostname = rspamd_mempool_strdup (task->task_pool, "unknown");
}
+ if (!has_ip) {
+ task->flags |= RSPAMD_TASK_FLAG_NO_IP;
+ }
+
return TRUE;
}
#define RSPAMD_TASK_FLAG_SPAMC (1 << 5)
#define RSPAMD_TASK_FLAG_PASS_ALL (1 << 6)
#define RSPAMD_TASK_FLAG_NO_LOG (1 << 7)
+#define RSPAMD_TASK_FLAG_NO_IP (1 << 8)
#define RSPAMD_TASK_IS_SKIPPED(task) (((task)->flags & RSPAMD_TASK_FLAG_SKIP))
#define RSPAMD_TASK_IS_JSON(task) (((task)->flags & RSPAMD_TASK_FLAG_JSON))
enum rspamd_command cmd; /**< command */
struct custom_command *custom_cmd; /**< custom command if any */
gint sock; /**< socket descriptor */
- gint flags;
+ guint flags;
gchar *helo; /**< helo header value */
gchar *queue_id; /**< queue id if specified */