if (i == 0) {
gboolean need_recv_correction = FALSE;
- if (recv->real_ip == NULL) {
+ if (recv->real_ip == NULL || task->cfg->ignore_received) {
need_recv_correction = TRUE;
}
else if (!(task->flags & RSPAMD_TASK_FLAG_NO_IP) && task->from_addr) {
}
/* Extract data from received header if we were not given IP */
- if (task->received->len > 0 && (task->flags & RSPAMD_TASK_FLAG_NO_IP)) {
+ if (task->received->len > 0 && (task->flags & RSPAMD_TASK_FLAG_NO_IP) &&
+ !task->cfg->ignore_received) {
recv = g_ptr_array_index (task->received, 0);
if (recv->real_ip) {
if (!rspamd_parse_inet_address (&task->from_addr,
gboolean allow_raw_input; /**< scan messages with invalid mime */
gboolean disable_hyperscan; /**< disable hyperscan usage */
gboolean enable_shutdown_workaround; /**< enable workaround for legacy SA clients (exim) */
+ gboolean ignore_received; /**< Ignore data from the first received header */
gsize max_diff; /**< maximum diff size for text parts */
gsize max_cores_size; /**< maximum size occupied by rspamd core files */
G_STRUCT_OFFSET (struct rspamd_config, enable_shutdown_workaround),
0,
"Enable workaround for legacy clients");
+ rspamd_rcl_add_default_handler (sub,
+ "ignore_received",
+ rspamd_rcl_parse_struct_boolean,
+ G_STRUCT_OFFSET (struct rspamd_config, ignore_received),
+ 0,
+ "Ignore data from the first received header");
/* New DNS configuration */
ssub = rspamd_rcl_add_section_doc (&sub->subsections, "dns", NULL, NULL,
UCL_OBJECT, FALSE, TRUE,