Open nmmull opened 1 year ago
Nathan Mull @.***> writes:
Also note that there are multiple subtypes for the message mime type. The only one that is pertinent here is rfc822. Dealing with the other two subtypes should probably go on the docket, but perhaps a bit further in the future.
I forgot about that. I used to use the partial type a lot, back in the day when it was common for MTA's to reject "big" messages -- like, more than 512K[1]! Gnus would ask if it should split a message bigger than that, and if you said yes, it would send maybe three partial emails! And it would also let you mark a set of partials in your inbox and it would reassemble them. I don't think many MUAs actually did that (and I'd be impressed if any modern ones even bother with the partial subtype), but it definitely worked sending emails between me and Peggy.
Footnotes: [1] I forget the exact number...
One of the benefits of using
mrmime
overocamlnet
is thatmrmime
handles messages. To handle messages withocamlnet
, we basically have to:is_message
to check if an email of the form(header, `Body body)
is a message, which means checking its content-type by looking atheader
.body
usingof_string
. There are two options here. Either put everything in theresult
monad or simply don't recurse if parsing fails.replace_attachments
on the resulting parse tree.to_string
and put back into the body of the message.Note that this has to be done for both the
`Body
case and the`Parts
case, as they are handled slightly differently.Also note that there are multiple subtypes for the message mime type. The only one that is pertinent here is
rfc822
. Dealing with the other two subtypes should probably go on the docket, but perhaps a bit further in the future.