MIME > Mime Types Support


Support of MIME types in Debian packages

For the command line

MIME support in Debian is formally described in the MIME sub-policy, which requests that packages use the update-mime command from the mime-support package. This can be done directly, or indirectly through helper programs, in particular dh_installmime from debhelper. The format of the registration file is described in the mailcap(5) manpage, and many examples can be found in /etc/mailcap.

For the file /etc/mime.types, the modification has to be requested to the maintainer of the mime-support package.

Mutt and maybe other applications use the coupiousoutput flag to select which command to run for inline display.

For the desktop

The Internet Media Types (IMT) defined as part of the Multipurpose Internet Mail Extensions (MIME) have been reused by freedesktop.org (formerly known as the X Develepment Group, XDG) to associate applications and files in desktop environments.

Association between a file suffix and/or content and file type is done through XML files following the Shared MIME-info Database specification. The Debian package shared-mime-info contains the specification and the program update-mime-database that is used to populate the /usr/share/mime with relevant entries, using the XML file as a source. dh_installmime can be used to simplify the work.

Programs are indirectly associated to file suffixes through the association with a file type. This is done through their .desktop file, with the MimeType entry.

In summary, if you use debhelper:

Further readings

Informations to write this page were collected in during a discussion on the debian-mentors mailing list : http://lists.debian.org/debian-mentors/2007/12/msg00398.html 20071222143401.GB2565@kunpuu.plessy.org