Update.
[mymail.git] / mymail.1
1 .TH "MYMAIL" "0.9.2" "February 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-p <db filename pattern>\fR, \fB--db-pattern <db filename pattern>\fR
35 set the db filename pattern for recursive search
36 .TP
37 \fB-r <db root path>\fR, \fB--db-root <db root path>\fR
38 set the db root path for recursive search
39 .TP
40 \fB-l <db filename list>\fR, \fB--db-list <db filename list>\fR
41 set the semicolon-separated list of db files for search
42 .TP
43 \fB-s <search pattern>\fR, \fB--search <search pattern>\fR search for
44 matching mails in the db file. Multiple search requests can be
45 combined, and only mails fulfilling all of them will be extracted.
46 .TP
47 \fB-d <db filename>\fR, \fB--db-file <db filename>\fR
48 set the db filename for indexing
49 .TP
50 \fB-i\fR, \fB--index\fR
51 index mails in the mailboxes located recursively anywhere in the
52 directories following the options on the command lines
53 .TP
54 \fB-o <output filename>\fR, \fB--output <output filename>\fR set the
55 result mbox filename. If it is not set, the standard output is used
56 .TP
57 \fB-a <search field>\fR, \fB--default-search <search field>\fR
58 set the default search field. If a search request is not understood,
59 it is interpreted as the regexp with this default search field
60
61 .SH "ENVIRONMENT VARIABLES"
62
63 .TP
64 \fBMYMAIL_DB_PATTERN\fR
65 defaut value for the --db-pattern argument
66 .TP
67 \fBMYMAIL_DB_ROOT\fR
68 defaut value for the --db-root argument
69 .TP
70 \fBMYMAIL_DB_LIST\fR
71 defaut value for the --db-list argument
72 .TP
73 \fBMYMAIL_DB_FILE\fR
74 defaut value for the --db-file argument
75
76 .SH "SEARCH SYNTAX"
77
78 The search conditions take the form of a single letter followed by a
79 space and a regexp, which can itself contain spaces. If the condition
80 is prefaced by the character "!" it is negated, and has to be false
81 for a mail to be selected.
82
83 .TP
84 \fBf <regexp>\fR (from)
85 selects mails whose leading line From, or fields From:, Sender:,
86 Reply-To:, or Return-Path: matches the regexp.
87 .TP
88 \fBt <regexp>\fR (to)
89 selects mails whose field To:, Cc:, or Bcc: matches the regexp.
90 .TP
91 \fBp <regexp>\fR (participant)
92 selects mails that would be selected by \fBf\fR or \fBt\fR.
93 .TP
94 \fBs <regexp>\fR (subject)
95 selects mails whose field Subject: matches the regexp.
96 .TP
97 \fBd <regexp>\fR (date)
98 selects mails whose field Date: matches the regexp.
99 .TP
100 \fBb <regexp>\fR (body)
101 selects mails whose body matches the regexp. Evaluating such a
102 condition requires to read the original mboxes completely, which can
103 be slow. However, header conditions are checked first to read the
104 bodies only for mails which fulfill them entirely.
105 .TP
106 \fB8h\fR, \fBtoday\fR, \fB24h\fR, \fBweek\fR, \fBmonth\fR, and
107 \fByear\fR
108 selects mails received during the last 8, 24, 24, 7 * 24 hours, 31 *
109 24 hours, and 365 * 24 hours respectively.
110 .TP
111 \fByesterday\fR
112 selects mails received between 48h and 24h ago.
113 .TP
114 \fBmonday\fR, \fBtuesday\fR, ..., \fBsunday\fR
115 selects mails received the most recent such day of the week
116
117 .SH "EXAMPLES"
118
119 The command
120
121 .nf
122 .B mymail --db-file /tmp/mymail/2010-2011/mymail.db \e
123 .B        --index \e
124 .B        ~/archives/mails/2010 ~/archives/mails/2011
125
126 will index all the mbox files present in the directories
127 ~/archives/mails/2010 and ~/archives/mails/2011 (recursively) and
128 create an index file /tmp/mymail/2010-2011/mymail.db
129
130 And
131
132 .nf
133 .B mymail --db-pattern '\.db$' --db-root /tmp/mymail \e
134 .B        --output /tmp/mymail.mbox \e
135 .B        --search 'p bob.something' \e
136 .B        --search '!s spam' \e
137 .B        --search 'month'
138
139 will search in all the database files *.db located (recursively) in
140 /tmp/mymail, for all the mails having "bob.something" as sender or
141 recipient, without "spam" in the subject, received over the last 31
142 days, and create an mbox file /tmp/mymail/mbox.
143
144 .SH "BUGS"
145
146 The search in the mail bodies does not decode mimencoding mails, hence
147 will not catch patterns in encoded text.
148
149 The mbox format is not clear for multipart messages, since the ^"From
150 " lines are not always quoted properly (at least the ones I have to
151 test).
152
153 .SH "AUTHOR"
154
155 Written by Francois Fleuret <francois@fleuret.org> and distributed
156 under the terms of the GNU General Public License version 3 as
157 published by the Free Software Foundation. This is free software: you
158 are free to change and redistribute it. There is NO WARRANTY, to the
159 extent permitted by law.