[Pymilter] [PATCH] Accept DNS names in iniplist
Stuart D Gathman
stuart at bmsi.com
Thu Mar 27 22:40:59 EDT 2014
On 03/27/2014 10:33 PM, Stuart D Gathman wrote:
>
> @@ -96,6 +105,13 @@
> n = 128
> if cidr(bin2long6(inet_pton(p[0])),n,MASK6) ==
> cidr(ipnum,n,MASK6):
> return True
> + elif dnsre.match(p[0]):
> + try:
> + sfx = '/'.join(['']+p[1:])
> + addrlist = [r[4][0]+sfx for r in
> socket.getaddrinfo(p[0],25,fam)]
> + if iniplist(ipaddr,addrlist):
> + return True
> + except socket.gaierror: pass
> elif fnmatchcase(ipaddr,pat):
> return True
> return False
Sorry - forgot to run tabnanny.
More information about the Pymilter
mailing list