Subversion Repositories sysadmin_scripts

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

archiveIMAP copies or moves mail from one account to another. The action is calculated based on the configuration file
archiveIMAP.yaml which must exist in the same directory. The configuration file may contain information on any number of account
pairs, each of which is individually configurable. The script will process them in a random order (they are a Perl hash), but
all accounts which have the enabled flag on will be processed during a given run.

The configuration file is broken into two sections, default and accounts. Default values are also included in the script itself.
Order of precedence, from lowest to highest is:

script defaults
default section of configuration file
account section of configuration file

Default selections are:

account is enabled (enabled = 1)
testing is disabled (testing = 0)

For target
   hierarchy = <path> (use original source path on target server)
   server = localhost
For source
   age = 1 year (archive anything over this). This is the same as 365 and 12M
   delete empty folders is disabled (deleteEmptyFolders = 0)
   delete original message is disabled (deleteOnSuccess = 0
   server = localhost
   system folders = Outbox, Sent Items, INBOX
   ignored folders = Deleted Messages, Drafts, Junk E-mail, Junk, Trash


Again, by simply entering corresponding values into the default section of the configuration file, these values can be overridden.
For example, if your "normal" source server is smtp.example.com and your "normal" target server is archives.example.com, you
can enter those in the default section of the configuration file.

==== hierarchy =====

This is a pattern that will be used to generate the folder names on the target server. It can be any combination of

<path> - the original path on the source server
<year> - the four year part of the Date entry in a particular message header
<month>- the two digit month part of the Date entry in a particular message header
constant - constants will be placed as is. Be careful, there is no checking on that.

The delimiters for the hierarchy is the caret (^) since that seems to be the most innocuous.

To build an archive that has all e-mail separated only by the year and month they were sent, use:
<year>^<month>

If you would like the original tree, but again, with year and month, use
<path>^<year>^<month>

If you would like to put the word "Archives" in there, between the old path and the date/time, you could do
<path>^Archives^<year>^<month>