Added the "week" search criterion.
[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
57 .SH "ENVIRONMENT VARIABLES"
58
59 .TP
60 \fBMYMAIL_DB_PATTERN\fR
61 defaut value for the --db-pattern argument
62 .TP
63 \fBMYMAIL_DB_ROOT\fR
64 defaut value for the --db-root argument
65 .TP
66 \fBMYMAIL_DB_LIST\fR
67 defaut value for the --db-list argument
68 .TP
69 \fBMYMAIL_DB_FILE\fR
70 defaut value for the --db-file argument
71
72 .SH "SEARCH SYNTAX"
73
74 The search conditions take the form of a single letter followed by a
75 space and a regexp, which can itself contain spaces. If the condition
76 is prefaced by the character "!" it is negated, and has to be false
77 for a mail to be selected.
78
79 .TP
80 \fBf <regexp>\fR (from) selects mails whose leading line From, or
81 fields From:, or Reply-To: matches the regexp.
82 .TP
83 \fBt <regexp>\fR (to) selects mails whose field To:, Cc:, or Bcc: matches the regexp.
84 .TP
85 \fBp <regexp>\fR (participant) selects mails whose leading line From,
86 or fields From:, Reply-To:, To:, Cc:, or Bcc: matches the regexp.
87 .TP
88 \fBs <regexp>\fR (subject) selects mails whose field Subject: matches the regexp.
89 .TP
90 \fBd <regexp>\fR (date) selects mails whose field Date: matches the regexp.
91 .TP
92 \fBb <regexp>\fR (body) selects mails whose body matches the
93 regexp. Evaluatin such a condition requires to read the original
94 mboxes completely, which can be slow. However, header conditions are
95 checked first to read the bodies only for mails which fulfill them
96 entirely.
97 .TP
98 \fB8h\fR selects mails received during the last 8 hours.
99 .TP
100 \fBtoday\fR, \fB24h\fR selects mails received during the last 24 hours.
101 .TP
102 \fBweek\fR selects mails received during the last 7*24 hours.
103 .TP
104 \fByesterday\fR selects mails received between 48h and 24h ago.
105 .TP
106 \fBmonday\fR, \fBtuesday\fR, ..., \fBsunday\fR selects mails received
107 the most recent such day
108
109 .SH "EXAMPLES"
110
111 To index all the mbox files present in the directories
112 ~/archives/mails/2010 and ~/archives/mails/2011 (recursively) and
113 create a database file /tmp/mymail/2010-2011/mymail.db
114
115 .RS
116 .EX
117 mymail --db-file /tmp/mymail/2010-2011/mymail.db --index ~/archives/mails/2010 ~/archives/mails/2011
118 .EE
119 .RE
120
121 To search in all the database files *.db located (recursively) in
122 /tmp/mymail, for all the mails having bob.something as sender or
123 recipient, without "spam" in the subject, and create a result mbox
124 file /tmp/mymail/mbox
125
126 .RS
127 .EX
128 mymail --db-pattern '\\.db$' --db-root /tmp/mymail --search 'p bob.something' --search '!s spam' > /tmp/mymail.mbox
129 .EE
130 .RE
131
132 .SH "BUGS"
133
134 The search in the mail bodies does not decode mimencoding mails, hence
135 will not catch patterns in encoded text.
136
137 .SH "AUTHOR"
138
139 Written by Francois Fleuret <francois@fleuret.org> and distributed
140 under the terms of the GNU General Public License version 3 as
141 published by the Free Software Foundation. This is free software: you
142 are free to change and redistribute it. There is NO WARRANTY, to the
143 extent permitted by law.