diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-27 13:39:26 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-27 13:39:26 +0000 |
commit | 6176ad586b6c312b49d70c2917e38b1d851bda92 (patch) | |
tree | 3a4594057890d4ed2ab663ef73bb3d571c362df4 /src/libmime | |
parent | 2b9068e5f79b444977c007eff37c9749d1e3b3bb (diff) | |
download | rspamd-6176ad586b6c312b49d70c2917e38b1d851bda92.tar.gz rspamd-6176ad586b6c312b49d70c2917e38b1d851bda92.zip |
[Feature] Add ignore_received option
In this mode rspamd ignores data from the first received (it might be
produced by some third party and not our MTA)
Diffstat (limited to 'src/libmime')
-rw-r--r-- | src/libmime/message.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c index 0daa5d880..a843f3836 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -1690,7 +1690,7 @@ rspamd_message_parse (struct rspamd_task *task) 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) { @@ -1731,7 +1731,8 @@ rspamd_message_parse (struct rspamd_task *task) } /* 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, |