changeset 405:8f3a84de3739 stable-6-0-53-2

handle redirect= elements in spf txt records
author Carl Byington <carl@five-ten-sg.com>
date Fri, 17 Mar 2017 13:50:38 -0700
parents 1ac5e2e0e963
children ca4ef407588e
files ChangeLog NEWS dnsbl.spec.in src/context.cpp
diffstat 4 files changed, 17 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Mar 13 20:23:31 2017 -0700
+++ b/ChangeLog	Fri Mar 17 13:50:38 2017 -0700
@@ -1,7 +1,7 @@
-6.53 2017-03-13
+6.53 2017-03-17
     suppress duplicate calls to acceptable_content for
     messages with multiple recipients using the same filtering
-    context
+    context. handle redirect= elements in spf txt records
 
 6.52 2017-03-09
     document dkim/spf processing, handle a and a: elements
--- a/NEWS	Mon Mar 13 20:23:31 2017 -0700
+++ b/NEWS	Fri Mar 17 13:50:38 2017 -0700
@@ -1,4 +1,4 @@
-6.53 2017-03-13 suppress duplicate calls to acceptable_content()
+6.53 2017-03-17 suppress duplicate calls to acceptable_content(); redirect= in spf
 6.52 2017-03-09 document dkim/spf processing, handle a and a: elements
 6.51 2017-03-06 parse spf txt records for required dkim signers
 6.50 2017-02-22 reject if dkim signer is listed on surbl
--- a/dnsbl.spec.in	Mon Mar 13 20:23:31 2017 -0700
+++ b/dnsbl.spec.in	Fri Mar 17 13:50:38 2017 -0700
@@ -3,7 +3,7 @@
 Summary:            Sendmail milter for spam control
 Name:               @PACKAGE@
 Version:            @VERSION@
-Release:            1%{?dist}
+Release:            2%{?dist}
 License:            GPLv3+
 Group:              System Environment/Daemons
 Source:             http://www.five-ten-sg.com/%{name}/packages/%{name}-%{version}.tar.gz
@@ -155,6 +155,9 @@
 
 
 %changelog
+* Fri Mar 17 2017 Carl Byington <carl@five-ten-sg.com> - 6.53-2
+- handle redirect= elements in spf txt records.
+
 * Mon Mar 13 2017 Carl Byington <carl@five-ten-sg.com> - 6.53-1
 - suppress duplicate calls to acceptable_content for messages
   with multiple recipients using the same filtering context.
--- a/src/context.cpp	Mon Mar 13 20:23:31 2017 -0700
+++ b/src/context.cpp	Fri Mar 17 13:50:38 2017 -0700
@@ -1182,7 +1182,16 @@
             }
         }
         p = buf;
-        while ((level < 5) && (p = strstr(p, " include:"))) {
+        while ((level < 5) && ((p = strstr(p, " redirect=")))) {
+            p += 10;
+            char *b = strchr(p, ' ');
+            if (b) *b = '\0';
+            if (resolve_spf(p, ip, priv, level+1)) return true;
+            if (b) *b = ' ';
+            p = (b) ? b : e;
+        }
+        p = buf;
+        while ((level < 5) && ((p = strstr(p, " include:")))) {
             p += 9;
             char *b = strchr(p, ' ');
             if (b) *b = '\0';