GNU Mailutils Manual (split by section):   Section:   Chapter:FastBack: Programs   Up: Programs   FastForward: Libraries   Contents: Table of ContentsIndex: Function Index

3.15 mimeview

For each file given in its command line, mimeview attempts to autodetect its type and invoke an appropriate file viewer.

To detect the file type, mimeview uses mime.types file. This file is a part of Common UNIX Printing System, mime.types in mime.types man page. By default mimeview searches for mime.types in $prefix/etc/cups/4, however its exact location can be specified at runtime as well (see --mimetypes below).

Once file MIME type is successfully determined, mimeview consults mailcap files in order to determine how to display the file. It does so essentially in the same manner as metamail utility, i.e., it scans all files specified in METAMAIL environment variable until it finds an entry describing the desired file format or until the list of files is exhausted. If METAMAIL variable is not set, mimeview uses the following default path instead:

$HOME/.mailcap:/usr/local/etc/mailcap:\
 /usr/etc/mailcap:/etc/mailcap:\
 /etc/mail/mailcap:/usr/public/lib/mailcap

3.15.1 Mimeview Invocation

The following table summarizes options specific for mimeview:

-a[type-list]
--no-ask[=type-list]

By default mimeview asks for confirmation before running interpreter to view a message. If this option is used without argument, it disables the default behavior for all message types. Otherwise, if argument type-list is given, it specifies a comma-separated list of MIME types for which no questions should be asked. Elements of this list may include shell-style globbing patterns, e.g. setting

--no-ask='text/*,image/jpeg'

will disable prompting before displaying any textual files, no matter what their subtype is, and before displaying files with type ‘image/jpeg’.

Notice, that when the long form is used, its argument must be separated from the option by a single equal sign, as shown in the example above. When the short form (-a) is used, its argument must follow the option immediately, without any intervening whitespace, e.g. -a'text/*').

-d[flags]
--debug[=flags]

Enables debugging output. Flags is a sequence of characters specifying the desired debugging level. Following characters are meaningful in flags:

g

Enables debugging of mime.types parser

l

Enables debugging of mime.types lexical analyzer (warning: produces very copious output)

0

Prints basic information about actions to be executed and reports about exit status of executed commands.

1

Additionally displays each file name along with its MIME type

2

Additionally traces the process of looking up the matching entry in mailcap files.

3

Additionally, enables debugging of mime.types parser (‘g’).

4

Additionally, enables debugging of mime.types lexer (‘l’).

digits from 5 to 9

The same as 4, currently.

If flags are not given, the default ‘2’ is assumed.

--metamail[=file]

Run metamail to display files, instead of using the internal mechanisms. If file is specified, it is taken as metamail command line.

-h
--no-interactive
--print

This options tells mimeview that it should run in non-interactive mode. In this mode prompting is disabled, and the normal mailcap command field is not executed. Instead mimeview will execute the command specified in the print field. If there is nothing in the print field, the mailcap entry is ignored and the search continues for a matching mailcap entry that does have a print field.

Notice, that unlike in metamail -h, this option does not force mimeview to send the output to the printer daemon.

When used with --metamail option, this option passes -h flag to the invocation of metamail.

By default mimeview behaves as if given --no-interactive option whenever its standard input is not a tty device.

-i
--identify

Identifies and prints the MIME type for each input file.

-n
--dry-run

Do not do anything, just print what would be done. Implies --debug=1, unless the debugging level is set up explicitly.

-f file
--mimetypes file

Use file as mime.types file. If file is a directory, use file/mime.types

-t
--lint

Check syntax of the mime.types file and exit. Command line arguments are ignored.

3.15.2 Mimeview Config

The following configuration statements affect the behavior of mimeview:

StatementReference
debugSee Debug Statement.
Mimeview Config: mimetypes file

Read file instead of the default mime.types.

Mimeview Config: metamail program

Use program to display files.

Footnotes

(4)

The exact location is determined at configuration time by setting environment variable DEFAULT_CUPS_CONFDIR. On most sites running

./configure DEFAULT_CUPS_CONFDIR=/etc/cups

should be recommended.

GNU Mailutils Manual (split by section):   Section:   Chapter:FastBack: Programs   Up: mimeview   FastForward: Libraries   Contents: Table of ContentsIndex: Function Index