MIME Multipart Messages

Created on 2021-01-23T20:46:58-06:00

Return to the Index

This card can also be read via Gemini.

Allows you to stuff more than one payload in to a block of text.

Each payload is noted by a special boundary marker and a new header allowing each payload to have its own meta-data.

I looked this up while thinking of ways to store meta-data for outlines while still being a plain text file.

Example

Header includes these:

MIME-Version: 1.0 
Content-type: multipart/mixed; boundary="simple boundary" 

Message then looks like this:

preamble, to be ignored but can have text for clients that do not support mime properly
--simple boundary

a content chunk
--simple boundary
Content-type: application/x-shitpost

another content chunk but with metadata
--simple boundary--
note the boundary ends with two dashes. postamble, same as preamble

Grammar for boundaries

boundary := 0*69 bcharsnospace 

bchars := bcharsnospace / " " 

bcharsnospace :=    DIGIT / ALPHA / "'" / "(" / ")" / "+"  / 
"_" 
               / "," / "-" / "." / "/" / ":" / "=" / "?" 

References