Subversion Repositories sysadmin_scripts

Rev

Rev 42 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 42 Rev 108
Line 1... Line 1...
1
archiveIMAP copies or moves mail from one account to another. The action is calculated based on the configuration file
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
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
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.
4
all accounts which have the enabled flag on will be processed during a given run.
5
 
5
 
-
 
6
NOTE: the actual configuration file is yaml (archiveIMAP.yaml), but I'm better at Perl structures, so the samples are written
-
 
7
in archiveIMAP.cfg.sample (Perl), then converted to archiveIMAP.yaml.sample using the included utility confToYAML.pl.
-
 
8
 
-
 
9
Two utilities are provided:
-
 
10
 
-
 
11
confToYAML.pl - reads a perl structure from stdin, returns the YAML equivilent to stdout
-
 
12
YAMLToconf.pl - Reads the file archiveIMAP.yaml and dumps it to stdout as a perl structure (NOTE, name of hashref should be changed)
-
 
13
 
6
The configuration file is broken into two sections, default and accounts. Default values are also included in the script itself.
14
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:
15
Order of precedence, from lowest to highest is:
8
 
16
 
9
script defaults
17
script defaults
10
default section of configuration file
18
default section of configuration file
Line 17... Line 25...
17
 
25
 
18
For target
26
For target
19
   hierarchy = <path> (use original source path on target server)
27
   hierarchy = <path> (use original source path on target server)
20
   server = localhost
28
   server = localhost
21
For source
29
For source
22
   age = 1 year (archive anything over this). This is the same as 365 and 12M
30
   age = 1 year (archive anything older than this). This is the same as 365 and 12M
23
   delete empty folders is disabled (deleteEmptyFolders = 0)
31
   delete empty folders is disabled (deleteEmptyFolders = 0)
24
   delete original message is disabled (deleteOnSuccess = 0
32
   delete original message is disabled (deleteOnSuccess = 0
25
   server = localhost
33
   server = localhost
26
   system folders = Outbox, Sent Items, INBOX
34
   system folders = Outbox, Sent Items, INBOX
27
   ignored folders = Deleted Messages, Drafts, Junk E-mail, Junk, Trash
35
   ignored folders = Deleted Messages, Drafts, Junk E-mail, Junk, Trash
Line 48... Line 56...
48
If you would like the original tree, but again, with year and month, use
56
If you would like the original tree, but again, with year and month, use
49
<path>^<year>^<month>
57
<path>^<year>^<month>
50
 
58
 
51
If you would like to put the word "Archives" in there, between the old path and the date/time, you could do
59
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>
60
<path>^Archives^<year>^<month>
-
 
61
 
-
 
62
 
-
 
63
==== master user ====
-
 
64
 
-
 
65
dovecot has the ability to be configured with one or more master users 
-
 
66
(see https://doc.dovecot.org/configuration_manual/authentication/master_users/), allowing this script to be run without knowledge
-
 
67
of a users credentials. This has been added as of this version with the addition of the keys
-
 
68
adminUsername
-
 
69
adminPassword
-
 
70
adminSeparator
-
 
71
Which can be placed in the source and/or target, and either in the default or individual accounts.