On 16Nov2015 12:03, Magicloud Magiclouds <magicloud.magiclo...@gmail.com> wrote:
Using Mutt, one pain is dealing with multi-media emails. Yes, with
w3m, I could almost read the email. And I could save the pictures then
view them. But this is too much work if I repeat it too many times.

So is there a way that, I could press a hotkey in Mutt, it would pipe
current email to some converter then open browser with the result
webpage?

In principle, sure. You need a tools to unpack a MIME message. The "munpack" command will do that; it is part of a package called "mpack" or "mimetools" IIRC; you may need to find it and install it, depending what platform you're using.

Then write a tiny shell script to create a temporary directory and run (untested):

 munpack -C your-temp-dir

which presuming you're piping into the script from mutt; munpack will read from stdin or from named files. Then open your temp directory as you see file. I'm on a Mac and would probably just issue the command:

 open your-temp-dir

which will pop up a Finder window on that directory. If you want to hand it to a web browser you want the URL:

 file:///full/path/of/your-temp-dir

I've been meaning to set this up recently myself; I'm going to bind it to the "V" key (how often do you need to look up mutt's version anyway), since "v" is the "view attachments" menu.

[...hacks...] Ok, script here:

 https://bitbucket.org/cameron_simpson/css/src/tip/bin/mail-open-attachments

and I've bound it like this:

 macro index,pager V "<pipe-message>mail-open-attachments<enter>" "extract 
attachments to temp dir and open"

Cheers,
Cameron Simpson <c...@zip.com.au>

Reply via email to