]> source.dussan.org Git - rspamd.git/commitdiff
Skip SPF from local addresses
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 3 Jan 2016 11:40:46 +0000 (11:40 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 3 Jan 2016 11:40:46 +0000 (11:40 +0000)
Issue: #469

src/libutil/addr.c
src/plugins/spf.c

index 747ac869efd27007e26a41a4b369828156446395..f301c724e3b19a5e1541453054214abb8ddaf9e6 100644 (file)
@@ -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 */
index f672bf80d56abdd2938189d52d3e7dc3a8afcd16..c54c2721568be6571f512d34cf21918745c41c23 100644 (file)
@@ -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;
        }