gophermail icon indicating copy to clipboard operation
gophermail copied to clipboard

Only use multipart/mixed when both a plain text and HTML body are given

Open porjo opened this issue 11 years ago • 3 comments

My email client, Thunderbird, has the option of viewing a HTML message as plain text. For messages that don't include a separate plain text part, Thunderbird performs some kind of auto-conversion to strip the HTML markup. I imagine other email clients would offer the same feature.

I've found that this doesn't work for email generated by Gophermail where only BodyHTML has been defined. The following is from one such email:

...
Mime-Version: 1.0
Content-Type: multipart/mixed;
 boundary=0acfc1a3bb97d32953b7758c3db581947e8cbcfe4cddb12eeb0daef24608
Status: RO

--0acfc1a3bb97d32953b7758c3db581947e8cbcfe4cddb12eeb0daef24608
Content-Type: multipart/alternative;
 boundary=9f5d8d4299aaef05e05bb84d27ee8017f5f7b4968c7b7e307a1e7f98259a

--9f5d8d4299aaef05e05bb84d27ee8017f5f7b4968c7b7e307a1e7f98259a
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
...

I assume the reason that Thunderbird displays a blank messages is that it is simply honouring the blank multipart/alternative part.

Wouldn't it make more sense where Body or BodyHTML has not been defined, to not create the message as multipart/mixed?

porjo avatar Mar 13 '14 04:03 porjo

That seems reasonable to me. I'll be catching up on gophermail TODOs soon and will see about getting this change in as well. Thanks for the feedback! This is great info and I'll try to test in Thunderbird as well to verify that this fixes it.

jpoehls avatar Mar 17 '14 13:03 jpoehls

It would be great to use the multipart boundary if possible. What is the stat of that task ? Thus we could use HTML + the plain text fallback.

kursion avatar Jun 08 '15 16:06 kursion

@kursion: Sorry about the late reply. This is still something I'd love to get done but I just don't have to time to work on gophermail right now. More than happy to accept a pull request that addresses this though.

jpoehls avatar Jul 25 '15 15:07 jpoehls