On Tuesday 10 April 2018 15:57,
Yubin Ruan <ablacktsh...@gmail.com> put forth the proposition:
Hi,
Can anyone share some approaches for reading HTML emails.
Currenlty I use w3m:
text/html; w3m -I %{charset} -T text/html; copiousoutput;
But sometimes I receive some HTML mails which can not be handled that well by
w3m, so I want to open that html attachment in a browser. How can I switch
between?
Yubin
What I did was make a shell script to save the mail and open it in
elinks when autoview didn't autoopen it for some reason. You can
easily change elinks to another browser:
#!/bin/sh
TMPFILE="/tmp/mutt-elinks.html"
cat /dev/stdin > "$TMPFILE"
sed -ri "s%^(Date:|From:|To:|Cc:|Subject:|X-Mailer:)(.*)%\1\2\<br\>%g"
"$TMPFILE"
elinks -force-html "$TMPFILE"
rm -f "$TMPFILE"
And the macro:
macro pager,index,attach Z "|~/.mutt/elinks<enter>"
The sed line is just to add line breaks to the headers.