policyd-spf dies with UnicodeDecodeError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pypolicyd-spf |
Fix Released
|
High
|
Scott Kitterman | ||
pypolicyd-spf (Ubuntu) |
Fix Released
|
High
|
Unassigned |
Bug Description
This looks similar to bug 832480. In the logs, we have things like,
Jun 2 08:34:27 mx1 policyd-spf[22478]: Traceback (most recent call last):
Jun 2 08:34:27 mx1 policyd-spf[22478]: File "/usr/lib/
Jun 2 08:34:27 mx1 policyd-spf[22478]: line = sys.stdin.
Jun 2 08:34:27 mx1 policyd-spf[22478]: File "/usr/lib64/
Jun 2 08:34:27 mx1 policyd-spf[22478]: return codecs.
Jun 2 08:34:27 mx1 policyd-spf[22478]: UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position 241: ordinal not in range(128)
Jun 2 08:34:27 mx1 postfix/
Jun 2 08:34:27 mx1 postfix/
Jun 2 08:34:28 mx1 postfix/
Jun 2 08:34:28 mx1 postfix/
All of these have been spam, so it's no great loss. I've tried increasing the DebugLevel to 5, but to no avail: nothing gets logged before the crash.
Changed in pypolicyd-spf (Ubuntu): | |
importance: | Undecided → High |
I did investigate this issue. 832480 was about non-ascii characters in DNS records. This issue is about non-ascii in email addresses. The reason nothing gets logged is the crash is in the line that reads the data coming from postfix. The python readline function auto-detects the content type and it auto-detects ascii, which is wrong (thus the similar looking error).
It's extremely unlikely this will affect legitimate mail, but I believe it's possible. I'll get a fix out in the next day or two as it's taking some low level digging in the Python io module to try and sort out how to do this without the incorrect auto-detection.
Thanks for filing the bug.