ex: chop command now removes the body without arguments
[neatmail.git] / README
blob27c5dd3f0de3a629902b7dd05157a31e41e99f1c
1 NEATMAIL
2 ========
4 Neatmail is a noninteractive mail client.  It generates a listing of
5 the messages in a mailbox in mbox format and executes a list of
6 ex-like commands on it.
8 Neatmail provides the following commands:
10 * mk: generate a listing of the mails in an mbox.
11 * ex: execute the specified commands on an mbox.
12 * pg: page a message in an mbox.
13 * ns: check for new messages among several mboxes.
15 The ex command reads a list of commands from the standard input and
16 executes them on a given mbox file.  It ignores all input lines except
17 those beginning with a colon or a capital letter.  Lines beginning
18 with a capital letter like "R100 ...", change the value of the status
19 header of the message whose number follows the letter.  It also marks
20 the current message.  Lines beginning with a colon are named commands.
21 The list of named commands are as follows:
23 * rm: remove the current message.
24 * cp: copy the current message to the given mbox.
25 * mv: move the current message to the given mbox.
26 * hd, set: change the value of the given header of the current message.
27 * ft, filt: filter the message through the given command.
28 * w: write the mbox.
29 * g, g!: ex-like global command.
30 * tj: join threads by modifying "Reply-To" headers.
31 * ch: chop the message at the specified offset.
33 These commands act on the current message by default (if applicable),
34 but different messages may be specified using ex-like addresses.  For
35 instance, "2,5rm" removes messages 2 through 5.  Addresses may contain
36 search statements, like "/pattern/rm", in which the pattern is a POSIX
37 extended regular expression (the same applies to global command
38 patterns like "%g/pattern/rm").  Search patterns are matched in the
39 subject field of message headers, except when the pattern is "^field:
40 value", in which it is matched against the specified header field
41 instead.
43 SUGGESTED USAGE
44 ===============
46 Generate a message listing (see mk options):
47 $ neatmail mk -st -r inbox >inbox.nm
49 Open inbox.nm in an editor, change the status field of
50 messages and append ex commands.
52 Page, reply, or forward messages (see pg options):
53 $ neatmail pg -m -h from:subject:to:cc: inbox 23 >mail
55 Execute the commands specified in inbox.nm:
56 $ (cat inbox.nm; echo ":w") | neatmail ex inbox