Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 502378 - mail-filter/pypolicyd-spf with dev-python/pyspf-2.0.8 - policyd-spf: AttributeError: 'module' object has no attribute 'addr2bin'
Summary: mail-filter/pypolicyd-spf with dev-python/pyspf-2.0.8 - policyd-spf: Attribut...
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Michael Orlitzky
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-25 04:44 UTC by cjanderson
Modified: 2014-03-03 03:47 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
adds missing addr2bin to pypolicyd-spf. This is not real solution. IPv6 will still be broken. (policyd-spf-fix.diff,1.38 KB, patch)
2014-02-25 10:47 UTC, Christian Zuckschwerdt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description cjanderson 2014-02-25 04:44:08 UTC
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
Comment 1 cjanderson 2014-02-25 05:40:09 UTC
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
Comment 2 cjanderson 2014-02-25 05:44:41 UTC

*** This bug has been marked as a duplicate of bug 2 ***
Comment 3 Christian Zuckschwerdt 2014-02-25 10:44:52 UTC
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.
Comment 4 Christian Zuckschwerdt 2014-02-25 10:47:07 UTC
Created attachment 371212 [details, diff]
adds missing addr2bin to pypolicyd-spf. This is not real solution. IPv6 will still be broken.
Comment 5 Michael Orlitzky gentoo-dev 2014-02-25 20:20:28 UTC
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.
Comment 6 Christian Zuckschwerdt 2014-02-25 20:33:42 UTC
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)
Comment 7 Michael Orlitzky gentoo-dev 2014-03-03 00:19:12 UTC
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.
Comment 8 Michael Orlitzky gentoo-dev 2014-03-03 03:47:08 UTC
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.
Comment 9 Michael Orlitzky gentoo-dev 2014-03-03 03:47:57 UTC
Oh, nevermind, sorry. The bug mail made it look like you reverted it to a not-fixed state. Derp.