mu4e-action-view-in-browser doesn't work with inline attachments...
...since it just takes the HTML part, saves it to /tmp/$random.html, and opens it.
I have some mails that have a HTML part, and then a bunch of attechments (e.g. 01.png, 02.png, ...) and reference those parts as <img src="cid:01.png@$CID"> where $CID is the content-id noted in the Content-ID header with the MIME attachment.
A simple approach that would work for this would be:
- Save the HTML part to /tmp/$RANDOM/$name.html
- Save all the attachments to the same /tmp/$RANDOM
- Run s/^cid:(.*)(?:@[^@]+)$/$1/g on all the
<img src="...">fields
Just filing it here in case anyone's interested, or so others can point out any glaring flaws in this plan. Doing the above manually worked with some E-Mails I have.
Perhaps this can be combined with https://github.com/djcb/mu/pull/750 ?
There are some function to save attachments (both mu and mu4e) that might help. Typically, we try to put each attachment in a separate directory, since they may not have unique names. Though cid:'s should do so. Perhaps we try to somehow disable javascript for the shown messages.
(In the 'mug' html-viewer I take a slightly different approach, by hooking the browser's requests for the cid: parts, and then delivering the images. But the approach sketched here is probably easier for the use-case.)
Looks relevant, but FWIW I just get Wrong type argument: stringp, nil on the code posted in that pull request...
Oh, in the mean time this got implemented (re-using the gnus functionality). Took a few years :-) Closing.