Errors with non-ascii characters in 'txt' record
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pypolicyd-spf |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
OS: openSUSE 13.1
Python: 2.7.6
policyd-spf: 1.3.1
I discovered some errors in my logs:
policyd-spf[11597]: Traceback (most recent call last):
policyd-spf[11597]: File "/usr/bin/
policyd-spf[11597]: instance_dict, configData, peruser)
policyd-spf[11597]: File "/usr/bin/
policyd-spf[11597]: res = spf.check2(ip, sender, helo, querytime=
policyd-spf[11597]: File "/usr/lib/
policyd-spf[11597]: receiver=
policyd-spf[11597]: File "/usr/lib/
policyd-spf[11597]: spf = self.dns_
policyd-spf[11597]: File "/usr/lib/
policyd-spf[11597]: a = [t for t in self.dns_
policyd-spf[11597]: File "/usr/lib/
policyd-spf[11597]: for a in self.dns(
policyd-spf[11597]: File "/usr/lib/
policyd-spf[11597]: return [''.join(
policyd-spf[11597]: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 56: ordinal not in range(128)
I noticed these errors appear for email from specific domains only, so I checked these domains' TXT records and discovered this:
xxxxxxxx.xxx. 6694 IN TXT "v=spf1 mx:mail.
I'm pretty sure that the last part (\226\128\147all) is wrong, but perhaps policyd-spf should handle it differently?
What version of pyspf do you have? I think the current pyspf won't have that
problem. Note that the actual error:
policyd-spf[11597]: File "/usr/lib/ python2. 7/site- packages/ spf.py" , line s.decode( "ascii" ) for s in a)
1130, in <genexpr>
policyd-spf[11597]: return [''.join(
policyd-spf[11597]: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2
in position 56: ordinal not in range(128)
is in the pyspf module, not in the policy server.