[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: auxiliary mail client for HTML



On Tue 12 Nov 2019 at 09:23:54 (-0000), Curt wrote:
> On 2019-11-08, Nate Bargmann <n0nb@n0nb.us> wrote:
> >
> >> I thought everybody just used a mailcap file and was fine.
> >
> > I do and have it setup to use w3m to deal with most HTML mail.  Some
> > does look better in a GUI program and that's why I do this.
> >
> 
> Well, then
> 
>  text/html;  /usr/bin/firefox %s >/dev/null 2>&1; needsterminal
>  text/html;  elinks -dump %s; nametemplate=%s.html; copiousoutput
> 
> Or something like it. Needing or preferring a gui client doesn't seem
> preclude using a mailcap file (or vice versa). 
> 
> I'm not a mutt user, though, so maybe I got it wrong. I also forgot what
> the "this" was in the "that's why I do this" above.

The following is what I use in my mailcap-mutt file. My priorities
in handling HTML emails at all (which I believe should only be
exchanged between consenting adults) are to disentangle running
text into paragraphs and then colour them so that the parties to
the conversation can be distinguished:

## The first occurrence takes priority
# the next line is used immediately the email is opened, so you don't see the text alternative
#text/html; /usr/bin/html2text; copiousoutput
# the next line is used immediately the email is opened, so you don't see the text alternative
#text/html; /usr/bin/w3m -dump -T text/html; copiousoutput
# the next line is used only when an html attachment is selected in the attachments menu
text/html; /usr/bin/lynx -force-html -localhost -stdin
# the next line is used only when an html attachment is selected in the attachments menu
#text/html; cat | /usr/bin/elinks -dump -dump-color-mode 4 -force-html -localhost 1 | less -r
# the next line is used immediately the email is opened, so you don't see the text alternative
#text/html; /usr/bin/elinks -dump -force-html -localhost 1; copiousoutput

The mailcap file is triggered by the lines:

auto_view	text/html # immediate display (without v command), assumes mailcap support
set		mailcap_path=$HOME/.mutt/mailcap-mutt # needed for auto_view

in my ~/.mutt/muttrc file. As you can see, I prefer to have to choose
to read the HTML whenever the text version is indecipherable, rather
than having it pop up straight away (in favour of the text version).

I might consider using a GUI to display the HTML, but not unless I can
find a browser that has the equivalent of -localhost, which none does¹.
With lynx I can see the links and list them, but not follow them. For
that I use cut and paste.

(On which topic, it took me a while to stumble on this xterm resource:
XTerm*cutNewline:               false
which prevents triple-clicking from including the newline.)

¹ Suggestions welcome.

Cheers,
David.


Reply to: