Increased the version number.
[mymail.git] / mymail.1
1 .TH "MYMAIL" "0.9.6" "March 2013" "Francois Fleuret" "User Commands"
2
3 \" This man page was written by Francois Fleuret <francois@fleuret.org>
4 \" and is distributed under a Creative Commons Attribution-Share Alike
5 \" 3.0 License.
6
7 .SH "NAME"
8
9 mymail \- A simple command line utility for indexing and searching mbox files
10
11 .SH "SYNOPSIS"
12
13 \fBmymail\fP [\fIoptions\fR] [\fI<mbox dir1>\fR [\fI<mbox dir2>\fR ... ]|\fI<db file1>\fR [\fI<db file2>\fR ... ]]
14
15 .SH "DESCRIPTION"
16
17 \fBmymail\fP is a command line utility to index mbox files, search for
18 mails based on sender, subject, etc. and generate result mbox files.
19
20 It is similar in spirit to other tools such as mu or notmuch, but is
21 overall simpler.
22
23 .SH "OPTIONS"
24 .TP
25 \fB-h\fR, \fB--help\fR
26 display help and exit
27 .TP
28 \fB-v\fR, \fB--version\fR
29 print the version number
30 .TP
31 \fB-q\fR, \fB--quiet\fR
32 do not write information during the search
33 .TP
34 \fB-t\fR, \fB--use-leading-time\fR
35 use the time stamp from the leading line of each mail and not the
36 Date: field
37 .TP
38 \fB-p <db filename pattern>\fR, \fB--db-pattern <db filename pattern>\fR
39 set the db filename pattern for recursive search
40 .TP
41 \fB-r <db root path>\fR, \fB--db-root <db root path>\fR
42 set the db root path for recursive search
43 .TP
44 \fB-l <db filename list>\fR, \fB--db-list <db filename list>\fR
45 set the semicolon-separated list of db files for search
46 .TP
47 \fB-m <mbox filename pattern>\fR, \fB--mbox-pattern <mbox filename pattern>\fR
48 set the mbox filename pattern for recursive search
49 .TP
50 \fB-s <search pattern>\fR, \fB--search <search pattern>\fR search for
51 matching mails in the db file. Multiple search requests can be
52 combined, and only mails fulfilling all of them will be extracted.
53 .TP
54 \fB-d <db filename>\fR, \fB--db-file-generate <db filename>\fR
55 set the db filename for indexing
56 .TP
57 \fB-i\fR, \fB--index\fR
58 index mails in the mailboxes located recursively anywhere in the
59 directories following the options on the command lines
60 .TP
61 \fB-o <output filename>\fR, \fB--output <output filename>\fR set the
62 result mbox filename. If it is not set, the standard output is used
63 .TP
64 \fB-a <search key>\fR, \fB--default-search <search key>\fR
65 set the default search key. If a search request is not understood,
66 it is interpreted as the regexp with this default search key
67
68 .SH "ENVIRONMENT VARIABLES"
69
70 .TP
71 \fBMYMAIL_DB_PATTERN\fR
72 defaut value for the --db-pattern argument
73 .TP
74 \fBMYMAIL_DB_ROOT\fR
75 defaut value for the --db-root argument
76 .TP
77 \fBMYMAIL_DB_LIST\fR
78 defaut value for the --db-list argument
79 .TP
80 \fBMYMAIL_DB_FILE\fR
81 defaut value for the --db-file argument
82
83 .SH "SEARCH SYNTAX"
84
85 The search conditions take the form of a key which is a single letter,
86 followed by a space and a regexp, which can itself contain spaces. If
87 the condition is prefaced by the character "!" it is negated, and has
88 to be false for a mail to be selected.
89
90 The time-based conditions use as reference the time indicated in the
91 heading From line, and not in the Date: field.
92
93 .TP
94 \fBf <regexp>\fR (from)
95 selects mails whose leading line From, or fields From:, Sender:,
96 Reply-To:, or Return-Path: matches the regexp.
97 .TP
98 \fBt <regexp>\fR (to)
99 selects mails whose field To:, Cc:, or Bcc: matches the regexp.
100 .TP
101 \fBp <regexp>\fR (participant)
102 selects mails that would be selected by \fBf\fR or \fBt\fR.
103 .TP
104 \fBs <regexp>\fR (subject)
105 selects mails whose field Subject: matches the regexp.
106 .TP
107 \fBd <regexp>\fR (date)
108 selects mails whose field Date: matches the regexp.
109 .TP
110 \fBb <regexp>\fR (body)
111 selects mails whose body matches the regexp. Evaluating such a
112 condition requires to read the original mboxes completely, which can
113 be slow. However, header conditions are checked first to read the
114 bodies only for mails which fulfill them entirely.
115 .TP
116 \fB8h\fR, \fB24h\fR, \fB48h\fR, \fBweek\fR, \fBmonth\fR, and
117 \fByear\fR
118 selects mails received during the last 8, 24, 24, 48, 7 * 24 hours, 31 *
119 24 hours, and 365 * 24 hours respectively.
120 .TP
121 \fBtoday\fR
122 selects mails received since midnight.
123 .TP
124 \fByesterday\fR
125 selects mails received yesterday.
126 .TP
127 \fBmonday\fR, \fBtuesday\fR, ..., \fBsunday\fR
128 selects mails received the most recent such day of the week.
129
130 .SH "EXAMPLES"
131
132 The command
133
134 .P
135 .nf
136 .B mymail --db-file /tmp/mymail/2010-2011/mymail.db \e
137 .B \ \ \ \ \ \ \ --index \e
138 .B \ \ \ \ \ \ \ ~/archives/mails/2010 ~/archives/mails/2011
139
140 .fi
141 will index all the mbox files present in the directories
142 ~/archives/mails/2010 and ~/archives/mails/2011 (recursively) and
143 create an index file /tmp/mymail/2010-2011/mymail.db
144
145 And
146
147 .P
148 .nf
149 .B mymail --db-pattern '\.db$' --db-root /tmp/mymail \e
150 .B \ \ \ \ \ \ \ --output /tmp/mymail.mbox \e
151 .B \ \ \ \ \ \ \ --search 'p bob.something' \e
152 .B \ \ \ \ \ \ \ --search '!s spam' \e
153 .B \ \ \ \ \ \ \ --search 'month'
154
155 .fi
156 will search in all the database files *.db located (recursively) in
157 /tmp/mymail, for all the mails having "bob.something" as sender or
158 recipient, without "spam" in the subject, received over the last 31
159 days, and create an mbox file /tmp/mymail/mbox.
160
161 .SH "BUGS"
162
163 The search in the mail bodies does not decode mimencoding mails, hence
164 will not catch patterns in encoded text.
165
166 The mbox format is not clear for multipart messages, since the ^"From
167 " lines are not always quoted properly (at least the ones I use for
168 testing).
169
170 .SH "AUTHOR"
171
172 Written by Francois Fleuret <francois@fleuret.org> and distributed
173 under the terms of the GNU General Public License version 3 as
174 published by the Free Software Foundation. This is free software: you
175 are free to change and redistribute it. There is NO WARRANTY, to the
176 extent permitted by law.