The mailcap module is used to read UNIX mailcap files. Mailcap files are used to tell mail readers and web browsers how to process files with different MIME types. The contents of a mailcap file typically look something like this:
video/mpeg; xmpeg %s application/pdf; acroread %s
When data of a given MIME type is encountered, the mailcap file is consulted to find an application for handling that data.
Reads all available mailcap files and returns a dictionary mapping MIME types to a mailcap entry. mailcap files are read from $HOME/.mailcap, /etc/mailcap, /usr/etc/mailcap, and /usr/local/etc/mailcap.
findmatch(caps, mimetype [, key [, filename [, plist]]])
Searches the dictionary caps for a mailcap entry matching mimetype. The ...