diff options
author | Dirk Meyer <dinoex@FreeBSD.org> | 2018-01-15 10:55:01 +0000 |
---|---|---|
committer | Dirk Meyer <dinoex@FreeBSD.org> | 2018-01-15 10:55:01 +0000 |
commit | 84e6522e8a8a680a15b223543ae5d29e2741b10d (patch) | |
tree | f410b7807ddb875554ecf1cfa841b7435a6fd837 /mail/spamilter | |
parent | New port: devel/py-llvmcpy: Python bindings for LLVM auto-generated from the ... (diff) |
- Add IPv6 AAAA Lookups for MtaHostChk
PR: 196756
Submitted by: jvp@lateapex.net
Notes
Notes:
svn path=/head/; revision=459031
Diffstat (limited to 'mail/spamilter')
-rw-r--r-- | mail/spamilter/Makefile | 2 | ||||
-rw-r--r-- | mail/spamilter/files/patch-dns.c | 60 | ||||
-rw-r--r-- | mail/spamilter/files/patch-dns.h | 11 | ||||
-rw-r--r-- | mail/spamilter/files/patch-hndlrs.c | 15 |
4 files changed, 87 insertions, 1 deletions
diff --git a/mail/spamilter/Makefile b/mail/spamilter/Makefile index e3969e9aef7d..ca8d4ccaf2ef 100644 --- a/mail/spamilter/Makefile +++ b/mail/spamilter/Makefile @@ -2,7 +2,7 @@ PORTNAME= spamilter PORTVERSION= 0.60 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= mail MASTER_SITES= http://www.wanlink.com/spamilter/download/ diff --git a/mail/spamilter/files/patch-dns.c b/mail/spamilter/files/patch-dns.c new file mode 100644 index 000000000000..59b5932e118e --- /dev/null +++ b/mail/spamilter/files/patch-dns.c @@ -0,0 +1,60 @@ +--- dns.c.orig 2005-07-17 19:55:13.000000000 -0500 ++++ dns.c 2015-01-21 13:58:59.000000000 -0600 +@@ -58,25 +58,48 @@ + + int dns_query_rr_a(const res_state statp, char *fmt, ...) + { va_list vl; +- int x,rc = 0; +- char *hn = NULL; ++ int x, haveRR = 0; ++ char *hostName = NULL; + + va_start(vl,fmt); + if(fmt != NULL && *fmt) + { +- x = vasprintf(&hn,fmt,vl); +- if(hn != NULL && x > 0) +- { u_char packet[NS_PACKETSZ]; ++ x = vasprintf(&hostName,fmt,vl); ++ if(hostName != NULL && x > 0) ++ { u_char ns_packet[NS_PACKETSZ]; + +- rc = (res_nquery(statp, hn,ns_c_in,ns_t_a,packet,sizeof(packet)) == -1 ? 0 : 1); ++ haveRR = (res_nquery(statp, hostName, ns_c_in, ns_t_a, ns_packet, sizeof(ns_packet)) == -1 ? 0 : 1); + } + +- if(hn != NULL) +- free(hn); ++ if(hostName != NULL) ++ free(hostName); + } + va_end(vl); + +- return(rc); ++ return haveRR; ++} ++ ++int dns_query_rr_aaaa(const res_state statp, char *fmt, ...) ++{ va_list vl; ++ int x, haveRR = 0; ++ char *hostName = NULL; ++ ++ va_start(vl,fmt); ++ if(fmt != NULL && *fmt) ++ { ++ x = vasprintf(&hostName,fmt,vl); ++ if(hostName != NULL && x > 0) ++ { u_char ns_packet[NS_PACKETSZ]; ++ ++ haveRR = (res_nquery(statp, hostName, ns_c_in, ns_t_aaaa, ns_packet, sizeof(ns_packet)) == -1 ? 0 : 1); ++ } ++ ++ if(hostName != NULL) ++ free(hostName); ++ } ++ va_end(vl); ++ ++ return haveRR; + } + + int dns_rdnsbl_has_rr_a(const res_state statp, long ip, char *domain) diff --git a/mail/spamilter/files/patch-dns.h b/mail/spamilter/files/patch-dns.h new file mode 100644 index 000000000000..14ac3c630205 --- /dev/null +++ b/mail/spamilter/files/patch-dns.h @@ -0,0 +1,11 @@ +--- dns.h.orig 2004-11-25 18:13:49.000000000 -0600 ++++ dns.h 2015-01-21 14:06:33.000000000 -0600 +@@ -47,6 +47,8 @@ + + #define mkip(a,b,c,d) ((((a)&0xff)<<24)|(((b)&0xff)<<16)|(((c)&0xff)<<8)|((d)&0xff)) + ++ int dns_query_rr_aaaa(const res_state statp, char *fmt, ...); ++ + int dns_query_rr_a(const res_state statp, char *fmt, ...); + int dns_rdnsbl_has_rr_a(const res_state statp, long ip, char *domain); + diff --git a/mail/spamilter/files/patch-hndlrs.c b/mail/spamilter/files/patch-hndlrs.c new file mode 100644 index 000000000000..00cee497286a --- /dev/null +++ b/mail/spamilter/files/patch-hndlrs.c @@ -0,0 +1,15 @@ +--- hndlrs.c.orig 2005-07-17 19:55:13.000000000 -0500 ++++ hndlrs.c 2015-01-21 14:47:27.000000000 -0600 +@@ -466,7 +466,11 @@ + if(gMtaHostIpfw) + mlfi_MtaHostIpfwAction(priv->ipstr,"add"); + } +- else if(gMtaHostChk && !priv->islocalnethost && !dns_query_rr_a(priv->statp,priv->helo)) ++ else if(gMtaHostChk ++ && !priv->islocalnethost ++ && !dns_query_rr_a(priv->statp,priv->helo) ++ && !dns_query_rr_aaaa(priv->statp,priv->helo) ++ ) + { + mlfi_setreply(ctx,550,"5.7.1","Rejecting due to security policy - Invalid hostname '%s', Please see: %s#invalidhostname",priv->helo,gPolicyUrl); + mlfi_debug("envrcpt: Invalid MTA hostname '%s'\n",priv->helo); |