Update.
[mymail.git] / mymail.1
1 .TH "MYMAIL" "0.9.1" "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 ... ]]\n");
14
15 .SH "DESCRIPTION"
16
17 \fBmymail\fP is a command line utility to index mbox files and perform
18 quick searches based on sender, subject, etc.
19
20 It is similar in spirit to other existing software such as mu or
21 notmuch, but does not use a real database backend to store and query
22 the index.
23
24 .SH "OPTIONS"
25 .TP
26 \fB-h\fR, \fB--help\fR
27 display help and exit
28 .TP
29 \fB-v\fR, \fB--version\fR
30 print the version number
31 .TP
32 \fB-q\fR, \fB--quiet\fR
33 do not write information during the search
34 .TP
35 \fB-p <db filename pattern>\fR, \fB--db-pattern <db filename pattern>\fR
36 set the db filename pattern for recursive search
37 .TP
38 \fB-r <db root path>\fR, \fB--db-root <db root path>\fR
39 set the db root path for recursive search
40 .TP
41 \fB-l <db filename list>\fR, \fB--db-list <db filename list>\fR
42 set the semicolon-separated list of db files for search
43 .TP
44 \fB-s <search pattern>\fR, \fB--search <search pattern>\fR
45 search for matching mails in the db file
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
55 set the db filename pattern for recursive search
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) selects mails whose leading line From, or
85 fields From:, Sender:, Reply-To:, or Return-Path: matches the regexp.
86 .TP
87 \fBt <regexp>\fR (to) selects mails whose field To:, Cc:, or Bcc: matches the regexp.
88 .TP
89 \fBp <regexp>\fR (participant) selects mails that would be selected by \fBf\fR or \fBt\fR.
90 .TP
91 \fBs <regexp>\fR (subject) selects mails whose field Subject: matches the regexp.
92 .TP
93 \fBd <regexp>\fR (date) selects mails whose field Date: matches the regexp.
94 .TP
95 \fBb <regexp>\fR (body) selects mails whose body matches the
96 regexp. Evaluatin such a condition requires to read the original
97 mboxes completely, which can be slow. However, header conditions are
98 checked first to read the bodies only for mails which fulfill them
99 entirely.
100 .TP
101 \fB8h\fR, \fBtoday\fR, \fB24h\fR, \fBweek\fR, and \fBmonth\fR selects
102 mails received respectively during the last 8, 24, 24, 7 * 24 hours or
103 31 * 24 hours.
104 .TP
105 \fByesterday\fR selects mails received between 48h and 24h ago.
106 .TP
107 \fBmonday\fR, \fBtuesday\fR, ..., \fBsunday\fR selects mails received
108 the most recent such day
109
110 .SH "EXAMPLES"
111
112 The command
113
114 .RS
115 .EX
116 mymail --db-file /tmp/mymail/2010-2011/mymail.db \\
117        --index \\
118        ~/archives/mails/2010 ~/archives/mails/2011
119 .EE
120 .RE
121
122 will index all the mbox files present in the directories
123 ~/archives/mails/2010 and ~/archives/mails/2011 (recursively) and
124 create an index file /tmp/mymail/2010-2011/mymail.db
125
126 And
127
128 .RS
129 .EX
130 mymail --db-pattern '\.db$' --db-root /tmp/mymail \\
131        --output /tmp/mymail.mbox \\
132        --search 'p bob.something' \\
133        --search '!s spam' \\
134        --search 'month'
135 .EE
136 .RE
137
138 will search in all the database files *.db located (recursively) in
139 /tmp/mymail, for all the mails having "bob.something" as sender or
140 recipient, without "spam" in the subject, received over the last 31
141 days, and create an mbox file /tmp/mymail/mbox.
142
143 .SH "BUGS"
144
145 The search in the mail bodies does not decode mimencoding mails, hence
146 will not catch patterns in encoded text.
147
148 The mbox format is not clear for multipart messages, since the ^"From
149 " lines are not always quoted properly (at least the ones I have to
150 test).
151
152 .SH "AUTHOR"
153
154 Written by Francois Fleuret <francois@fleuret.org> and distributed
155 under the terms of the GNU General Public License version 3 as
156 published by the Free Software Foundation. This is free software: you
157 are free to change and redistribute it. There is NO WARRANTY, to the
158 extent permitted by law.