ProtonMail / proton-bridge

Proton Mail Bridge application
GNU General Public License v3.0
1.11k stars 145 forks source link

Illegal base64 data prevents importing of emails #452

Closed yu-tendo closed 6 months ago

yu-tendo commented 6 months ago

Description of the problem

The email cannot be imported with the Proton Mail Bridge due to a parsing error of the message. When moving the message (with Thunderbird), the following error messages is printed:

  1. illegal base64 data at input byte 306 (see attached example, issue-1.txt)

Comment

I assume the issue is caused by the linebreaks within the base64 string. Thunderbird is able to parse this message.

I am not sure if it is possible to fix this issue, as it might be the case that the e-mail is simply faulty (i.e., the respective issue cannot be corrected automatically). However, identifying manually the faulty e-Mails while actually moving thousands of e-Mails is very time-consuming. Thus, I would expect that at least the email-moving process is not interrupted and the faulty emails are skipped. Assuming the bridge cannot handle the parsing issue, I suggest that a respective FAQ entry (or similar) is created covering an explanation of the issue and how to potentially manually fix this issue (otherwise users will keep opening new issues).

Version Information

Proton Mail Bridge v3.8.1 (br-187) Thunderbird 115.6.0 (64-bit) Microsoft Windows 10

File Attachments

issue-1.txt

LBeernaertProton commented 6 months ago

I'm not sure we can consider this a bug, since the data that was provided is invalid. We could look into making the base64 decoder a bit more lenient toward these cases, but I can't make any promises. I'll check with the team once they return from their holidays.

Finally the Bridge has no control over the process of importing the email. The IMAP client is the one who manages the import process and what should happen if one of the messages fail to import.

yu-tendo commented 6 months ago

Thanks for the explanation. Thunderbird seems to display the message correctly, that's why I thought it is an issue with the bridge. I attached an image of how Thunderbird displays the e-Mail. To my understanding, the base64 string is valid (there are just some strange line breaks), so I would assume the parser just need to be a bit more "flexible".

example-image-email

LBeernaertProton commented 6 months ago

After discussing with my colleagues, it was agreed that at this point in time, we won't relax the parsing rules.