When our organization switched from receiving email locally to using a gmail server, mutt became awkward at best and that was the end of that. Apparently mutt could be set up to interact with gmail via IMAP, but I never got involved with that.
The big win switching to Thunderbird was that it handled embedded html and mime attachments properly without rocket science level exploits on my part.
What I do is to use "v" to tell mutt to view attachments (the first is in most cases the "text/plain" element that mutt has already shown me. The "s" key will save an attachment (so if somebody sends me an image, I can save it, then exit mutt and look for it on disk and use display to view it. Better yet is to use the "|" key to pipe it to a command (like display). If I just hit return though, mutt does something stupid and this is what I would like to fix.
Two files seem to govern what goes on.
The first, /etc/mime.types
is apparently a comprehensive list of every known mime type with an optional
suggestion for a file extension to go with it, and does really seem relevant
to the current discussion.
The file /etc/mailcap seems to exist for mutt only
(though this is not really true).
For a given mime type it indicates an application which should be run.
What I did was to edit this file and replace the line:
image/*; /usr/bin/xdg-open %swith
image/*; /usr/bin/display %s(A side note here, if you read section 5.4 of the mutt manual, you will find the following mailcap line suggested. Note that the final "flag" copiousoutput will cause this to display attachments while in the pager and without entering the attachment viewer if used in conjunction with an auto_view line in the muttrc file.)
image/*; anytopnm %s | pnmscale -xsize 80 -ysize 50 | ppmtopgm | pgmtopbm | pbmtoascii ; copiousoutputAnyway, after hacking mailcap, everything works great. So the question is what is wrong with xdg-open? This disfunctional thing is a 469 line shell script that claims to open a file or URL in the "user's preferred application". Whatever that might be!! What it seems to try to do is to divine what desktop (KDE or gnome or whatever) a user is running, and then pass the file or url to some universal handler (like gnome-open) for the desktop in question. It will use mimeopen if it fails to figure out the desktop. My solution of hacking the mailcap file works for me and is fine on my system where I am the only user, so I am not bothering to dive deeper into xdg-open and its cronies.
Adventures in computing / tom@mmto.arizona.edu