summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/smtpd/lka_filter.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/lka_filter.c b/usr.sbin/smtpd/lka_filter.c
index 85fa0d8e25e..cab3b936bbd 100644
--- a/usr.sbin/smtpd/lka_filter.c
+++ b/usr.sbin/smtpd/lka_filter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lka_filter.c,v 1.38 2019/07/01 07:40:43 martijn Exp $ */
+/* $OpenBSD: lka_filter.c,v 1.39 2019/08/11 16:51:00 gilles Exp $ */
/*
* Copyright (c) 2018 Gilles Chehade <gilles@poolp.org>
@@ -966,10 +966,15 @@ filter_check_rdns(struct filter *filter, const char *hostname)
if (!filter->config->rdns)
return 0;
+ /* this is a hack until smtp session properly deals with lack of rdns */
+ ret = strcmp("<unknown>", hostname);
+ if (ret == 0)
+ return filter->config->not_rdns < 0 ? !ret : ret;
+
/* if text_to_netaddress succeeds,
* we don't have an rDNS so the filter should match
*/
- ret = text_to_netaddr(&netaddr, hostname);
+ ret = !text_to_netaddr(&netaddr, hostname);
return filter->config->not_rdns < 0 ? !ret : ret;
}