1 .TH "MYMAIL" "0.9.2" "February 2013" "Francois Fleuret" "User Commands"
3 \" This man page was written by Francois Fleuret <francois@fleuret.org>
4 \" and is distributed under a Creative Commons Attribution-Share Alike
9 mymail \- A simple command line utility for indexing and searching mbox files
13 \fBmymail\fP [\fIoptions\fR] [\fI<mbox dir1>\fR [\fI<mbox dir2>\fR ... ]|\fI<db file1>\fR [\fI<db file2>\fR ... ]]
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.
20 It is similar in spirit to other tools such as mu or notmuch, but is
25 \fB-h\fR, \fB--help\fR
28 \fB-v\fR, \fB--version\fR
29 print the version number
31 \fB-q\fR, \fB--quiet\fR
32 do not write information during the search
34 \fB-p <db filename pattern>\fR, \fB--db-pattern <db filename pattern>\fR
35 set the db filename pattern for recursive search
37 \fB-r <db root path>\fR, \fB--db-root <db root path>\fR
38 set the db root path for recursive search
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
43 \fB-m <mbox filename pattern>\fR, \fB--mbox-pattern <mbox filename pattern>\fR
44 set the mbox filename pattern for recursive search
46 \fB-s <search pattern>\fR, \fB--search <search pattern>\fR search for
47 matching mails in the db file. Multiple search requests can be
48 combined, and only mails fulfilling all of them will be extracted.
50 \fB-d <db filename>\fR, \fB--db-file-generate <db filename>\fR
51 set the db filename for indexing
53 \fB-i\fR, \fB--index\fR
54 index mails in the mailboxes located recursively anywhere in the
55 directories following the options on the command lines
57 \fB-o <output filename>\fR, \fB--output <output filename>\fR set the
58 result mbox filename. If it is not set, the standard output is used
60 \fB-a <search field>\fR, \fB--default-search <search field>\fR
61 set the default search field. If a search request is not understood,
62 it is interpreted as the regexp with this default search field
64 .SH "ENVIRONMENT VARIABLES"
67 \fBMYMAIL_DB_PATTERN\fR
68 defaut value for the --db-pattern argument
71 defaut value for the --db-root argument
74 defaut value for the --db-list argument
77 defaut value for the --db-file argument
81 The search conditions take the form of a single letter followed by a
82 space and a regexp, which can itself contain spaces. If the condition
83 is prefaced by the character "!" it is negated, and has to be false
84 for a mail to be selected.
87 \fBf <regexp>\fR (from)
88 selects mails whose leading line From, or fields From:, Sender:,
89 Reply-To:, or Return-Path: matches the regexp.
92 selects mails whose field To:, Cc:, or Bcc: matches the regexp.
94 \fBp <regexp>\fR (participant)
95 selects mails that would be selected by \fBf\fR or \fBt\fR.
97 \fBs <regexp>\fR (subject)
98 selects mails whose field Subject: matches the regexp.
100 \fBd <regexp>\fR (date)
101 selects mails whose field Date: matches the regexp.
103 \fBb <regexp>\fR (body)
104 selects mails whose body matches the regexp. Evaluating such a
105 condition requires to read the original mboxes completely, which can
106 be slow. However, header conditions are checked first to read the
107 bodies only for mails which fulfill them entirely.
109 \fB8h\fR, \fBtoday\fR, \fB24h\fR, \fBweek\fR, \fBmonth\fR, and
111 selects mails received during the last 8, 24, 24, 7 * 24 hours, 31 *
112 24 hours, and 365 * 24 hours respectively.
115 selects mails received between 48h and 24h ago.
117 \fBmonday\fR, \fBtuesday\fR, ..., \fBsunday\fR
118 selects mails received the most recent such day of the week
126 .B mymail --db-file /tmp/mymail/2010-2011/mymail.db \e
127 .B \ \ \ \ \ \ \ --index \e
128 .B \ \ \ \ \ \ \ ~/archives/mails/2010 ~/archives/mails/2011
131 will index all the mbox files present in the directories
132 ~/archives/mails/2010 and ~/archives/mails/2011 (recursively) and
133 create an index file /tmp/mymail/2010-2011/mymail.db
139 .B mymail --db-pattern '\.db$' --db-root /tmp/mymail \e
140 .B \ \ \ \ \ \ \ --output /tmp/mymail.mbox \e
141 .B \ \ \ \ \ \ \ --search 'p bob.something' \e
142 .B \ \ \ \ \ \ \ --search '!s spam' \e
143 .B \ \ \ \ \ \ \ --search 'month'
146 will search in all the database files *.db located (recursively) in
147 /tmp/mymail, for all the mails having "bob.something" as sender or
148 recipient, without "spam" in the subject, received over the last 31
149 days, and create an mbox file /tmp/mymail/mbox.
153 The search in the mail bodies does not decode mimencoding mails, hence
154 will not catch patterns in encoded text.
156 The mbox format is not clear for multipart messages, since the ^"From
157 " lines are not always quoted properly (at least the ones I have to
162 Written by Francois Fleuret <francois@fleuret.org> and distributed
163 under the terms of the GNU General Public License version 3 as
164 published by the Free Software Foundation. This is free software: you
165 are free to change and redistribute it. There is NO WARRANTY, to the
166 extent permitted by law.