summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2019-09-29 10:14:20 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2019-09-29 10:14:20 +0000
commitfc15b7740ae91495b666e1f61157355d99262878 (patch)
tree9f6c547bcccee9790364f7d21ea1056455dbf694
parent9abec2f3045ea1edb0e23fa32fb9f71227c48f59 (diff)
- remove specific cases for +a and +mx as the + prefix is handled earlier
- support mx: notation diff from Quentin Rameau <quinq@fifth.space>
-rw-r--r--usr.sbin/smtpd/spfwalk.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.sbin/smtpd/spfwalk.c b/usr.sbin/smtpd/spfwalk.c
index 40d4888d564..3987af61624 100644
--- a/usr.sbin/smtpd/spfwalk.c
+++ b/usr.sbin/smtpd/spfwalk.c
@@ -190,6 +190,13 @@ dispatch_txt(struct dns_rr *rr)
printf("%s\n", *(ap) + 4);
continue;
}
+ if (strcasecmp("a", *ap) == 0) {
+ print_dname(rr->rr_dname, buf2, sizeof(buf2));
+ buf2[strlen(buf2) - 1] = '\0';
+ lookup_record(T_A, buf2, dispatch_a);
+ lookup_record(T_AAAA, buf2, dispatch_aaaa);
+ continue;
+ }
if (strncasecmp("a:", *ap, 2) == 0) {
lookup_record(T_A, *(ap) + 2, dispatch_a);
lookup_record(T_AAAA, *(ap) + 2, dispatch_aaaa);
@@ -207,17 +214,14 @@ dispatch_txt(struct dns_rr *rr)
lookup_record(T_TXT, *(ap) + 9, dispatch_txt);
continue;
}
- if (strcasecmp(*ap, "mx") == 0 || strcasecmp(*ap, "+mx") == 0) {
+ if (strcasecmp("mx", *ap) == 0) {
print_dname(rr->rr_dname, buf2, sizeof(buf2));
buf2[strlen(buf2) - 1] = '\0';
lookup_record(T_MX, buf2, dispatch_mx);
continue;
}
- if (strcasecmp(*ap, "a") == 0 || strcasecmp(*ap, "+a") == 0) {
- print_dname(rr->rr_dname, buf2, sizeof(buf2));
- buf2[strlen(buf2) - 1] = '\0';
- lookup_record(T_A, buf2, dispatch_a);
- lookup_record(T_AAAA, buf2, dispatch_aaaa);
+ if (strncasecmp("mx:", *ap, 2) == 0) {
+ lookup_record(T_MX, *(ap) + 2, dispatch_mx);
continue;
}
}