ProtonMail / proton-bridge

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

"Unexpected char '" error when importing messages with certain List-Post/List-Help headers #393

Closed neobrain closed 11 months ago

neobrain commented 1 year ago

Thunderbird fails to move mails with certain List-Post/List-Help headers to mailboxes managed by proton-bridge. The error printed upon trying is The mail server for account <xyz> responded: Unexpected char ' (I'm guessing Thunderbird cuts off the message by accident?).

The failure seems to be due to proton-bridge (gluon?) being unable to parse such messages. Two example headers that trigger the issue are:

List-Post:<a@b.org>
List-Help:<a@b.org>

(Note the lack of space after :)

Expected Behavior

The mail should import into the managed ProtonMail account without issue.

Current Behavior

Bridge fails to parse the message and hence Thunderbird reports an error.

Possible Solution

Probably an edge case in gluon's message parsing code? Bridge 2.x didn't have problems handling these messages.

Adding a space to the headers (List-Post: <a@b.org>) resolves the issue.

Steps to Reproduce

  1. Create an empty .eml file and write List-Post:<a@b.org> to it
  2. Try to import the file into a Proton account (e.g. by drag-and-dropping it into a mailbox folder in Thunderbird)

Version Information

proton-bridge 3.2.0

Context (Environment)

The specific format is used by the mailing list software used by an industry consortium I participate in. A mailbox filter of mine moves those mailing list messages from a non-Proton mailbox to my Proton mailbox.

LBeernaertProton commented 1 year ago

Hey @neobrain , thanks for the report.

I've just double checked the specs and it seems we are incorrectly enforcing a white space after the header field :. We have internally tracked this issue as GODT-2670.

gabor-meszaros commented 11 months ago

@neobrain This issue was solved in the latest production. Please take a look at it, and reopen this issue if it still doesn't work for you. Thank you for reporting it!

neobrain commented 11 months ago

@neobrain This issue was solved in the latest production. Please take a look at it, and reopen this issue if it still doesn't work for you. Thank you for reporting it!

Thanks Gabor, I've already tested on the beta channel and the issue has been resolved indeed :)