82b35b5ae7c4692bd0ef09abd48a0c3062fe92a6
[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 ... ]]\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 search for
45 matching mails in the db file. Multiple search requests can be
46 combined, and only mails fulfilling all of them will be extracted.
47 .TP
48 \fB-d <db filename>\fR, \fB--db-file <db filename>\fR
49 set the db filename for indexing
50 .TP
51 \fB-i\fR, \fB--index\fR
52 index mails in the mailboxes located recursively anywhere in the
53 directories following the options on the command lines
54 .TP
55 \fB-o <output filename>\fR, \fB--output <output filename>\fR set the
56 result mbox filename. If it is not set, the standard output is used
57 .TP
58 \fB-a <search field>\fR, \fB--default-search <search field>\fR
59 set the default search field: If a search request is not understood,
60 it is interpreted as the regexp with this default search field
61
62 .SH "ENVIRONMENT VARIABLES"
63
64 .TP
65 \fBMYMAIL_DB_PATTERN\fR
66 defaut value for the --db-pattern argument
67 .TP
68 \fBMYMAIL_DB_ROOT\fR
69 defaut value for the --db-root argument
70 .TP
71 \fBMYMAIL_DB_LIST\fR
72 defaut value for the --db-list argument
73 .TP
74 \fBMYMAIL_DB_FILE\fR
75 defaut value for the --db-file argument
76
77 .SH "SEARCH SYNTAX"
78
79 The search conditions take the form of a single letter followed by a
80 space and a regexp, which can itself contain spaces. If the condition
81 is prefaced by the character "!" it is negated, and has to be false
82 for a mail to be selected.
83
84 .TP
85 \fBf <regexp>\fR (from) selects mails whose leading line From, or
86 fields From:, Sender:, Reply-To:, or Return-Path: matches the regexp.
87 .TP
88 \fBt <regexp>\fR (to) selects mails whose field To:, Cc:, or Bcc: matches the regexp.
89 .TP
90 \fBp <regexp>\fR (participant) selects mails that would be selected by \fBf\fR or \fBt\fR.
91 .TP
92 \fBs <regexp>\fR (subject) selects mails whose field Subject: matches the regexp.
93 .TP
94 \fBd <regexp>\fR (date) selects mails whose field Date: matches the regexp.
95 .TP
96 \fBb <regexp>\fR (body) selects mails whose body matches the
97 regexp. Evaluatin such a condition requires to read the original
98 mboxes completely, which can be slow. However, header conditions are
99 checked first to read the bodies only for mails which fulfill them
100 entirely.
101 .TP
102 \fB8h\fR, \fBtoday\fR, \fB24h\fR, \fBweek\fR, \fBmonth\fR, and
103 \fByear\fR selects mails received during the last 8, 24, 24, 7 * 24
104 hours, 31 * 24 hours, and 365 * 24 hours respectively.
105 .TP
106 \fByesterday\fR selects mails received between 48h and 24h ago.
107 .TP
108 \fBmonday\fR, \fBtuesday\fR, ..., \fBsunday\fR selects mails received
109 the most recent such day
110
111 .SH "EXAMPLES"
112
113 The command
114
115 .RS
116 .EX
117 mymail --db-file /tmp/mymail/2010-2011/mymail.db \\
118        --index \\
119        ~/archives/mails/2010 ~/archives/mails/2011
120 .EE
121 .RE
122
123 will index all the mbox files present in the directories
124 ~/archives/mails/2010 and ~/archives/mails/2011 (recursively) and
125 create an index file /tmp/mymail/2010-2011/mymail.db
126
127 And
128
129 .RS
130 .EX
131 mymail --db-pattern '\.db$' --db-root /tmp/mymail \\
132        --output /tmp/mymail.mbox \\
133        --search 'p bob.something' \\
134        --search '!s spam' \\
135        --search 'month'
136 .EE
137 .RE
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.