Going GUI...er
Chris Green
cl at isbd.net
Sat Apr 4 09:00:53 UTC 2020
On Sat, Apr 04, 2020 at 09:41:59AM +0200, Vegard Svanberg wrote:
> Hi,
>
> I love Mutt.
>
> However, I'm increasingly finding myself having to resort to various
> tricks to deal with HTML only emails (with picture attachments),
> calendar invites, and other oddities and awkward stuff people send.
>
> My Holy Grail, which would be a native Mutt GUI client, I guess, doesn't
> seem to exist.
>
> I don't know how I would survive with a regular GUI client like
> Thunderbird or Evolution. I've tried, but they all suck. Mutt's
> keybindings, search and navigation features are irreplaceable.
>
> Currently I'm running Mutt from a machine which I ssh into from 5 other
> computers I use frequently (IMAP backend - self-hosted).
>
> Suggestions? What does everyone else do?
>
I run mutt similarly on my home desktop and ssh into that from a
laptop when I'm away or elsewhere in the house.
To view HTML E-Mails which are beyond lynx or whatever I fire the
E-Mail at my browser (firefox).
So my the relevant bits of .mailcap on my desktop machine are:-
text/html; /home/chris/bin/muttfox %s
text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html
... and muttfox is:-
#!/bin/bash
#
#
# muttfox: script called by mutt via mailcap to use firefox to view HTML, and
# also some types attachments, currently:- PDF, JPG
#
# It is necessary for HTML files because /usr/bin/firefox exits
# before firefox has actually loaded the HTML file, this is especially
# true when it's remote but it also happens when running locally.
#
# It's not actually necessary for PDF and JPG files but it speeds up
# remote (i.e. running mutt via ssh) viewing considerably because it
# doesn't run the viewing program across the X connection. It works
# OK for local files so everything works the same.
#
# The temporary file to be viewed by Firefox is copied to directory
# /srv/mutt on esprimo if running locally or to the same place on the
# remote system if running via ssh. The copy to the remote system is
# done via an ssh reverse tunnel on port 50022 using a passwordless key
# and rrsync at the remote end to make it reasonably secure.
#
dir=/srv/mutt/
#
#
# if there's no DISPLAY variable then Firefox can't run, so skip the whole thing
#
if [ -n "$DISPLAY" ]
then
chmod 0644 $1
if [ -n "$SSH_CLIENT" ]
then
rsync -e 'ssh -p 50022 -i /home/chris/.ssh/np_id_rsa' $1 localhost:$(basename $1)
else
cp $1 $dir$(basename $1)
chmod 0644 $dir$(basename $1)
fi
/usr/bin/firefox http://localhost/mutt/$(basename $1)
fi
#
#
# Clear out any old files left on esprimo by this script, doing it here
# saves adding a special crontab task (but a crontab task is needed on
t470)
#
find $dir -mtime +7 -exec rm {} \;
Because of the way that Firefox works the E-Mail pops up in the
existing Firefox running on the remote client machine, I'm not sure if
other browsers do the same sort of thing. Oh, esprimo is my desktop
machine and t470 is my laptop, the above works both when the laptop is
at home on my LAN and when away somewhere more remote.
--
Chris Green
More information about the Mutt-users
mailing list