emersion / hydroxide

A third-party, open-source ProtonMail CardDAV, IMAP and SMTP bridge
MIT License
1.56k stars 120 forks source link

Messages with Content-Disposition: inline have extra mime boundary #176

Open tofurky opened 3 years ago

tofurky commented 3 years ago

In the client I'm using (Claws Mail), I've noticed reply e-mail bodies from specific senders on a couple different mailing lists are consistently not visible.

Taking a closer look at the message sources from hydroxide (in Claws), it seems there is an additional multipart/mixed boundary inserted. This probably explains why nothing is rendered. The extra boundary is not there when exporting via webmail.

Eventually, I realized that all of the bad e-mails have Content-Disposition: inline in common. Out of 4138 total e-mails, 56 are inline, and all 56 have the extra (or missing, depending on how you look at it) mime boundary.

From hydroxide:

...
Content-Type: multipart/mixed;
 boundary=8ad393888e5ce8447de814f5a534aae0712b4027

--8ad393888e5ce8447de814f5a534aae0712b4027
Content-Type: multipart/mixed;
 boundary=bc287a9fac8133c1cb19f398f7126116808a4a964e62582cd2f413c58fe0;
 charset=utf-8

Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

...

--8ad393888e5ce8447de814f5a534aae0712b4027--

Exported from webmail:

...
Mime-Version: 1.0
Content-Type: multipart/mixed;boundary=---------------------c63ce29a727c13a6ec4cfaf98e903ee7
Content-Disposition: inline
...
-----------------------c63ce29a727c13a6ec4cfaf98e903ee7
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;charset=utf-8

...

-----------------------c63ce29a727c13a6ec4cfaf98e903ee7--

Please let me know if the unredacted messages are needed. I could send to the e-mail address from git commits. I will attach the redacted e-mails below.

For completeness, I did rebuild with https://github.com/emersion/hydroxide/pull/129 but it did not fix the issue.

tofurky commented 3 years ago

webmail_redacted.txt hydroxide_redacted.txt