Subversion Repositories sysadmin_scripts

Rev

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

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