multipart

Oct. 4th, 2014 10:39 pm
marnanel: (Default)
[personal profile] marnanel
Today I received an email from someone who said they'd attached a file I needed, but I couldn't see the attachment. After some digging, I found that the message was structured like this:

multipart/alternative: (i.e. "these are alternative versions of the same thing")
-- text/plain (a version of the message in plain text)
-- multipart/related: (i.e. "these parts belong together")
-- -- text/html (a version of the message in HTML)
-- -- the attachment

So if your email program shows HTML for preference, you would see the attachment, but if it shows plain text for preference (as mine does), you wouldn't. Of course it *should* have been structured like this:

multipart/related: (i.e. "these parts belong together")
-- multipart/alternative: (i.e. "these are alternative versions of the same thing")
-- -- text/plain (a version of the message in plain text)
-- -- text/html (a version of the message in HTML)
-- the attachment

Date: 2014-10-05 03:40 am (UTC)
From: [personal profile] treeowl
Oooops.

Date: 2014-10-05 06:56 am (UTC)
simont: A picture of me in 2016 (Default)
From: [personal profile] simont
I summarised this out loud to a few friends last night, in gobsmacked disbelief, and one of them pointed out that the first structure would actually have made perfect sense if the attachment had been something that really did belong to the HTML part specifically – e.g. a stylesheet, or a purely presentational image.

That cured me of my gobsmacked disbelief – at least now the sending MUA only got the wrong one of two MIME structures with sensible purposes, rather than inventing something so weird it could not possibly have been useful for anything :-)

Date: 2014-10-06 10:05 am (UTC)
simont: A picture of me in 2016 (Default)
From: [personal profile] simont
And, coincidentally, this morning I received an email with the same issue. In this case the attachments are images referred to from the HTML part by "cid:..." type URIs – but they're not letterheads and logos and backgrounds and purely presentational stuff, they're screenshots that are part of the bug report contained in the email, so they ought to have been MIME-structured as not specific to the HTML part. Unfortunately, the MUA would probably have had to be AI-complete to tell the difference between the two cases :-/

Profile

marnanel: (Default)
Monument

January 2022

S M T W T F S
      1
2345678
9101112131415
1617 1819202122
23242526272829
3031     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 18th, 2025 05:10 am
Powered by Dreamwidth Studios