Performed an upgrade to dev-python/pyspf-2.0.8 this morning. Had an incoming email and customer was told that the mail server postfix was misconfigured because mail-filter/pypolicyd-spf crashed. The error was saying that addr2bin was missing. I didn't bother to look any further, I just downgraded to dev-python/pyspf-2.0.7 and it works fine. Reproducible: Always
Here is the traceback if anyone is interested. 1 Feb 25 05:36:12 redacted.hostname policyd-spf[6447]: Traceback (most recent call last): 2 Feb 25 05:36:12 redacted.hostname policyd-spf[6447]: File "/usr/lib/python-exec/python2.7/policyd-spf", line 684, in <module> 3 Feb 25 05:36:12 redacted.hostname policyd-spf[6447]: instance_dict, configData, peruser) 4 Feb 25 05:36:12 redacted.hostname policyd-spf[6447]: File "/usr/lib/python-exec/python2.7/policyd-spf", line 350, in _spfcheck 5 Feb 25 05:36:12 redacted.hostname policyd-spf[6447]: skip_check = _spfbypass(data, 'skip_addresses', configData) 6 Feb 25 05:36:12 redacted.hostname policyd-spf[6447]: File "/usr/lib/python-exec/python2.7/policyd-spf", line 206, in _spfbypass 7 Feb 25 05:36:12 redacted.hostname policyd-spf[6447]: if _cidrmatch(ip, good_ip, int(cidr_range)): 8 Feb 25 05:36:12 redacted.hostname policyd-spf[6447]: File "/usr/lib/python-exec/python2.7/policyd-spf", line 59, in _cidrmatch 9 Feb 25 05:36:12 redacted.hostname policyd-spf[6447]: bin = spf.addr2bin 10 Feb 25 05:36:12 redacted.hostname policyd-spf[6447]: AttributeError: 'module' object has no attribute 'addr2bin' 11 Feb 25 05:36:12 redacted.hostname postfix/spawn[6434]: warning: command /usr/bin/policyd-spf exit status 1 12 Feb 25 05:36:12 redacted.hostname postfix/smtpd[6426]: warning: premature end-of-input on private/policy-spf while reading input attribute name 13 Feb 25 05:36:12 redacted.hostname postfix/smtpd[6427]: warning: problem talking to server private/policy-spf: Success 14
*** This bug has been marked as a duplicate of bug 2 ***
confirmed. mail-filter/pypolicyd-spf (at least current 1.1.2) uses addr2bin() from dev-python/pyspf-2.0.7. The addr2bin() was removed from dev-python/pyspf-2.0.8 however. mail-filter/pypolicyd-spf-1.1.2 is not working with dev-python/pyspf-2.0.8 I'm going to attach a quick fix for anyone interested.
Created attachment 371212 [details, diff] adds missing addr2bin to pypolicyd-spf. This is not real solution. IPv6 will still be broken.
There is a newer version of pypolicyd-spf, 1.2, available which may fix this. I'll give it a try. It's unmaintained so I'll simply push the bump if it works.
Thanks. pypolicyd-spf 1.2 switched from addr2bin to using ipaddress. It will very likely work. Please note that 1.2 depends on ipaddr for Python 2.7. So dev-python/ipaddr needs to go into DEPEND for python2_7. (Same as for dev-python/pyspf, see bug #488474)
I've just bumped to v1.2 and added myself as maintainer. There are still a few problems that need to be ironed out with the deps but I'm going to close this and open individual bugs for those to keep things manageable.
Have you tried the latest version in the tree (1.2)? I just bumped it a few hours ago so you'll need to sync. I've tested it with pyspf-2.0.8 for about a day on a live server and it seems to be working.
Oh, nevermind, sorry. The bug mail made it look like you reverted it to a not-fixed state. Derp.