Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarantine non-ascii decoding [help wanted] #109

Open
8Cris1 opened this issue May 4, 2018 · 1 comment
Open

Quarantine non-ascii decoding [help wanted] #109

8Cris1 opened this issue May 4, 2018 · 1 comment

Comments

@8Cris1
Copy link

8Cris1 commented May 4, 2018

Hi, I have amavis database and AMAVIS_DEFAULT_DATABASE_ENCODING both set to 'LATIN1'.
Now, in 'msgs' table, column 'from_addr', of amavis database I have this string "Brokeñ Héader fíeld" with non-ascii chars.
When I click on this mail (on quarantine tab of dashboard) I have this error:

DjangoUnicodeDecodeError at /quarantine/getmailcontent/7YhQ_xlA5bRc/
'ascii' codec can't decode byte 0xc3 in position 6: ordinal not in range(128). You passed in '"Broke\xc3\xb1 H\xc3\xa9ader f\xc3\xadeld" <test@localhost>' (<type 'str'>)
Request Method:
GET
Request URL:
http://.../quarantine/getmailcontent/7YhQ_xlA5bRc/
Django Version:
1.11.12
Exception Type:
DjangoUnicodeDecodeError
Exception Value:
'ascii' codec can't decode byte 0xc3 in position 6: ordinal not in range(128). You passed in '"Broke\xc3\xb1 H\xc3\xa9ader f\xc3\xadeld" <test@localhost>' (<type 'str'>)
Exception Location:
/usr/lib64/python2.7/site-packages/django/utils/encoding.py in force_text, line 88
Python Executable:
/usr/bin/python
Python Version:
2.7.5
Python Path:
['/var/www/python/modoboa_test',
 '/usr/lib64/python27.zip',
 '/usr/lib64/python2.7',
 '/usr/lib64/python2.7/plat-linux2',
 '/usr/lib64/python2.7/lib-tk',
 '/usr/lib64/python2.7/lib-old',
 '/usr/lib64/python2.7/lib-dynload',
 '/usr/lib64/python2.7/site-packages',
 '/usr/lib64/python2.7/site-packages/gtk-2.0',
 '/usr/lib/python2.7/site-packages']

Is there a way to allow non-ascii decoding?

Thanks

@8Cris1 8Cris1 changed the title Quarantine non-ascii decoding [question] Quarantine non-ascii decoding May 14, 2018
@8Cris1 8Cris1 changed the title [question] Quarantine non-ascii decoding Quarantine non-ascii decoding [help wanted] May 14, 2018
@tonioo
Copy link
Member

tonioo commented Aug 19, 2018

@8Cris1 Could you please paste the full stack trace?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants