[Pymilter] [PATCH] Accept DNS names in iniplist

Stuart D Gathman stuart at bmsi.com
Tue Mar 25 13:53:26 EDT 2014


On 03/24/2014 08:14 PM, David Caldwell wrote:
> The iniplist() function takes an ip address and reports whether it is in
> a list or not. This patch lets you use a DNS name in the list and
> resolves it when looking for the IP address.
>
> This lets settings like "trusted_relay" in the spf milter use a DNS name
> which is stable in the long term, where the IP address is not.
I've switched to using the ipaddr module in pyspf.  I could have 
expand_iplist() return a list of IPNetwork from that module.  The 
IPNetwork ctor automatically handles converting IP6 addresses from 
either 16 byte binary or string format, and collapse_address_list() will 
combine adjacent networks.  A new in_address_list would check an ip 
against the output of expand_iplist().  This would prevent any new 
dependencies when using the old iniplist() function.  What do you think?



More information about the Pymilter mailing list