modoboa-amavis
modoboa-amavis copied to clipboard
Quarantine non-ascii decoding [help wanted]
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 Could you please paste the full stack trace?