GNU Mailutils |
|
General-Purpose Mail Package |
Official GNU Software |
readmsg
— Extract Messages from a FolderThe readmsg
utility extracts messages from a mailbox
according to the criteria specified in the command line. These
criteria are:
readmsg 1 3 0
extracts three messages from the folder: the first, the third, and the last.
readmsg staff meeting
extracts the message which contains the words ‘staff meeting’.
Note that it will not match a message containing ‘Staff Meeting’
– the matching is case sensitive by default. This can changed using
the -i (--ignorecase) option. Two more options are
provided to control the matching algorithm: the -g
(--glob) option instructs readmsg
to treat
arguments as shell globbing patterns and the -r
(--regex) option instructs it to treat them as POSIX extended
regular expressions. Needless to say, when using any of the two latter
options, you should pay attention to escape the matching pattern to
prevent it from being interpreted by the shell. E.g.:
readmsg --regex 'staff.*meeting'
Unless requested otherwise, only the first message that matches the pattern is printed.
At least one command line argument or one informational option must be
present in readmsg
invocation. Informational options are:
--help (-?), --usage, and
--version (-V).
readmsg
.If a pattern is used for selection, show all messages that match pattern by default only the first one is presented.
Display mailbox debugging information.
Look for messages containing exactly the words given as arguments. This is the default. Other options changing this behavior are: --glob, --regex, and --ignorecase.
Specified the default mailbox.
Treat non-option arguments as shell globbing patterns. For example, to select the first message with words ‘morning’ and ‘coffee’ with anything bewteen them:
readmsg --glob 'morning*coffee'
(notice quoting, which prevents the shell from interpreting the ‘*’ prematurely).
Show the entire header and ignore the weedlist.
Ignore the case of letters when looking for matching messages. E.g.:
readmsg --glob --ignorecase 'morning*coffee'
Do not print the message header.
Put form-feed (Control-L) between messages instead of newline.
Treat non-option arguments as POSIX extended regular expressions.
A whitespace or coma separated list of header names to show per message. Default is --weedlist="From Subject Date To CC Apparently-".
See also Common Options.
readmsg
.Following configuration statements affect the behavior of
readmsg
:
If bool is ‘true’, display entire headers.
Set the weedlist. The str argument is a string, containing a list of header names, separated by whitespace, commands or colons. This corresponds to the --weedlist command line option (see –weedlist).
If bool is ‘true’, exclude all headers.
If bool is ‘true’, output formfeed character between messages.
Set the URL of the mailbox folder to read.
If bool is ‘true’, print all messages matching pattern, not only the first.
Statement | Reference |
---|---|
debug | See Debug Statement. |
tls | See TLS Statement. |
mailbox | See Mailbox Statement. |
locking | See Locking Statement. |
This document was generated on January 2, 2022 using makeinfo.
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.