1 .TH "MYMAIL" "0.9.10" "July 2014" "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-t\fR, \fB--use-leading-time\fR
35 use the time stamp from the leading line of each mail and not the
38 \fB-f\fR, \fB--do-not-discard-mails-from-the-future\fR
39 keep mails with a date (more than 24h) in the future, which are
42 \fB-p <db filename pattern>\fR, \fB--db-pattern <db filename pattern>\fR
43 set the db filename pattern for recursive search
45 \fB-r <db root path>\fR, \fB--db-root <db root path>\fR
46 set the db root path for recursive search
48 \fB-l <db filename list>\fR, \fB--db-list <db filename list>\fR
49 set the semicolon-separated list of db files for search
51 \fB-m <mbox filename pattern>\fR, \fB--mbox-pattern <mbox filename pattern>\fR
52 set the mbox filename pattern for recursive search
54 \fB-s <search pattern>\fR, \fB--search <search pattern>\fR
55 search for matching mails in the db file. Multiple search requests can
56 be combined, and only mails fulfilling all of them will be extracted.
58 \fB-d <db filename>\fR, \fB--db-file-output <db filename>\fR
59 set the db filename for indexing
61 \fB-i\fR, \fB--index\fR
62 index mails in the mailboxes located recursively anywhere in the
63 directories following the options on the command lines
65 \fB-o <output filename>\fR, \fB--output <output filename>\fR
66 set the result mbox filename. If it is not set, the standard output is
69 \fB-n <max number of mails>\fR, \fB--nb-mails-max <max number of mails>\fR
70 set the maximum number of mails to extract (default is 250)
72 \fB-a <search key>\fR, \fB--default-search <search key>\fR
73 set the default search key. If a search request is not understood,
74 it is interpreted as the regexp with this default search key
76 .SH "ENVIRONMENT VARIABLES"
79 \fBMYMAIL_DB_PATTERN\fR
80 defaut value for the --db-pattern argument
83 defaut value for the --db-root argument
86 defaut value for the --db-list argument
89 defaut value for the --db-file-output argument
92 configuration file, default is ${HOME}/.mymailrc
94 .SH "SEARCH CONDITIONS"
96 A search condition is either a time-related condition
97 ('today', 'yesterday', etc.), or a single-character key, followed by a
98 space and a regexp, which can itself contain spaces.
100 If it is prefaced by the character "!", a condition is negated and has
101 to be false for a mail to be selected.
104 \fBf <regexp>\fR (from)
105 selects mails whose leading line 'From', or fields From:, Sender:,
106 Reply-To:, or Return-Path: matches the regexp.
108 \fBt <regexp>\fR (to)
109 selects mails whose field To:, Cc:, or Bcc: matches the regexp.
111 \fBp <regexp>\fR (participant)
112 selects mails that would be selected by \fBf\fR or \fBt\fR.
114 \fBs <regexp>\fR (subject)
115 selects mails whose field Subject: matches the regexp.
117 \fBd <regexp>\fR (date)
118 selects mails whose field Date: matches the regexp.
120 \fBb <regexp>\fR (body)
121 selects mails whose body matches the regexp. Evaluating such a
122 condition requires to read the full mail from the original mboxes,
123 which can be slow. To speed things up, all the header conditions are
126 \fB1h\fR, \fB8h\fR, \fB24h\fR, \fB48h\fR, \fBweek\fR, \fB2weeks\fR,
127 \fBmonth\fR, \fBtrimester\fR, \fBsemester\fR, and \fByear\fR select
128 mails received during the last 1, 8, 24, 48, 7 * 24 hours, 14 * 24
129 hours, 31 * 24 hours, 92 * 24 hours, 185 * 24 hours, and 365 * 24
133 selects mails received since midnight.
136 selects mails received yesterday.
138 \fBmonday\fR, \fBtuesday\fR, ..., \fBsunday\fR
139 select mails received the most recent such day of the week.
147 .B mymail --db-file-output /tmp/mymail/2010-2011/mymail.db \e
148 .B \ \ \ \ \ \ \ --index \e
149 .B \ \ \ \ \ \ \ ~/archives/mails/2010 ~/archives/mails/2011
152 will index all the mbox files present in the directories
153 ~/archives/mails/2010 and ~/archives/mails/2011 (recursively) and
154 create an index file /tmp/mymail/2010-2011/mymail.db
160 .B mymail --db-pattern '\.db$' --db-root /tmp/mymail \e
161 .B \ \ \ \ \ \ \ --output /tmp/mymail.mbox \e
162 .B \ \ \ \ \ \ \ --search 'p bob.something' \e
163 .B \ \ \ \ \ \ \ --search '!s spam' \e
164 .B \ \ \ \ \ \ \ --search 'month'
167 will search in all the database files *.db located (recursively) in
168 /tmp/mymail, for all the mails having "bob.something" as sender or
169 recipient, without "spam" in the subject, received over the last 31
170 days, and create an mbox file /tmp/mymail/mbox.
174 The configuration file is by default ${HOME}/.mymailrc and can also be
175 specified through the MYMAILRC environment variable.
177 It allows to define aliases of search keys, such as:
185 The search in the mail bodies does not decode mimencoding mails, hence
186 will not catch patterns in encoded text.
188 The mbox format is not clear for multipart messages, since the 'From'
189 may not always be quoted properly, so mymail uses a strict regexp to
190 recognize such lines.
192 The date format for the Date: field is not standardized, and may not
193 be parsed properly. When that happens, the time stamp from the
194 leading 'From' line of the mail, which has a canonical form, is used.
198 Written by Francois Fleuret <francois@fleuret.org> and distributed
199 under the terms of the GNU General Public License version 3 as
200 published by the Free Software Foundation. This is free software: you
201 are free to change and redistribute it. There is NO WARRANTY, to the
202 extent permitted by law.