On 08Oct2022 21:55, Jan Eden via Mutt-users <mutt-users@mutt.org> wrote:
Thank you! This works well with Epiphany, but Firefox still fails
(which
I do not care about, as long as I have a working browser option).
My recollection is that this is a timing issue. To run the viewer mutt
goes:
- make a temp file containing the message or html
- run the mailcap command
- remove the temp file
Your command is "open", which tells firefox (your default browser) to
open the file for viewing. That message takes little time. By the time
firefox gets around to opening the file (probably after making the new
browser window) the file has been removed by step 3 above.
This is why helper scripts like Chris Green's one take a copy of the
file. They tell the browser to view the copy, which does not get
removed.
As a hack, you might find it enough to include a short sleep in your
command, enough to allow firefox to latch onto the message:
open %s && sleep 3
My personal process, which is by no means seamless, is a macro bond to
my "V" key:
macro index,pager V "<pipe-message>mail-open-attachments<enter>" "extract
attachments to temp dir and open"
macro attach V "qVv" "extract attachments to temp dir and open"
and the associated script is here:
https://github.com/cameron-simpson/css/blob/main/bin/mail-open-attachments
Like Chris' script, it makes a copy.
It unpacks everything in the message into a directory, then opens the
Finder on that directory. Then I can use preview on the HTML or open it
in Firefox. Etc etc for whatever other attachments there may have been.
Cheers,
Cameron Simpson <c...@cskk.id.au>