Subversion Repositories sysadmin_scripts

Rev

Rev 108 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
42 rodolico 1
$config = {
108 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
8
            'Outbox',
9
            'Sent Items',
10
         'INBOX'
11
         ],
12
            'ignore' => [ # do not process messages in folders with any of these (case insensitive) names
13
            'Deleted Messages',
14
            'Drafts',
15
            'Junk E-mail',
16
            'Junk',
17
            'Trash'
18
         ],
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
22
         'adminUsername' => 'mailadmin', # if using an admin account to log in
23
         'adminPassword' => 'some really strong password',
24
         'adminSeparator' => '*'
25
      },
26
      'target' => {
27
         'server' => 'localhost',
28
         'hierarchy' => '<path>', # Store message in same path on target that it was on source
29
         'sleeptime' => '0.5', # time to sleep between messages, in seconds, to allow dovecot to catch up
30
         'adminUsername' => 'mailadmin',
31
         'adminPassword' => 'some really strong password',
32
         'adminSeparator' => '*'
33
      },
34
   },
35
   'accounts' => {
36
      'user@example.com' => {
37
         'testing' => '1',
38
         'source' => {
39
            'system' => [ # this is ADDED to the default system folders
40
               'Trash'
41
            ],
42
            'server' => 'smtp.example.com', # override default source server
43
            'username' => 'user@example.com',
44
            'password' => 'imap password',
45
            'age' => '1Y', # override default old age limit
46
            'ignore' => [ # these are ADDED to the default ignore folders
47
               'ThisIsSpam',
48
               'ThisIsNOTSpam',
49
               'ToProcess',
50
            ],
51
            'deleteEmptyFolders' => '1',
52
            'deleteOnSuccess' => '0' # override, leave messages on source after copy
53
         },
54
         'target' => {
55
            'server' => 'archive.example.com', # override target server
56
            'hierarchy' => '<path>^<year>^<month>', # stored in original path/year/month
57
            'username' => 'user_archive@archive.example.com',
58
            'password' => 'imap password'
59
         },
60
         'enabled' => 1,
61
      },
62
      'user2' => { # this user uses defaults for everything, so all we need to do is put in username and password
63
         'source' => {
64
            'username' => 'user@example.com',
65
            'password' => 'imap password',
66
         },
67
         'target' => {
68
            # in this case, we are using the admin credentials instead of knowing the individual
69
            # user, so all we need is the username
70
            'username' => 'user_archive@archive.example.com',
71
         },
72
      }
73
   }
74
};