DESCRIPTION

This describes the configuration commands available for definition of reports for the clerk. For further information about configuration commands refer to the Config manpage.


SCOPING COMMAND

report [ name ... ]
All report definition commands after a report command are for the mentioned reports. I.e. this command builds a scope for report definition commands.

Value of the unscoped command itself is an array.


SUB REPORTS

A report may contain sub reports, which are given together with the calling report. This may be nested. In a given output stream the sub reports come first.

rpSub [ name ... ]
The current report contains the sub reports name. Multiple commands cumulate. The order in which names are listed determines the order in which they are executed.

Value is an array.


INPUT DB

A report presents information from a mail database. The following commands define, which database to use.

rpInArc list
The current report takes its input from the archive data base for list list. This base list needs a lsArchive command.

This defaults to the database set by mailDBFile.

Value is a scalar.


SELECTION

The following commands define criteria on which to select the entries in a mail data base.

Multiple selections form a logical and (i.e. only posts, which meet all selection criteria are considered).

If no selection is made, all entries are selected.

rpSelPlain
Selects all posts, which have a plain mail present.

Value is being set.

rpSelNew
Selects all posts, which have been entered, since the last time this report has been created. If the appropriate cookie is not present in the data base, it is assumed to be before the oldest entry. The cookie is set in any case.

Value is being set.


SORTING ORDER

The selected posts are sorted in some way. The sorting order to use is defined by the following commands.

Every sorting definition has a first argument sgnf, which is an integer. The absolute value of sgnf defines the order in which multiple sorts are applied to the selected posts. Low values are most significant (i.e. 1 is the most important sorting criterion). A negative sign of sgnf reverses the ascending order, which is used for positive values. 0 is not allowed for sgnf.

If no sort order is given, the order of the posts is undefined.

rpSortNew sgnf
Sorts by entry time in the data base.

Value is a scalar.

rpSortDate sgnf [hdr]
Sorts by the date value of header field hdr. Posts with missing header field hdr have infinite low values.

hdr defaults to "Date".

Value is an array.


OUTPUT FORMAT

The report (usually) contains only part of the selected and sorted posts. The following commands define, which parts of a post are output, and how they appear.

If no such command is given, the post has no contents at all. This may be used for reports, which consist of sub-reports only.

rpFmtFlds template...
Multiple arguments are concatenated by an intervening linefeed to one string. This string may have embedded fields referring to a part of the post. A field is specified by an identifier embedded in dollar signs ($). The following field types are defined:
$header:$
Embed the contents of header field header at the current point. A header field is always fold to a reasonable length, but the trailing newline is cut off. header must conform to the usual conventions for header tags, and may contain only letters and a minus (-).

Every field header has to appear in the data base part of the post. Header fields in plain posts are not considered. Moreover only the first field of possibly multiple is used.

$range:$
Embed part of the body at this point, with intervening but no trailing newline. range gives a range of lines to include, and must meet the following format:

[begin][..][end]

begin and end are line numbers and must consist of digits only. A leading minus sign (-) counts line numbers from the bottom of the mail. The lines starting with line number begin and ending before line end are taken.

If begin is not given, it defaults to 1, the first line of the body. (The empty line after the header does not belong to the header, nor does it belong to the body.)

If end is not given, it defaults to 0, the imaginary line after the last line of the body.

If begin and end are given, or both are missing, the .. is not optional. A .. denotes the whole post.

It is no error, if begin is greater than end, but results in an empty range, or if the post contains less than the wanted lines.

$$
Embed a single dollar sign.

The templates are filled in for every selected post in the chosen order, a trailing newline is added, and they are concatenated to one string.

Though a missing or completly empty template is permitted, it makes little sense, since this generates only an empty output.

Value is an array with parsed alternating fixed text and header fields.

rpFmtSubj template
The argument is one string, with embedded fields, which are filled with data. A field is specified by an identifier embedded in dollar signs ($). The following field types are defined:
$archive$
Embed the name of the archive this report is taken from. This needs a corresponding rpInArc command or results in an empty string.

$timeNew$
Embed the time of the last creation of this type of report. This makes sense only if a rpSelNew command has been given. Time is written in GMT.

$timeCur$
Embed the current time. Time is written in GMT.

$$
Embed a single dollar sign.

Value is an array with parsed alternating fixed text and header fields.