Some tools such as the command-line email client
neomutt can launch graphical applications. In order
to select which application for which file, mutt uses the mailcap
system, provided by the mime-support package.
mailcap gets its default informations from two sources: some files
installed by packages distributing the applications in either
/usr/lib/mime/packages in mailcap
format or in /usr/share/applications
in FreeDesktop
format.
The Debian Policy specifies that the packages that provide informations in
the FreeDesktop format refrain from repeat them in mailcap format
(9.7.2).
The GIMP image editor declares its capacity to open
PDF files in the file /usr/share/applications/gimp.desktop. GNOME's
default PDF reader, Evince, declares
this in /usr/share/applications/org.gnome.Evince.desktop. Desktop
environments that follow the FreeDesktop standard have access to extra
informations that give the priority to Evince. The mailcap system does not
access them and gives the priority to alphabetic order. Therefore when one
opens a PDF with mutt, it opens with GIMP, which is not convenient.
Fortunately, mailcap is easy to configure. In order to change the
priority for one's personal account, one just has to copy the evince entry
that is found in /etc/mailcap and place it into $HOME/.mailcap. For
instance (but beware, it is simplistic):
grep evince /etc/mailcap >> $HOME/.mailcap
edited on feb. 28th to add $HOME to the example.