Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
postfix and pypolicyd-spf UnicodeDecodeError: 'ascii' codec
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
piggie
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jan 2003
Posts: 113
Location: Sydney, Australia

PostPosted: Sun Apr 14, 2013 11:45 am    Post subject: postfix and pypolicyd-spf UnicodeDecodeError: 'ascii' codec Reply with quote

I've recently started having an issue with pypolicyd-spf and postfix.
When it is enabled in my postfix config, all mail is rejected due to pypolicyd-spf crashing.
The output from my mail log is below.

I've tried switching to python 2.6, but this doesn't help.
I have done some searching on UnicodeDecodeError:, but I can't seem to find anything related to pypolicyd or postfix.
Anyone got an idea what might be causing this?


Code:

Apr 14 21:39:26 server policyd-spf[4200]: Traceback (most recent call last):
Apr 14 21:39:26 server policyd-spf[4200]:   File "/usr/bin/policyd-spf-2.7", line 684, in <module>
Apr 14 21:39:26 server policyd-spf[4200]:     instance_dict, configData, peruser)
Apr 14 21:39:26 server policyd-spf[4200]:   File "/usr/bin/policyd-spf-2.7", line 379, in _spfcheck
Apr 14 21:39:26 server policyd-spf[4200]:     domain_whitelist = _spfbypass(data, 'Domain_Whitelist', configData)
Apr 14 21:39:26 server policyd-spf[4200]:   File "/usr/bin/policyd-spf-2.7", line 235, in _spfbypass
Apr 14 21:39:26 server policyd-spf[4200]:     res = spf.check2(ip, domain, domain)
Apr 14 21:39:26 server policyd-spf[4200]:   File "/usr/lib/python2.7/site-packages/spf.py", line 310, in check2
Apr 14 21:39:26 server policyd-spf[4200]:     receiver=receiver,timeout=timeout,verbose=verbose,querytime=querytime).check()
Apr 14 21:39:26 server policyd-spf[4200]:   File "/usr/lib/python2.7/site-packages/spf.py", line 538, in check
Apr 14 21:39:26 server policyd-spf[4200]:     spf = self.dns_spf(self.d)
Apr 14 21:39:26 server policyd-spf[4200]:   File "/usr/lib/python2.7/site-packages/spf.py", line 1094, in dns_spf
Apr 14 21:39:26 server policyd-spf[4200]:     a = [t for t in self.dns_txt(domain) if RE_SPF.match(t)]
Apr 14 21:39:26 server policyd-spf[4200]:   File "/usr/lib/python2.7/site-packages/spf.py", line 1131, in dns_txt
Apr 14 21:39:26 server policyd-spf[4200]:     for a in self.dns(domainname, 'TXT')]
Apr 14 21:39:26 server policyd-spf[4200]:   File "/usr/lib/python2.7/site-packages/spf.py", line 1130, in <genexpr>
Apr 14 21:39:26 server policyd-spf[4200]:     return [''.join(s.decode("ascii") for s in a)
Apr 14 21:39:26 server policyd-spf[4200]: UnicodeDecodeError: 'ascii' codec can't decode byte 0x96 in position 32: ordinal not in range(128)
Apr 14 21:39:26 server postfix/spawn[4199]: warning: command /usr/bin/python exit status 1
Apr 14 21:39:26 server postfix/smtpd[4193]: warning: premature end-of-input on private/policyd-spf while reading input attribute name
Apr 14 21:39:27 server policyd-spf[4212]: Traceback (most recent call last):
Apr 14 21:39:27 server policyd-spf[4212]:   File "/usr/bin/policyd-spf-2.7", line 684, in <module>
Apr 14 21:39:27 server policyd-spf[4212]:     instance_dict, configData, peruser)
Apr 14 21:39:27 server policyd-spf[4212]:   File "/usr/bin/policyd-spf-2.7", line 379, in _spfcheck
Apr 14 21:39:27 server policyd-spf[4212]:     domain_whitelist = _spfbypass(data, 'Domain_Whitelist', configData)
Apr 14 21:39:27 server policyd-spf[4212]:   File "/usr/bin/policyd-spf-2.7", line 235, in _spfbypass
Apr 14 21:39:27 server policyd-spf[4212]:     res = spf.check2(ip, domain, domain)
Apr 14 21:39:27 server policyd-spf[4212]:   File "/usr/lib/python2.7/site-packages/spf.py", line 310, in check2
Apr 14 21:39:27 server policyd-spf[4212]:     receiver=receiver,timeout=timeout,verbose=verbose,querytime=querytime).check()
Apr 14 21:39:27 server policyd-spf[4212]:   File "/usr/lib/python2.7/site-packages/spf.py", line 538, in check
Apr 14 21:39:27 server policyd-spf[4212]:     spf = self.dns_spf(self.d)
Apr 14 21:39:27 server policyd-spf[4212]:   File "/usr/lib/python2.7/site-packages/spf.py", line 1094, in dns_spf
Apr 14 21:39:27 server policyd-spf[4212]:     a = [t for t in self.dns_txt(domain) if RE_SPF.match(t)]
Apr 14 21:39:27 server policyd-spf[4212]:   File "/usr/lib/python2.7/site-packages/spf.py", line 1131, in dns_txt
Apr 14 21:39:27 server policyd-spf[4212]:     for a in self.dns(domainname, 'TXT')]
Apr 14 21:39:27 server policyd-spf[4212]:   File "/usr/lib/python2.7/site-packages/spf.py", line 1130, in <genexpr>
Apr 14 21:39:27 server policyd-spf[4212]:     return [''.join(s.decode("ascii") for s in a)
Apr 14 21:39:27 server policyd-spf[4212]: UnicodeDecodeError: 'ascii' codec can't decode byte 0x96 in position 32: ordinal not in range(128)
Back to top
View user's profile Send private message
tgh
Apprentice
Apprentice


Joined: 05 Oct 2005
Posts: 222

PostPosted: Thu Sep 12, 2013 6:15 pm    Post subject: Re: postfix and pypolicyd-spf UnicodeDecodeError: 'ascii' co Reply with quote

piggie wrote:
I've recently started having an issue with pypolicyd-spf and postfix.
When it is enabled in my postfix config, all mail is rejected due to pypolicyd-spf crashing.
The output from my mail log is below.

I've tried switching to python 2.6, but this doesn't help.
I have done some searching on UnicodeDecodeError:, but I can't seem to find anything related to pypolicyd or postfix.
Anyone got an idea what might be causing this?


https://bugs.launchpad.net/pypolicyd-spf/+bug/832480

Basically there are two issues here:

#1 - The sender has a bad SPF or TXT record as SPF records are not allowed to have Unicode in them.

#2 - You are using an older version of pypolicyd-spf or pyspf

https://answers.launchpad.net/pypolicyd-spf/+question/232582
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum