-
Notifications
You must be signed in to change notification settings - Fork 163
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
Content-Transfer-Encoding badly interpreted when charset in Content-Type is between quote #1522
Comments
Thanks for reporting this. |
I'll see if I find time to do that over the week-end. |
Ok, I did some more trying with things, and it turns out that my minimal test is already in the tree: it is https://github.com/pazz/alot/blob/master/tests/static/mail/utf8.eml With togglesource (note how alot seems to have transformed the email to quoted-printable, though the original is not) Finally, this is how notmuch sees it:
|
A couple additional notes on tests:
That leads me to think that either:
|
I experience what seems like same issue: Using alot 0.9 (or more accurately 0.9-2 from Debian unstable) emails behaved correctly, but with 0.9.1 (or git snapshot of 0.9.1 from Debian packaging git) I get tofu characters for non-ascii characters. Example header which fails to render correctly contains this: Content-Transfer-Encoding: quoted-printable So this issue seems not a broken configuration locally for @guijemont and happens also when source email is not UTF-8 encoded. |
...and for me it also makes the issue go away to revert b1c93c4 |
@ryneeverett can you comment on this? |
I cannot reproduce this and wonder if there isn't a mailcap elsewhere on your system. See https://docs.python.org/3/library/mailcap.html#mailcap.getcaps. Can you confirm the following @guijemont? $ python
>>> import mailcap
>>> mailcap.getcaps()
{}
>>> |
See #1526. This fixes the issues I see with utf8 and a maiilcap entry but I'm not convinced this is the same issue you're facing. Further review of the code further convinces me that you have some entry for |
I can confirm that I see the same issue as @guijemont reports, displaying the message in I do not have
accordingly, |
FWIW, I have the following
Will try #1526. Also, I am a bit confused, not knowing the usual workflow on this project: why is this issue closed if the pull request is not merged yet? |
Closing this was an accident sorry |
I have an email that may or may not be related:
This one never gets displayed correctly, neither with or without the quotes, and not by notmuch as you show above.. Is this message simply broken? The strange thing is that notmuch does find it when I search for "grüße":
|
Just updated to latest master with #1526 merged. It does seem to fix the main issue for me (non-ascii utf-8 characters are displayed correctly), though
|
But this is to be expected: togglesource will result in alot displaying the email's source text verbatim,
including not yet decoded quoted-printables.
|
In this case, the problem is that what is displayed is precisely not the verbatim source (which is not quoted-printable), which I am pasting here for completeness:
Notice the difference in the |
@guijemont you are right, this is weird. >>> m=ui.current_buffer.get_selected_message()
>>> e=m.get_email()
>>>
>>> # This is what alot shows (see widgets.thread.MessageTree)
>>> str(e)
'From: lucc@github\r\nTo: tests@alot\r\nSubject: plain utf8 8bit message\r\nMIME-Version: 1.0\r\nContent-Type: text/plain; charset="utf-8"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\nLiebe Gr=C3=BC=C3=9Fe!\r\n'
>>>
>>> # This is the content of the file.
>>> open(m.get_filename()).read()
'From: lucc@github\nTo: tests@alot\nSubject: plain utf8 8bit message\nMIME-Version: 1.0\nContent-Type: text/plain; charset="UTF-8"\nContent-Transfer-Encoding: 8bit\n\nLiebe Grüße!\n' So I suggest we replace https://github.com/pazz/alot/blob/master/alot/widgets/thread.py#L260 |
Before you submit a bug report, please make sure that the issue still exists on the master branch!
Describe the bug
I have a bunch of emails with headers that contain:
Though in all the examples I could find, several headers were in-between these two. For all these emails, non-ascii characters appear incorrectly. Looking at the debug log, I see for these messages that the
Content-Transfer-Enconding
is misinterpreted:Worthy of notes, I have found another
quoted-printable
email that is correctly displayed, with the headers looking like:Note that unlike in the previous case, the charset is not between quotes.
In that case, non-ascii characters are displayed properly, and the debug log yields:
Software Versions
To Reproduce
Steps to reproduce the behaviour:
quoted-printable
Error Log
See description of the bug.
The text was updated successfully, but these errors were encountered: