README.md
1mailest - search mail messages with Hyper Estrairer
2===================================================
3
4"mailest" provides a search engine backend for
5[Hyper Estraier](http://fallabs.com/hyperestraier/index.html)
6to
7[Mew](http://www.mew.org/)
8and maintains its id index database.
9
10- Makes `V`, `k/` or other related commands ready just after
11 receiving/refiling mails into folders.
12
13- No need to create index manually.
14 - "mailest" daemon (mailestd) does it automatically by monitoring
15 changes in the mail folders using kqueue or inotify.
16
17
18Install
19-------
20
21On OpenBSD or FreeBSD, pre-compiled package is available. The following
22procedure is the way to compile it from source code.
23
24Prerequisite:
25
26- "hyperestraier" and "qdbm" installed
27- "libevent" and "libiconv" are required
28
29
30OpenBSD:
31
32 % ftp https://github.com/yasuoka/mailest/archive/mailest-0.9.24.tar.gz
33 % tar xzf mailest-0.9.24.tar.gz
34 % cd mailest-mailest-0.9.24.
35 % make
36 % sudo make install
37
38Others:
39
40 % wget https://github.com/yasuoka/mailest/archive/mailest-0.9.24.tar.gz
41 % tar xzf mailest-0.9.24.tar.gz
42 % cd mailest-mailest-0.9.24.
43 % ./configure
44 % make
45 % sudo make install
46
47 On BSD, You may need to use "gmake" instead of "make" to use GNUmakefile
48
49
50Upgrading from previous releases
51--------------------------------
52
53Terminate the running mailest daemons before upgrading because:
54
55 - The mailest communication protocol between its server and its
56 clients may be changed between the versions and the compatibility
57 between the versions is not guaranteed.
58 - Use `mailestctl stop` or send a termination signal (SIGTERM) to stop
59 the mailest programs.
60
61
62How to start
63------------
64
65+ For existing `mewest` users: Backup and/or delete the database
66 (`~/Mail/casket`).
67
68 - `V` (dialog) is not compatible with database generated by `mewest`
69 while the other functionality of "mailestd" works with it. Remove
70 the database if you want to use `V`.
71
72+ Add the following line to `.mew.el` to let Mew use "Hyper Estrairer" for
73 search:
74
75 (setq mew-search-method 'est)
76
77+ Add the following lines to `~/.emacs` to use the "mailest" instead of
78 "mewest".
79
80 (defvar mew-prog-est "mew-mailest")
81 (defvar mew-prog-est-update "mew-mailest")
82 (defvar mew-prog-cmew "cmew-mailest")
83 (defvar mew-prog-smew "smew-mailest")
84 (defvar mew-id-db-file ".mailest.sock")
85
86+ Try `km`, `kM`, `k/`, `k?`, `V` in Mew. See
87 http://mew.org/en/info/release/mew_6.html#dbsearch for search commands
88 in Mew.
89
90
91Usage
92-----
93
94- "mailest" daemon will be invoked by the following operations on Mew
95 - Search or virutal folder operations (`V`, `k/` and so on)
96 - Making index operations (`km` or `kM`)
97- or you can use "@reboot" in your crontab like the following line if
98 you want start it automatically when boot.
99
100 @reboot mailestctl start
101
102- After the daemon starts, it monitors the changes on the folders
103 which have already been indexed.
104- Upon `kM`, "mailest" starts monitoring for newly created folders
105 as well. Otherwise `km` is required for monitoring new folders.
106- Others
107 - to stop the daemon: `mailestctl stop`
108 - to watch behaviour of the daemon: `tail -f ~/Mail/mailestd.log`
109 - to suspend/resume indexing: `mailestctl suspend` or `mailestctl resume`
110 - to stop monitoring the folders: add `monitor disable`
111 to `~/Mail/mailestd.conf`.
112
113See [man pages](#man-pages) also.
114
115
116ChangeLog
117---------
118
1190.9.24
120
121 - Fix a wrong ASSERT() introduced at 0.9.23 (e5076c8a)
122 - Apply many fixes for parse.y on OpenBSD
123
124
1250.9.23
126
127 - Fix the creating draft tasks to be run not on the busiest database
128 thread but on the main thread. This had been desired by design, but
129 it hadn't been implemented correctly.
130 - Fix a bug which may refer the tree for all messages during its
131 modification. If this happens the daemon crashes with ASSERT if it
132 is enabled.
133 - Improve the man page. Description for `trim-size` is added.
134 - Mew had freezed by `csearch` command from `mailestctl` because the
135 command doesn't get any response when the database is unusable.
136 - Make guess-parid work even for a message which doesn't have a "Date"
137 field.
138
139
1400.9.22
141
142 - Fix smew not to loop infinately
143
144
1450.9.21
146
147 - Fix mailestd not to mistakenly delete a message from the database,
148 as a result, it stopps working since it presumes the database is
149 broken. (Reported by by Yoshiaki Kasahara)
150 - Fix: When mailestd starts up, "DB Sync" splits the messages in some
151 chunks. The last message in chunk had been mistakenly treated it is
152 a target of "guess-parid".
153 - Fix: index for @title was not created
154 - Add size check in log function. Pointed out by Yuuich Someya for
155 npppd.
156 - Fix some LOG_DEBUG messages to use a canonical folder name.
157 - Fix the way of referencing to libestdir. Suggested by Hiroki Sato.
158 - Fix BSD make.
159 - Fix BSD make build on NetBSD.
160 - Fix a bug in mailestd.conf(5).
161
162
1630.9.20
164
165 - Use the realpath always for folders not to treat the path with
166 symbolic links and the realpath as different folders. (Found
167 by Yoshiaki Kasahara)
168 - Improve log and comment a bit.
169
170
1710.9.19
172
173 - Fix some variables in BSD make not to have DESTDIR doublely.
174 - Remove a debug log output in #ifdef MONITOR_INOTIFY.
175 - Fix typos in log message.
176
177
1780.9.18
179
180 - Fix off-by-one in mailestctl. It crashed by using "csearch"
181 (mew-mailest). (Found and debugged by Yoshiaki Kasahara)
182 - Fix ./configure to select kqueue or inotify properly.
183 - s/cascket/casket/ (Pointed out by Yoshiaki Kasahara)
184
185
1860.9.17
187
188 - Fix "update" related logs to show the entire path name.
189 (diff from Hiroki Sato)
190
191
1920.9.16
193
194 - Fix "smew -p" to work.
195
196
1970.9.15
198
199 - Monitoring were not enabled on some systems (atleast on FreeBSD).
200 Fixed autoconf to choice kqueue() or inotify() properly. (Pointed
201 out by Yoshiaki Kasahara)
202
203
2040.9.14
205
206 - Support "smew -p" and "smew -c" so that Mew '^' and '&' work.
207 (pointed out by Yoshiaki Kasahara)
208 - Fix and refine build on FreeBSD (diff from Hiroki Saito)
209 - Fix build on the systems which need -liconv for iconv_open().
210 (diff from Yoshiaki Kasahara)
211 - Internal size for message-id may be too short. Use 255 for it.
212 - When "guess-parid" failed to find the parent message, add dummy
213 x-mew-parid not to try to find the parent message ever.
214 - Fixed: "guess-parid" is too slow since mailestd failed to create the
215 index of "@title" on startup.
216 - Fixed to create the index for "@title" properly.
217
218
2190.9.13
220
221 - Add "guess-parid" configration option to find the parent message
222 for the messages which don't contain "In-Reply-To" or "Reference"
223 header by guessing with "Subject" and "Date". Add the following
224 to `~/Mail/mailestd.conf`.
225
226 guess-parid
227
2280.9.12
229
230 - Improve logging
231 - Tweak log levels
232 - Fix parsing "monitor" in mailestd.conf
233
2340.9.11
235
236 - Fix not to change current working directory.
237 - Fix: invalid memory access in mailestd_db_smew().
238
2390.9.10
240
241 - Fix build on operating system which use kqueue for monitor.
242
2430.9.9
244
245 - Monitor the inodes the directories (by kevent and inotify) and start
246 update automatically.
247 - Fixed error in replace.h which is to redefine RB_FOREACH_SAFE.
248 - Optimize database when many documents are put or deleted. As the
249 Hyper Estrairer's documet is recomended.
250 - Unlimit the resource limit of the data size when process startup.
251
2520.9.8
253
254 - Add 'smew' functionality. Add `smew` command to mailestctl(1).
255 To use 'smew' of 'mailestd', add below lines:
256
257 (defvar mew-prog-cmew "cmew-mailest")
258 (defvar mew-prog-smew "smew-mailest")
259 (defvar mew-id-db-file ".mailest.sock")
260
261 and delete the existing database and create the database again.
262 - Made the 'message-id' attribute indexed.
263 - Create `x-mew-parid` indexed attribute for each message.
264 - Add `message-id` command to mailestdctl(1).
265
2660.9.7
267
268 - Fix: When the database doesn't exists, the database thread stopps
269 forever.
270 - Fix: When the database is error, the first update causes a lot
271 of errors.
272
2730.9.6
274
275 - Fix: cannot search non ASCII/UTF-8 mails
276 - Fix: mailestd exits abnormally sometimes when it is stopped during
277 syncing DB.
278
279
2800.9.5
281
282 - First "update" to huge database taked long time. Fix it not to wait
283 database cache updating before update starts.
284 - Fix the results of "update" to be passed correctly.
285 - Support build on FreeBSD and NetBSD
286
287Man pages
288---------
289
290- [mailestctl(1)](http://yasuoka.github.io/mailest/mailestctl.1.html)
291- [mailestd(8)](http://yasuoka.github.io/mailest/mailestd.8.html)
292- [mailestd.conf(5)](http://yasuoka.github.io/mailest/mailestd.conf.5.html)
293- [mew-mailest(8)](http://yasuoka.github.io/mailest/mew-mailest.1.html)
294
295
296Differences from `mewest`
297-------------------------
298
299Creation of backup copy of the database
300
301 "mailest" does not create a backup copy of the database before updating it
302 whereas `mewest` does. Hyper Estrairer database breaks easily
303 if a program (or a system) crashes during updating it.
304
305
306TODO
307----
308
309- When indexing huge amount of mails, smew takes very long time. Find
310 a way to workaround this.
311- Delete the index physically
312- Automatically create a backup copy of the database when closing the
313 writable DB connection. Also recover the database automatically
314 when it is broken.
315
316
317Copyright
318---------
319
320Licenses other than "libestdraft" are BSD or OpenBSD license. Only
321"libestdraft" is derived from Hyper Estrairer's estcmd.c, it's LGPL.
322See the source code to check the entire copyright.
323