Mercurial > dnsbl
comparison src/context.cpp @ 384:7b7066a51c33
start parsing spf txt records
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Mon, 06 Mar 2017 14:01:14 -0800 |
parents | c378e9d03f37 |
children | 2354a1944e49 |
comparison
equal
deleted
inserted
replaced
383:5a88320a7547 | 384:7b7066a51c33 |
---|---|
1124 | 1124 |
1125 | 1125 |
1126 bool CONTEXT::resolve_spf(const char *from, uint32_t ip, mlfiPriv *priv, int level) | 1126 bool CONTEXT::resolve_spf(const char *from, uint32_t ip, mlfiPriv *priv, int level) |
1127 { | 1127 { |
1128 char buf[maxlen]; | 1128 char buf[maxlen]; |
1129 log(priv->queueid, "looking for %s txt record", from); | |
1129 dns_interface(*priv, from, ns_t_txt, false, NULL, buf, maxlen); | 1130 dns_interface(*priv, from, ns_t_txt, false, NULL, buf, maxlen); |
1130 if (*buf) { | 1131 if (*buf) { |
1131 log(priv->queueid, "found txt record for %s", from); | 1132 log(priv->queueid, "found txt record %s", buf); |
1132 log(priv->queueid, "found txt record value %s", buf); | |
1133 char *p = buf; | 1133 char *p = buf; |
1134 char *e = p + strlen(p); // point to trailing null | 1134 char *e = p + strlen(p); // point to trailing null |
1135 while (p = strstr(p, " ip4:")) { | 1135 while (p = strstr(p, " ip4:")) { |
1136 p += 5; | 1136 p += 5; |
1137 char *b = strchr(p, ' '); | 1137 char *b = strchr(p, ' '); |