changeset 460:ad05c61d6372 stable-6-0-74

add debug code for spf check with microsoft /14
author Carl Byington <carl@five-ten-sg.com>
date Mon, 24 Dec 2018 09:37:36 -0800
parents e2c09e0c4784
children c22fc705c597
files ChangeLog NEWS configure.in dnsbl.spec.in src/context.cpp
diffstat 5 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Sep 18 09:52:56 2018 -0700
+++ b/ChangeLog	Mon Dec 24 09:37:36 2018 -0800
@@ -1,3 +1,6 @@
+6.74 2018-12-24
+    add debug code for spf check with microsoft /14
+
 6.73 2018-09-18
     ignore dnswl entries if the sender is <>
     allow autowhite of recipients with local parts up to 35 characters.
--- a/NEWS	Tue Sep 18 09:52:56 2018 -0700
+++ b/NEWS	Mon Dec 24 09:37:36 2018 -0800
@@ -1,3 +1,4 @@
+6.74 2018-12-24 add debug code for spf check with microsoft /14
 6.73 2018-09-18 ignore dnswl entries if the sender is <>
 6.72 2018-06-06 add unsigned_black for enforcement of dmarc policy
 6.69 2018-04-10 fix spf mx:domain.tld token parsing
--- a/configure.in	Tue Sep 18 09:52:56 2018 -0700
+++ b/configure.in	Mon Dec 24 09:37:36 2018 -0800
@@ -1,6 +1,6 @@
 
 AC_PREREQ(2.59)
-AC_INIT(dnsbl,6.73,carl@five-ten-sg.com)
+AC_INIT(dnsbl,6.74,carl@five-ten-sg.com)
 AC_CONFIG_SRCDIR([config.h.in])
 AC_CONFIG_HEADER([config.h])
 AC_CONFIG_MACRO_DIR([m4])
--- a/dnsbl.spec.in	Tue Sep 18 09:52:56 2018 -0700
+++ b/dnsbl.spec.in	Mon Dec 24 09:37:36 2018 -0800
@@ -151,6 +151,9 @@
 
 
 %changelog
+* Mon Dec 24 2018 Carl Byington <carl@five-ten-sg.com> - 6.74-1
+- add debug code for spf check with microsoft /14
+
 * Tue Sep 18 2018 Carl Byington <carl@five-ten-sg.com> - 6.73-1
 - ignore dnswl entries if the sender is <>
 - allow autowhite of recipients with local parts up to 35 characters.
--- a/src/context.cpp	Tue Sep 18 09:52:56 2018 -0700
+++ b/src/context.cpp	Mon Dec 24 09:37:36 2018 -0800
@@ -1215,9 +1215,14 @@
                     if (inet_aton(p, &ipx)) {
                         uint32_t ipy = ntohl(ipx.s_addr);
                         int mask = (s) ? atoi(s+1) : 32;
-                        if ((mask >= 16) && (mask <= 32)) {
+                        if ((mask >= 14) && (mask <= 32)) {     // microsoft has a /14
                             uint32_t low = (1 << (32-mask)) - 1;
                             ipy &= low ^ 0xffffffff;
+                            {
+                                char buf[maxlen];
+                                snprintf(buf, maxlen, "ip=%08x, spf=%08x/%d, mask=%08x", ip, ipy, mask, low);
+                                log(priv->queueid, "spf check %s", buf);
+                            }
                             if ((ipy <= ip) && (ip <= ipy + low)) {
                                 if (s) *s = '/';
                                 log(priv->queueid, "match ip4:%s", p);