Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mu4e-action-view-in-browser doesn't work with inline attachments... #758

Closed
avar opened this issue Jan 6, 2016 · 3 comments
Closed

mu4e-action-view-in-browser doesn't work with inline attachments... #758

avar opened this issue Jan 6, 2016 · 3 comments
Labels

Comments

@avar
Copy link
Contributor

avar commented Jan 6, 2016

...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.

@djcb
Copy link
Owner

djcb commented Jan 6, 2016

Perhaps this can be combined with
#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.)

@avar
Copy link
Contributor Author

avar commented Jan 12, 2016

Looks relevant, but FWIW I just get Wrong type argument: stringp, nil on the code posted in that pull request...

@djcb
Copy link
Owner

djcb commented Nov 9, 2023

Oh, in the mean time this got implemented (re-using the gnus functionality). Took a few years :-) Closing.

@djcb djcb closed this as completed Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants