Skip to main content

Module mailcap

Module mailcap 

Source
Expand description

RFC 1524 mailcap, read the way mutt reads it for auto_view: a [filters] entry with an empty command means “the command is in my mailcap”, and only a copiousoutput entry can answer, since that is the one promising plain text on stdout rather than a window of its own.

The files are $MAILCAPS (colon-separated) when it is set, and otherwise mutt’s default list: ~/.mailcap, /etc/mailcap, /usr/etc/mailcap, /usr/local/etc/mailcap, in that order. The first entry that matches a type wins, text/* wildcards included.

Structs§

Entry
One mailcap line: the type it handles, the view command, and the flags rmut cares about.

Functions§

command_for
The command that renders mimetype inline, or None when no entry can: mutt takes the first matching copiousoutput entry whose test passes. An entry wanting the terminal, or one interpolating a %{parameter} rmut does not have, is passed over.
load
Every entry from every readable mailcap file, in search order. A missing file is not an error, like mutt.
parse
Parse one mailcap file.
paths
The mailcap files to consult, in order.
viewer_for
The viewer for mimetype, mutt’s view-mailcap: the first matching entry whose test passes, terminal-wanting or not, with whether it writes to stdout (copiousoutput) rather than the terminal.