the-djmaze / snappymail

Simple, modern & fast web-based email client
https://snappymail.eu
GNU Affero General Public License v3.0
924 stars 109 forks source link

invalid radix64 character 2D skipped / read_block: read error: Invalid packet #1608

Closed Massedil closed 1 month ago

Massedil commented 1 month ago

Describe the bug

JavaScript alert() pop-up with errors when replying to an email :

invalid radix64 character 2D skipped.
invalid radix64 character 2D skipped.
invalid radix64 character 2D skipped.
invalid radix64 character 2D skipped.
invalid radix64 character 2D skipped.
invalid radix64 character 2D skipped.
invalid radix64 character 2D skipped.
invalid radix64 character 2D skipped.
invalid radix64 character 2D skipped.
invalid radix64 character 2D skipped.
[don't know]: invalid packet (ctb=04).
read_block: read error: Invalid packet

To Reproduce

  1. Just reply to the specific email.

Let me know if you need specific header or content from this email to reproduce.

In fact, I don't know how to reproduce because if I try to reply again to the email, it works. Related to network error ?

Expected behavior

No pop-up and the error is handled !

Screenshots If applicable, add screenshots to help explain your problem.

Please complete the following information:

the-djmaze commented 1 month ago

Sounds like a problem with PGP/GPG as if the it can't import keys or decrypt message or verify signed message.

So do you use encryption?

Massedil commented 1 month ago

So do you use encryption?

No.

Massedil commented 1 month ago

So do you use encryption?

No.

At least I don't remember having done anything to activate it, but may be some default options are activated. But I don't have a pgp key configured for my account. But I sometimes receive pgp signed emails. Maybe I opened a signed email before trying to reply to another and got this error.

the-djmaze commented 1 month ago

The problem is the Autocrypt header of the email. When you reply, the Autocrypt header is parsed and the PGP key is imported on the server and in OpenPGP.js

https://github.com/the-djmaze/snappymail/blob/614c7ace445074ff20f7a8d3f6afbb8eba151f73/dev/View/Popup/Compose.js#L914-L921

So something is wrong with the Autocrypt header. Can you forward such email to me? To issue-1608@snappymail.eu is fine

Massedil commented 1 month ago

Can you forward such email to me?

I sent by email the problematic Autocrypt header to you. Let me know !

the-djmaze commented 1 month ago

Could you send the whole message and not just the Autocrypt header?

Massedil commented 1 month ago

I just sent you a whole message that triggers the problem described here. Let me know !

the-djmaze commented 1 month ago

The Autocrypt header ends with nrzCXopEosI= But the javascript code .split('=') and .split('=', 2) dropped the last = and failed.