-
Notifications
You must be signed in to change notification settings - Fork 58
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
crash when uploading locally created no-utf-8 encoded message #43
Comments
Another user reported the same issue at |
I'm affected by this as well. I'm using Danish characters in my email signature and have Exciting with the Python 3 version of OfflineIMAP! |
Like @ahf , I have noticed this on sent mail using mutt as well. Furthermore, the patch listed at Debian bug 981485 will result in issues when the message is synced to an IMAP server since the encoding is hard coded to utf-8 and will result in a discrepancy between the content type listed in the email header and the actual encoding. In other words the email will be encoded for 'utf-8' but say it's encoded as 'iso-8859-1' resulting in mangled text when viewed in an email client. So a proper fix would either need to mangle the original message to change the encoding type, or the code will need to factor in and store the encoding so that it can be properly encoded/decoded at various points throughout the software. A work around in the interim is to set send_charset = "us-ascii:utf-8" and avoid using other charsets like 'iso-8859-1'. The change to mutt to fix this offlineimap bug is not ideal but will sidestep the issue of composing messages in mutt for the time being at the cost of a few extra bytes here and there. |
The hard coded use of utf-8 is likely the cause of bug #44 as well |
I am affected by this bug as well (the change of encoding from utf-8 to iso-8859-1 is not due to German umlauts in my case, but to the “&” character). Being the user who reported bug #44, I think that the two bugs are probably related indeed. |
Hello, this bug is very interesting, but IMO, it is hard to solve it in the right way :-) I will try to explain it:
This function reads the message as text, (
The problem is we need make more changes in other parts. We need check the header to read some values. IMO, there are three options to solve the problem:
I will try with the last option, because it is backward compatible with offlineimap2 and it is faster than option 1 (I am very very busy these days) Regards, PS. I won't close this bug, because I will try to check the option 1. |
This patch includes charset detection to read the message. This patch is related to issue OfflineIMAP#43 Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
@thekix - I have made significant progress with option 1 with #48, if you have time to give it a look.... I can create a pull request if desired as I am just getting to testing the changes. The problem with option 3 is that it won't work given that messages can contain multiple encodings and simply detecting one the encoding doesn't save you when you go to write it back to the server. I will explain further in #53 comments. |
Hi @jishac Of course, IMO the option 1 is the best. I was checking your repo/patch, amazing! Some comments: Please double check the syntax, for example, some spaces here:
I think you are replacing the function "get_message_date()" (file emailutil):
IMO is better change it in the same file. Take a look that you are changing all calls:
Please, could you create a new pull request with these changes and with the current offlineimap status? (remove my stuff and include your code). Again, thanks a lot for your amazing work!! Best regards, |
Should finalize implementation of enhancement OfflineIMAP#48 OfflineIMAP#48 And fix issues OfflineIMAP#43 and OfflineIMAP#44 OfflineIMAP#43 OfflineIMAP#44
…s well and I reviewed the code several times. However, I cannot test it, testers wanted! This commit: Minor bug fixes from testing Should finalize implementation of enhancement OfflineIMAP#48 OfflineIMAP#48 And fix issues OfflineIMAP#43 and OfflineIMAP#44 OfflineIMAP#43 OfflineIMAP#44 Signed-off-by: Joseph Ishac <jishac@nasa.gov> Tested-by: Joseph Ishac <jishac@nasa.gov>
Hello @sudipm-mukherjee probably we can close this bug. Is it ok? Regards! |
@thekix yes, sorry I forgot to close it after packaging the fix in Debian. |
Thanks!! |
General informations
offlineimap -V
): 0.0~git20210105.00d395b+dfsg-2Logs, error
Steps to reproduce the error
Details at the Debian bug report. But a summary is:
The text was updated successfully, but these errors were encountered: