1
.TH "archmbox" "1" "" "" ""
3
archmbox \- a simple email archiver
6
archmbox [ \fB\-h\fR | \fB\-\-version\fR ]
8
archmbox \fBMODE\fR [ \fBOPTIONS\fR ]
9
\fB\-d\fR \fIdate\fR \fImailbox\fR [ \fImailbox\fR ... ]
11
archmbox \fBMODE\fR [ \fBOPTIONS\fR ]
12
\fB\-o\fR \fIdays\fR \fImailbox\fR [ \fImailbox\fR ... ]
15
Archmbox is a simple email archiver written in perl; it parses one or more
16
mailboxes, select some or all messages and then perform specific
17
actions on the selected messages.
20
Four different \fBMODES\fR are available:
23
list mode, which is useful to list all selected messages before
24
archmbox performs the real operations (archiving or deleting)
26
kill mode, if messages should be deleted from the mailbox(es) rather
29
archive mode, to archive the selected messages in a different mailbox
31
copy mode, to copy selected messages from a source mailbox(es) without modifying it
34
Messages selection is based upon a date criteria; an absolute date or a
35
days offset can be specified. It is also possible to refine the selection
36
using regular expressions on the header fields of the message.
38
All archived messages are stored in a new mailbox with the same name of
39
the original one + .archived as extension (this is the default, but can be
40
changed); the archive mailbox can be saved in gz or bz2 compressed format
43
Please note that the archive mailbox format is always mbox,
44
regardless of original mailbox format. Moreover, mailboxes must be specified using the full path.
46
Messages are appended to the archive mailbox to allow multiple executions
47
of the script against the same mailbox.
50
\fB\-a\fR, \fB\-\-archive\fR
51
Selected messages are archived in a different mailbox.
54
\fB\-k\fR, \fB\-\-kill\fR
55
Selected messages are deleted rather than archived.
58
\fB\-l\fR, \fB\-\-list\fR
59
List all selected messages.
62
\fB\-y\fR, \fB\-\-copy\fR
63
Selected messages are copied from the source mailbox.
68
Creates a backup of the original mailbox before archmbox execution.
74
Use bzip2 to compress the archive mailbox (use with \-c).
77
\fB\-c, \-\-compress\fR
78
Compress the archive mailbox after script execution.
81
\fB\-d, \-\-date <date>\fR
82
Specifies the threshold date for messages. The date must be supplied in the
83
following format: yyyy\-mm\-dd
86
\fB\-D, \-\-date\-header\fR
87
Force the use of the "Date:" header to age a message. If the header is somehow
88
corrupt, the date/time informations are gathered for the beginning line of the
92
\fB\-e, \-\-extension <extension>\fR
93
Specifies the suffix for the archive mailbox; the default is \fIarchived\fR.
94
If \fInone\fR is specified, no suffix will be used (use carefully).
97
\fB\-f, \-\-full\-name\fR
98
Prepends the path of the mailbox to the name of the archive mailbox.
102
Specifies the format of the mailboxes to parse. Legal values are mbox and mbx.
110
\fB\-i, \-\-ignore <regexp>\fR
111
Any mailbox/directory matching <regexp> will be skipped while archiving.
114
\fB\-\-keep\-flagged\fR
115
Flagged messages will not be archived.
118
\fB\-\-keep\-unread\fR
119
Unread messages will not be archived.
122
\fB\-m, \-\-minsize\fR
123
Specifies the minimum size of the mailbox to be archived. Mailboxes smaller than <minsize> will not be parsed for archiving.
127
Do not follow symbolic links when processing mailboxes.
131
Suppress mailbox related warnings. Use only if you know what you're doing!
134
\fB\-\-omit\-prefix <prefix>\fR
135
Omit <prefix> from the name of the mailbox when full name (option \-f) is required.
138
\fB\-o, \-\-offset <days>\fR
139
Specifies the offset (in days) from today for threshold date of a message. This
140
option replaces \-d. If you specify \-1, archmbox will operate on all messages.
143
\fB\-p, \-\-path <directory>\fR
144
Specifies where to store the archive mailbox (default: ".").
145
<directory> must be specified using full path.
148
\fB\-r, \-\-reverse\fR
150
\fIoffset\fR or \fIdate\fR
151
value. It usually means
153
but with this switch, it means
157
\fB\-R, \-\-recursive\fR
158
Act recursively on directories. If one or more directories are specified on the
159
command line, all mailboxes stored in those directories will be parsed for
160
archiving. Implies option \-f.
163
\fB\-t, \-\-tmpdir <directory>\fR
164
Specify a temporary working directory. This value overrides the one specified at compilation time or the one hard coded in the script.
166
<directory> must be specified using full path.
169
\fB\-\-time <time>\fR
170
Use <time> in conjunction with <date> (option \-d) to refine the threshold age for archiving. <time> must be specified in the following format: hh:mm:ss.
174
Prints an overall summary of the archiving operations. The summary contains the number of parsed and skipped mailboxes, the total number of messages parsed and saved, the total space used and saved.
177
\fB\-v, \-\-verbose\fR
178
Verbosity level. Default is 1 (line per message) in \-\-list output. So, if set
179
to 1 it only lists msgid, sender and subject. With \-v=2, it also
184
Prints version number.
187
\fB\-x, \-\-regexp <header=regexp>\fR
188
It is specified in form \-x field='regexp', where field can be any header. The \fIheader\fR part is case sensitive, while the \fIregexp\fR part is not.
190
If message satisfies date range, but does not satisfy regexp match on specified field, it won't be archived.
192
The option can be specified more than once; in this case, the message is
193
regexp matched against all the given rules, an if it satisfies
194
\fIany\fR, it will be archived.
197
Archmbox is completely written in perl, but it uses some shell helpers to
198
perform its job (fuser, rm, gzip/gunzip etc.).
200
The correct path for the helpers (both required and optional ones) is probed at
201
installation time. If one required helper is missing the installation
202
will not take place. If one optional helper is missing, the feature provided using
203
that helper will be unavailable, but the script will be installed anyway.
205
All other relevant configuration options can be specified at installation time or at run time using the command line switches.
211
\fBarchmbox \-a \-b \-c \-e 01 \-f \-d 2002\-01\-01 \-p ~/mail\-archive ~/Mail/personal\-stuff\fR
213
This will archive all messages older than (received before...) Jan 1st 2002
215
\fIpersonal\-stuff\fR
216
mailbox in the Mail directory. Archive messages are
217
saved in a mailbox called
218
\fIMail\-personal\-stuff.01.gz\fR
220
\fI~/mail\-archive\fR
221
directory. After execution, you'll find a mailbox called
222
\fIpersonal\-stuff.backup\fR
227
Some simpler examples:
229
\fBarchmbox \-a \-o 15 ~/Mail/personal\-stuff\fR
231
This will archive all messages older than 15 days in
232
\fIpersonal\-stuff.archived\fR
233
(uncompressed mailbox).
235
\fBarchmbox \-a \-r \-o 15 ~/Mail/personal\-stuff\fR
237
The same as above, but only messages
239
than 15 days will be archived.
241
\fBarchmbox \-k \-o 15 ~/Mail/personal\-stuff\fR
243
This will delete all messages older than 15 days from
244
\fIMail/personal\-stuff\fR
246
\fBarchmbox \-a \-o 15 ~/Mail/* \-c\fR
248
This will archive all messages older than 15 days in
249
every mailbox found in
251
All the archive mailboxes will be compressed.
253
\fBarchmbox \-l \-r \-c /tmp/mbox \-o 20\fR
257
which are newer than 20 days.
258
Option \-c is meaningless (and so ignored...).
260
\fBarchmbox \-l \-r \-c /tmp/mbox \-o 20 \-a \-\-bzip2\fR
262
Same as above, but archiving is forced (\-a) and bzip2 is used for compression.
264
\fBarchmbox \-a \-x subject='archmbox' \-o 7 ~/mbox\fR
266
Select for archiving all messages older than 7 days whose subject field
267
satisfies regexp match
268
\fIsubject =~ /archmbox/\fR
269
(it is case insensitive).
271
\fBarchmbox \-l \-x subject='archmbox' \-x from='fritz' \-o 7 ~/mbox\fR
273
Select for archiving all messages older than 7 days whose subject field
278
(matches are case insensitive).
280
\fBarchmbox \-a \-o 5 \-R /tmp/mbox ~/Mail\fR
282
archmbox will archive all messages older than five days in
284
It then start parsing all mailboxes stored in
286
(recursion is active, and ~/Mail is a directory).
287
If one or more directories will be found in ~/Mail, those directories will be
290
\fBarchmbox \-a \-o \-1 ~/Mail/my_mbx_mailbox \-\-format mbx\fR
292
archmbox archives all messages stored in
295
\fImy_mbx_mailbox.archived\fR.
296
The source mailbox is a mbx mailbox (\-\-format mbx is used). The archive mailbox will be a mbox mailbox.
299
When the script has to decide if a message needs to be selected from the
300
mailbox, it looks for the header
302
generated by the mail server (this is
303
the first line of the message) and doesn't care about the date specified by the
304
sender's mail client. This is useful to avoid removing messages sent from
305
misconfigured mail clients.
306
This behavior can be changed by forcing the use of the "Date:" header (option \-D).
308
Not all options are meaningfull in all modes, ie compression is
309
meaningless in list or kill mode. If you specify a useless option for a
310
particular mode, archmbox simply ignores it.
312
Archmbox uses a working directory to store temporary mailboxes. A default value for that directory is hard coded in the script, but can be changed during the configuration/installation process (see INSTALL for details).
313
It might happen that your mailboxes are too big for the partition holding this temporary directory, or you might want to perform archiving on too much mailboxes at the same time. In other words, you may run out of space.
314
Use the \-t option to specify a suitable working directory at runtime.
316
If you see some differences in the mailbox's dimension (size/free space), keep in mind that your mailbox may contain a special message (512 bytes in size) with internal information related to the mailbox.
317
This message is meaningless for you, though archmbox recognizes it and lets you be aware of it. That message is left untouched in your source mailbox.
319
A few words about locking. There has been a discussion about archmbox handles
320
file locking. The answer is simple: no mailbox is ever locked.
321
The reason behind this behavior is that I want archmbox to be as least invasive as possible, so other kind of checks are performed to ensure that no data is lost (mailbox has changed/mailbox is in use by another program). I will surely add some locking mechanism in the future.
323
You don't need to execute archmbox as root... just take care to have write
324
permissions for the directories you use.
327
Archmbox can be downloaded from:
329
http://adc\-archmbox.sourceforge.net
331
Archmbox is distributed under the terms of the \fBGPL\fR
333
Copyright (C) 2001\-2005
335
Alessandro Dotti Contra <adotti@users.sourceforge.net>
337
Parts of the code were contributed by:
339
Alex Aminoff, Brian Medley, Buck Holsinger, Davor Ocelic, Fabrice Noilhan, Jayanth Varma, Juergen Edner, Laurent Cheylus, Nicolas Ecarnot, Paco Regodon, Scott Thompson.
341
The FreeBSD port is maintained by Talal Al\-Dik.
343
The OpenDarwin port is maintained by Markus Weissman.
346
Please report bugs to <adotti@users.sourceforge.net>