1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
|
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999--2022 Free Software Foundation, Inc.
@c See file mailutils.texi for copying conditions.
@comment *******************************************************************
@pindex readmsg
The @command{readmsg} utility extracts messages from a mailbox
according to the criteria specified in the command line. These
criteria are:
@enumerate
@item A lone @samp{*} means ``select all messages in the mailbox''.
@item
A list of message numbers may be specified. Values
of @samp{0} and @samp{$} in the list both mean the last
message in the mailbox. For example:
@example
readmsg 1 3 0
@end example
@noindent
extracts three messages from the folder: the first, the third, and the last.
@item
Finally, the selection may be some text to match. This will select a mail
message which exactly matches the specified text. For example,
@example
readmsg staff meeting
@end example
@noindent
extracts the message which contains the words @samp{staff meeting}.
Note that it will not match a message containing @samp{Staff Meeting}
-- the matching is case sensitive by default. This can changed using
the @option{-i} (@option{--ignorecase}) option. Two more options are
provided to control the matching algorithm: the @option{-g}
(@option{--glob}) option instructs @command{readmsg} to treat
arguments as shell globbing patterns and the @option{-r}
(@option{--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.:
@example
readmsg --regex 'staff.*meeting'
@end example
@end enumerate
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 @command{readmsg} invocation. Informational options are:
@option{--help} (@option{-?}), @option{--usage}, and
@option{--version} (@option{-V}).
@menu
* Opt-readmsg:: Invocation of @command{readmsg}.
* Conf-readmsg:: Configuration of @command{readmsg}.
@end menu
@node Opt-readmsg
@subsection Invocation of @command{readmsg}.
@table @option
@item -a
@itemx --show-all
If a pattern is used for selection, show all messages that match pattern
by default only the first one is presented.
@item -d
@itemx --debug
Display mailbox debugging information.
@item -e
@itemx --exact
Look for messages containing exactly the words given as arguments.
This is the default. Other options changing this behavior are:
@option{--glob}, @option{--regex}, and @option{--ignorecase}.
@item -f @var{mailbox}
@itemx --folder=@var{mailbox}
Specified the default mailbox.
@item -g
@itemx --glob
Treat non-option arguments as shell globbing patterns. For example,
to select the first message with words @samp{morning} and
@samp{coffee} with anything bewteen them:
@example
readmsg --glob 'morning*coffee'
@end example
@noindent
(notice quoting, which prevents the shell from interpreting the
@samp{*} prematurely).
@item -h
@itemx --header
Show the entire header and ignore the weedlist.
@item -i
@itemx --ignorecase
Ignore the case of letters when looking for matching messages. E.g.:
@example
readmsg --glob --ignorecase 'morning*coffee'
@end example
@item -n
@itemx --no-header
Do not print the message header.
@item -p
@itemx --form-feed
Put form-feed (Control-L) between messages instead of newline.
@item -r
@itemx --regex
Treat non-option arguments as POSIX extended regular expressions.
@anchor{weedlist option}
@item -w @var{weedlist}
@itemx --weedlist=@var{weedlist}
A whitespace or coma separated list of header names to show per message.
Default is @option{--weedlist="From Subject Date To CC Apparently-"}.
@end table
See also @ref{Common Options}.
@node Conf-readmsg
@subsection Configuration of @command{readmsg}.
Following configuration statements affect the behavior of
@command{readmsg}:
@deffn {Readmsg Conf} header @var{bool}
If @var{bool} is @samp{true}, display entire headers.
@end deffn
@deffn {Readmsg Conf} weedlist @var{str}
Set the weedlist. The @var{str} argument is
a string, containing a list of header names, separated by whitespace,
commands or colons. This corresponds to the @option{--weedlist} command
line option (@pxref{Opt-readmsg, --weedlist}).
@end deffn
@deffn {Readmsg Conf} no-header @var{bool}
If @var{bool} is @samp{true}, exclude all headers.
@end deffn
@deffn {Readmsg Conf} form-feeds @var{bool}
If @var{bool} is @samp{true}, output formfeed character between
messages.
@end deffn
@deffn {Readmsg Conf} folder @var{url}
Set the @acronym{URL} of the mailbox folder to read.
@end deffn
@deffn {Readmsg Conf} show-all-match @var{bool}
If @var{bool} is @samp{true}, print all messages matching pattern, not
only the first.
@end deffn
@multitable @columnfractions 0.3 0.6
@headitem Statement @tab Reference
@item debug @tab @xref{Debug Statement}.
@item tls @tab @xref{TLS Statement}.
@item mailbox @tab @xref{Mailbox Statement}.
@item locking @tab @xref{Locking Statement}.
@end multitable
|