diff src/context.cpp @ 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 b48ee4bc431b
children 29d54e7028f6
line wrap: on
line diff
--- 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';