Subversion Repositories sysadmin_scripts

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
42 rodolico 1
archiveIMAP copies or moves mail from one account to another. The action is calculated based on the configuration file
2
archiveIMAP.yaml which must exist in the same directory. The configuration file may contain information on any number of account
3
pairs, each of which is individually configurable. The script will process them in a random order (they are a Perl hash), but
4
all accounts which have the enabled flag on will be processed during a given run.
5
 
6
The configuration file is broken into two sections, default and accounts. Default values are also included in the script itself.
7
Order of precedence, from lowest to highest is:
8
 
9
script defaults
10
default section of configuration file
11
account section of configuration file
12
 
13
Default selections are:
14
 
15
account is enabled (enabled = 1)
16
testing is disabled (testing = 0)
17
 
18
For target
19
   hierarchy = <path> (use original source path on target server)
20
   server = localhost
21
For source
22
   age = 1 year (archive anything over this). This is the same as 365 and 12M
23
   delete empty folders is disabled (deleteEmptyFolders = 0)
24
   delete original message is disabled (deleteOnSuccess = 0
25
   server = localhost
26
   system folders = Outbox, Sent Items, INBOX
27
   ignored folders = Deleted Messages, Drafts, Junk E-mail, Junk, Trash
28
 
29
 
30
Again, by simply entering corresponding values into the default section of the configuration file, these values can be overridden.
31
For example, if your "normal" source server is smtp.example.com and your "normal" target server is archives.example.com, you
32
can enter those in the default section of the configuration file.
33
 
34
==== hierarchy =====
35
 
36
This is a pattern that will be used to generate the folder names on the target server. It can be any combination of
37
 
38
<path> - the original path on the source server
39
<year> - the four year part of the Date entry in a particular message header
40
<month>- the two digit month part of the Date entry in a particular message header
41
constant - constants will be placed as is. Be careful, there is no checking on that.
42
 
43
The delimiters for the hierarchy is the caret (^) since that seems to be the most innocuous.
44
 
45
To build an archive that has all e-mail separated only by the year and month they were sent, use:
46
<year>^<month>
47
 
48
If you would like the original tree, but again, with year and month, use
49
<path>^<year>^<month>
50
 
51
If you would like to put the word "Archives" in there, between the old path and the date/time, you could do
52
<path>^Archives^<year>^<month>