Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Minor] Support commonly mistaken spf ipv4/ipv6 elements
  • Loading branch information
vstakhov committed Jul 30, 2021
1 parent 3dacc25 commit 4266f57
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/libserver/spf.c
Expand Up @@ -31,7 +31,9 @@
#define SPF_ALL "all"
#define SPF_A "a"
#define SPF_IP4 "ip4"
#define SPF_IP4_ALT "ipv4"
#define SPF_IP6 "ip6"
#define SPF_IP6_ALT "ipv6"
#define SPF_PTR "ptr"
#define SPF_MX "mx"
#define SPF_EXISTS "exists"
Expand Down Expand Up @@ -2191,16 +2193,19 @@ spf_process_element (struct spf_record *rec,
break;
case 'i':
/* include or ip4 */
if (g_ascii_strncasecmp (begin, SPF_IP4,
sizeof (SPF_IP4) - 1) == 0) {
if (g_ascii_strncasecmp (begin, SPF_IP4, sizeof (SPF_IP4) - 1) == 0) {
res = parse_spf_ip4 (rec, addr);
}
else if (g_ascii_strncasecmp (begin, SPF_INCLUDE,
sizeof (SPF_INCLUDE) - 1) == 0) {
else if (g_ascii_strncasecmp (begin, SPF_INCLUDE, sizeof (SPF_INCLUDE) - 1) == 0) {
res = parse_spf_include (rec, addr);
}
else if (g_ascii_strncasecmp (begin, SPF_IP6, sizeof (SPF_IP6) -
1) == 0) {
else if (g_ascii_strncasecmp (begin, SPF_IP6, sizeof (SPF_IP6) - 1) == 0) {
res = parse_spf_ip6 (rec, addr);
}
else if (g_ascii_strncasecmp (begin, SPF_IP4_ALT, sizeof (SPF_IP4_ALT) - 1) == 0) {
res = parse_spf_ip4 (rec, addr);
}
else if (g_ascii_strncasecmp (begin, SPF_IP6_ALT, sizeof (SPF_IP6_ALT) - 1) == 0) {
res = parse_spf_ip6 (rec, addr);
}
else {
Expand Down

0 comments on commit 4266f57

Please sign in to comment.