diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-03 11:40:46 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-03 11:40:46 +0000 |
commit | b3c3972a16c6c81bd755af6b898c535478a0a223 (patch) | |
tree | 731175d1fa75d3b73e2fb4e6ecde73276747b708 | |
parent | 32dda672d0d2013f8bc4e0730296e8a9ddaa2401 (diff) | |
download | rspamd-b3c3972a16c6c81bd755af6b898c535478a0a223.tar.gz rspamd-b3c3972a16c6c81bd755af6b898c535478a0a223.zip |
Skip SPF from local addresses
Issue: #469
-rw-r--r-- | src/libutil/addr.c | 4 | ||||
-rw-r--r-- | src/plugins/spf.c | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/libutil/addr.c b/src/libutil/addr.c index 747ac869e..f301c724e 100644 --- a/src/libutil/addr.c +++ b/src/libutil/addr.c @@ -1334,7 +1334,9 @@ rspamd_inet_address_equal (gconstpointer a, gconstpointer b) gboolean rspamd_inet_address_is_local (const rspamd_inet_addr_t *addr) { - g_assert (addr != NULL); + if (addr == NULL) { + return FALSE; + } if (addr->af == AF_UNIX) { /* Always true for unix sockets */ diff --git a/src/plugins/spf.c b/src/plugins/spf.c index f672bf80d..c54c27215 100644 --- a/src/plugins/spf.c +++ b/src/plugins/spf.c @@ -357,7 +357,8 @@ spf_symbol_callback (struct rspamd_task *task, void *unused) return; } - if (task->user != NULL) { + if (task->user != NULL || rspamd_inet_address_is_local (task->from_addr)) { + msg_info_task ("skip SPF checks for local and authorized users"); return; } |