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

3.16.1.1 New and Differing MH Format Specifications

MH Format: string decode (string str)

Decodes the input string str as per RFC 2047. Useful in printing ‘From:’, ‘To:’ and ‘Subject:’ headers.

Notice that, unlike the similar NMH function, decode checks the value of the global profile variable Charset (see Charset variable) to determine the charset to output the result in. If this variable is not set, decode returns its argument without any change. If this variable is set to auto, decode tries to determine the charset name from the setting of LC_ALL environment variable. Otherwise, the value of Charset is taken to be the name of the character set.

MH Format: string package ()

Returns package name (string ‘mailutils’).

MH Format: string package_string ()

Returns full package string (e.g. ‘GNU Mailutils 2.1’)

MH Format: string version ()

Returns mailutils version.

MH Format: string unre (string str)

The function removes any leading whitespace and eventual ‘Re:’ prefix from its argument. Useful for creating subjects in reply messages:

  %<{subject}Subject: Re: %(unre{subject})\\n%>
MH Format: void reply_regex (string r)

Sets the regular expression used to recognize reply messages. The argument r should be a POSIX extended regular expression. Matching is case insensitive.

For example, the following invocation

  %(reply_regex ^\(re|aw|ang|odp\)\(\\[[0-9]+\\]\)?:[[:blank:]])

corresponds to English ‘Re’, Polish ‘Odp’, Norwegian ‘Aw’ or German ‘Ang’, optionally followed by a number in brackets, followed by colon and any amount of whitespace. Notice proper quoting of the regex metacharacters.

See also Reply-Regex (see Reply-Regex variable) and isreply (see isreply MH function) below.

MH Format: boolean isreply ([string str])

If str is not given, the value of ‘Subject:’ header is taken.

The function returns true if its argument matches the “reply subject” regular expression. This expression is set via the global profile variable Reply-Regex (see Reply-Regex variable) or via the format function reply_regex.

This function is useful for creating ‘Subject:’ headers in reply messages. For example, consider the following construction:

%<{subject}%(lit)%<(isreply)%?\
(profile reply-prefix)%(concat)%|%(concat Re:)%>\
%(concat{subject})%(printhdr Subject: )\n%>

If the ‘Subject:’ header already contained reply prefix, this construct leaves it unchanged. Otherwise it prepends to it the value of Reply-Prefix profile variable, or, if it is unset, the string ‘Re:’.

This expression is used in default replcomps and replgroupcomps files.

MH Format: boolean rcpt (‘to’ | ‘cc’ | ‘me’ | ‘all’)

This function returns true if the given element is present in the recipient mask (as modified by -cc or -nocc options) and false otherwise. It is used in default formats for repl and comp, e.g.:

%(lit)%<(rcpt to)%(formataddr{to})%>

Notice that this means that usual replcomps file will be ignoring -cc and -nocc options, unless it has been modified as shown above.

MH Format: string concat ()

Appends whitespace + arg to string register.

MH Format: string printhdr (string str)

Prints the value of string register, prefixed by str. The output is formatted as a RFC 822 header, i.e. it is split at whitespace characters nearest to the width boundary and each subsequent segment is prefixed with horizontal tabulation.

MH Format: string in_reply_to ()

Generates the value for ‘In-reply-to:’ header according to RFC 2822.

MH Format: string references ()

Generates the value for ‘References:’ header according to RFC 2822.

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