Subversion Repositories sysadmin_scripts

Rev

Rev 50 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
42 rodolico 1
$config = {
50 rodolico 2
          'default' => { # defaults used when no value is given
3
                       'enabled' => 1, # account is not processed if value is 0
4
                       'testing' => '1', # gives a lot of messages, but doesn't do anything
5
                       'source' => { # where is the mail coming from
6
                                     'server' => 'localhost', # we're running the script on the mail server itself
7
                                     'system' => [ # do not delete any folders with these (case insensitive) names
42 rodolico 8
                                                   'Outbox',
9
                                                   'Sent Items',
10
                                                   'INBOX'
11
                                                 ],
50 rodolico 12
                                     'ignore' => [ # do not process messages in folders with any of these (case insensitive) names
42 rodolico 13
                                                   'Deleted Messages',
14
                                                   'Drafts',
15
                                                   'Junk E-mail',
16
                                                   'Junk',
17
                                                   'Trash'
18
                                                 ],
50 rodolico 19
                                     'age' => '18M', # anything older than this is ready to be archived, in days. M=monts, Y=years
20
                                     'deleteOnSuccess' => '1', # after successful copy, delete message on source
21
                                     'deleteEmptyFolders' => '1' # if any folder is empty (except system folders), delete it
42 rodolico 22
                                   },
23
                       'target' => {
50 rodolico 24
                                   'server' => 'localhost',
54 rodolico 25
                                   'hierarchy' => '<path>', # Store message in same path on target that it was on source
26
                                   'sleeptime' => '0.5', # time to sleep between messages, in seconds, to allow dovecot to catch up
42 rodolico 27
                                 },
28
                     },
29
          'accounts' => {
30
                          'user@example.com' => {
31
                                                  'testing' => '1',
32
                                                  'source' => {
50 rodolico 33
                                                                'system' => [ # this is ADDED to the default system folders
42 rodolico 34
                                                                              'Trash'
35
                                                                            ],
50 rodolico 36
                                                                'server' => 'smtp.example.com', # override default source server
42 rodolico 37
                                                                'username' => 'user@example.com',
38
                                                                'password' => 'imap password',
50 rodolico 39
                                                                'age' => '1Y', # override default old age limit
40
                                                                'ignore' => [ # these are ADDED to the default ignore folders
42 rodolico 41
                                                                              'ThisIsSpam',
42
                                                                              'ThisIsNOTSpam',
43
                                                                              'ToProcess',
44
                                                                            ],
45
                                                                'deleteEmptyFolders' => '1',
50 rodolico 46
                                                                'deleteOnSuccess' => '0' # override, leave messages on source after copy
42 rodolico 47
                                                              },
48
                                                  'target' => {
50 rodolico 49
                                                              'server' => 'archive.example.com', # override target server
50
                                                              'hierarchy' => '<path>^<year>^<month>', # stored in original path/year/month
42 rodolico 51
                                                              'username' => 'user_archive@archive.example.com',
52
                                                              'password' => 'imap password'
53
                                                            },
54
                                                  'enabled' => 1,
50 rodolico 55
                                                },
56
                          'user2' => { # this user uses defaults for everything, so all we need to do is put in username and password
57
                                                  'source' => {
58
                                                                'username' => 'user@example.com',
59
                                                                'password' => 'imap password',
60
                                                              },
61
                                                  'target' => {
62
                                                              'username' => 'user_archive@archive.example.com',
63
                                                              'password' => 'imap password'
64
                                                            },
42 rodolico 65
                                                }
66
                        }
67
        };