Subversion Repositories sysadmin_scripts

Rev

Rev 42 | Rev 54 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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