ProtonMail / proton-bridge

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

header key contains invalid characters #478

Open digrouz opened 1 month ago

digrouz commented 1 month ago

Hello,

I'm trying to move some email from other accounts into my proton account using Thunderbird / Evolution through proton-bridge 3.11.0.

For some emails I get the following error:

ERRO[May 23 18:26:58.058] Command failed                                cmd="APPEND 
'3fMafAzf09roX8CpZDkW+Y7VCzJd7XNbG6/8S2Y5N3A=' Flags='[\\SEEN]' DateTime='2005-03-26 20:55:42 +0000 zone'" 
error="header key contains invalid characters" pkg=gluon/session session=295

Here are headers of one by example:

  From HIDDENSENDER sat mar 26 20: 55:42 2005
  X-Mozilla-Keys:
  Message-Id: <[BAY10-F4862139F5CB330F7D1752DE1420@phx.gbl](mailto:BAY10-F4862139F5CB330F7D1752DE1420@phx.gbl)>
  Reçu: from 82.174.205.189 by by10fd.bay10.hotmail.msn.com with HTTP; Sat, 26 Mar 2005 20:55:42 GMT
  Content-Transfer-Encoding: 8bit
  X-Originating-Ip: [82.174.205.189]
  X-Priority: 3
  X-Msmail-Priority: Normal
  X-Originating-Email: [[HIDDENSENDER](mailto:HIDDENSENDER)]
  X-Mimeole: Produced By Microsoft MimeOLE V6.00.2900.2180
  X-Sender: [HIDDENSENDER](mailto:HIDDENSENDER)
  De: 
  À:
  Objet: ezfezrfdezrd
  Date: Sat, 26 Mar 2005 20:55:42 +0000 (26/03/2005 21:55:42)
  Mime-Version: 1.0
  Content-Type: text/plain; format=flowed; charset="iso-8859-1"
  X-Stn-Info:
  X-Evolution-Source: a4ce216a997c7574a20970c4926556d9d4cd5a5a

How can I solve it ?

digrouz commented 1 month ago

just tested with 3.11.1, i have the same behavior

zwets commented 1 month ago

I would guess the cedille in Reçu and the grave in À are the culprits. As far as I can tell, the keys of email headers must still be 7-bit ASCII, even if the header values can be UTF-8 (provided all SMTP relays in the chain support this).

I'm especially surprised to see that "À:" header, because the "To:" header (with the literal key To:) is governed by several (age old) RFCs. Just out of curiosity, where do these translated headers come from?

digrouz commented 1 month ago

seems like it's Evolution that translates some headers, looking at the same email inside thunderbird, headers looks like following:

    X-Mozilla-Keys:                                                                                 
    Message-ID: <BAY10-F4862139F5CB330F7D1752DE1420@phx.gbl>
    Received: from 82.174.205.189 by by10fd.bay10.hotmail.msn.com with HTTP; Sat, 26 Mar 2005 20:55:42 GMT
    Content-Transfer-Encoding: 8bit
    X-Originating-IP: [82.174.205.189]
    X-Priority: 3
    X-MSMail-Priority: Normal
    X-Originating-Email: [HiddenSender]
    X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    X-Sender: HiddenSender
    From: "HiddenSender" <HiddenSender>
    To: HIDDENRECEIVER
    Subject: ezfezrfdezrd
    Date: Sat, 26 Mar 2005 20:55:42 +0000
    MIME-Version: 1.0
    Content-Type: text/plain;
        format=flowed;
        charset="iso-8859-1"
    X-Stn-Info:  

there, no "ç" neither "à".