aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--smtpd/ruleset.c9
-rw-r--r--smtpd/spfwalk.c4
-rw-r--r--smtpd/to.c4
3 files changed, 10 insertions, 7 deletions
diff --git a/smtpd/ruleset.c b/smtpd/ruleset.c
index 286a2a43..2eae58c0 100644
--- a/smtpd/ruleset.c
+++ b/smtpd/ruleset.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ruleset.c,v 1.45 2019/11/04 00:05:38 gilles Exp $ */
+/* $OpenBSD: ruleset.c,v 1.46 2019/11/12 20:21:46 gilles Exp $ */
/*
* Copyright (c) 2009 Gilles Chehade <gilles@poolp.org>
@@ -86,9 +86,12 @@ ruleset_match_from(struct rule *r, const struct envelope *evp)
}
else {
key = ss_to_text(&evp->ss);
- if (strcmp(key, "local") == 0)
- if (r->flag_from_socket)
+ if (r->flag_from_socket) {
+ if (strcmp(key, "local") == 0)
return MATCH_RESULT(1, r->flag_from);
+ else
+ return r->flag_from < 0 ? 1 : 0;
+ }
}
if (r->flag_from_regex)
service = K_REGEX;
diff --git a/smtpd/spfwalk.c b/smtpd/spfwalk.c
index 7299bbc2..ebae9320 100644
--- a/smtpd/spfwalk.c
+++ b/smtpd/spfwalk.c
@@ -223,8 +223,8 @@ dispatch_txt(struct dns_rr *rr)
lookup_record(T_MX, buf2, dispatch_mx);
continue;
}
- if (strncasecmp("mx:", *ap, 2) == 0) {
- lookup_record(T_MX, *(ap) + 2, dispatch_mx);
+ if (strncasecmp("mx:", *ap, 3) == 0) {
+ lookup_record(T_MX, *(ap) + 3, dispatch_mx);
continue;
}
}
diff --git a/smtpd/to.c b/smtpd/to.c
index aeff186d..81a1bb54 100644
--- a/smtpd/to.c
+++ b/smtpd/to.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: to.c,v 1.43 2019/09/19 16:00:59 gilles Exp $ */
+/* $OpenBSD: to.c,v 1.44 2019/11/12 20:21:46 gilles Exp $ */
/*
* Copyright (c) 2009 Jacek Masiulaniec <jacekm@dobremiasto.net>
@@ -495,7 +495,7 @@ rule_to_text(struct rule *r)
(void)strlcat(buf, " !", sizeof buf);
if (r->flag_from_socket)
(void)strlcat(buf, " from socket", sizeof buf);
- if (r->flag_from_rdns) {
+ else if (r->flag_from_rdns) {
(void)strlcat(buf, " from rdns", sizeof buf);
if (r->table_from) {
(void)strlcat(buf, " ", sizeof buf);