Scroll to navigation

SCAN(1mh) [mmh-0.3] SCAN(1mh)


scan - produce a one line per message scan listing


scan [+folder] [msgs] [-form formatfile] [-width columns] [-file filename] [-Version] [-help]


Scan produces a one-line-per-message listing of the specified folder or messages. Each scan line contains the message number (name), the date, the `From:' field and the `Subject' field. For example:

15+	10/05 crocker	nned
16-	10/05 crocker	message id format
18	10/06 brien	Re: Exit status from mkdir
19	10/07*brien	`scan' listing format in mmh

The `+' on message 15 indicates that it is the current message.

The `-' on message 16 indicates that it has been replied to, as indicated by a `Replied:' component (produced by the -annotate switch to the repl command).

The `*' on message 19 indicates that no `Date:' header was present. The time of last modification of the message is given instead.

Scan actually reads each of the specified messages and parses them to extract the desired fields. During parsing, appropriate error messages will be produced if there are format errors in any of the messages.

By default, scan will decode RFC-2047 (MIME) encoding in these scan listings. Scan will only decode these fields if your terminal can natively display the character set used in the encoding. You should set the MM_CHARSET environment variable to your native character set, if it is not US-ASCII. See the mh-profile(5) man page for details about this environment variable.

The -file filename switch allows the user to obtain a scan listing of a maildrop file as produced by packf. This listing includes every message in the file (you can't scan individual messages).

The switch -width columns may be used to specify the width of the scan line. The default is to use the width of the terminal.

The command:

(scan | pr ; show a -showproc pr) | lpr

produces a scan listing of the current folder, followed by a formatted listing of all messages in the folder, one per page. Omitting `-showproc pr' will cause the messages to be concatenated, separated by a one-line header and two blank lines.

To override the output format used by scan, the -form file switch is used. This permits individual fields of the scan listing to be extracted with ease. file is either the name of a format file or a format string directly, if prepended with an equal sign `='. See mh-format(5) for the details.

In addition to the standard mh-format(5) escapes, scan also recognizes the following additional component escapes:

Escape	Returns	Description
dtimenow	date	the current date
folder	string	the name of the current folder

If no date header is present in the message, the function escapes which operate on {date} will return values for the date of last modification of the message file itself. This feature is handy for scanning a draft folder, as message drafts usually aren't allowed to have dates in them.

scan will update the mmh context prior to starting the listing, so interrupting a long scan listing preserves the new context. nmh purists hate this idea.


^$HOME/.mmh/profile~^The user profile


^Path:~^To determine the user's mail storage
^Alternate-Mailboxes:~^To determine the user's mailboxes
^Current-Folder:~^To find the default current folder


inc(1), pick(1), show(1), mh-format(5)


`+folder' defaults to the current folder
`msgs' defaults to all
`-form' defaulted as described above
`-width' defaulted to the width of the terminal


If a folder is given, it will become the current folder.


The value of each component escape is set by scan to the contents of the first message header scan encounters with the corresponding component name; any following headers with the same component name are ignored.

2016-08-15 MH.6.8