summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhil Pennock <pdp@exim.org>2012-05-17 00:39:38 -0400
committerPhil Pennock <pdp@exim.org>2012-05-17 00:39:38 -0400
commiteae0036b2dfac1547351908f77a6154b898c45d6 (patch)
tree0fb991b73c1517dd00dd4c5efd5dd664ffb15133 /src
parent53947857fdb3c00bb673f6d2ac326dc4ccf01c6e (diff)
dnsdb SPF support, from Janne Snabb
Diffstat (limited to 'src')
-rw-r--r--src/src/dns.c1
-rw-r--r--src/src/exim.h6
-rw-r--r--src/src/lookups/dnsdb.c9
3 files changed, 15 insertions, 1 deletions
diff --git a/src/src/dns.c b/src/src/dns.c
index c903d0ba9..d5214901d 100644
--- a/src/src/dns.c
+++ b/src/src/dns.c
@@ -415,6 +415,7 @@ switch(t)
case T_AAAA: return US"AAAA";
case T_A6: return US"A6";
case T_TXT: return US"TXT";
+ case T_SPF: return US"SPF";
case T_PTR: return US"PTR";
case T_SOA: return US"SOA";
case T_SRV: return US"SRV";
diff --git a/src/src/exim.h b/src/src/exim.h
index 49f52474a..4a5375514 100644
--- a/src/src/exim.h
+++ b/src/src/exim.h
@@ -299,6 +299,12 @@ header files. I don't suppose they have T_SRV either. */
#define T_SRV 33
#endif
+/* Many systems do not have T_SPF. */
+
+#ifndef T_SPF
+#define T_SPF 99
+#endif
+
/* It seems that some versions of arpa/nameser.h don't define *any* of the
T_xxx macros, which seem to be non-standard nowadays. Just to be on the safe
side, put in definitions for all the ones that Exim uses. */
diff --git a/src/src/lookups/dnsdb.c b/src/src/lookups/dnsdb.c
index 2862a5bc9..6848317e8 100644
--- a/src/src/lookups/dnsdb.c
+++ b/src/src/lookups/dnsdb.c
@@ -17,6 +17,11 @@ header files. */
#define T_TXT 16
#endif
+/* Many systems do not have T_SPF. */
+#ifndef T_SPF
+#define T_SPF 99
+#endif
+
/* Table of recognized DNS record types and their integer values. */
static const char *type_names[] = {
@@ -33,6 +38,7 @@ static const char *type_names[] = {
"mxh",
"ns",
"ptr",
+ "spf",
"srv",
"txt",
"zns"
@@ -52,6 +58,7 @@ static int type_values[] = {
T_MXH, /* Private type for "MX hostnames" */
T_NS,
T_PTR,
+ T_SPF,
T_SRV,
T_TXT,
T_ZNS /* Private type for "zone nameservers" */
@@ -316,7 +323,7 @@ while ((domain = string_nextinlist(&keystring, &sep, buffer, sizeof(buffer)))
if (ptr != 0) yield = string_cat(yield, &size, &ptr, outsep, 1);
- if (type == T_TXT)
+ if (type == T_TXT || type == T_SPF)
{
if (outsep2 == NULL)
{