1. About

This OBM component is only available for OBM configured on a Postgresql database.

2. Debian - Installation

2.1. System Requirements

  • Debian Squeeze or Wheezy

  • Obm 3.1

2.2. Imap Archive Installation

$ aptitude install obm-imap-archive

3. RHEL/CentOS - Installation

3.1. System Requirements

  • RHEL 6.x or CentOS 6.x

  • Obm 3.1

3.2. Imap Archive Installation

$ yum install obm-imap-archive

4. IMAP Archive Configuration

Once installed, you may configure the following parameters in the /etc/obm-imap-archive/obm-imap-archive.ini file:

/etc/obm-imap-archive/obm-imap-archive.ini example
#partition_suffix=archive
#batch_size=20
#transaction_timeout_in_seconds=3600

4.1. Batch size

IMAP Archive process copies emails by batch. Rather than copying all emails in one IMAP command, it’s safer and more flexible to copy them by batches.

For example, when IMAP Archive process has to copy 1000 emails from a folder, it will split the IMAP copy command in 50 IMAP copy commands:

  • copy emails 1 to 20

  • copy emails 21 to 40

  • …​

This configuration value is used to determine the number of emails copied in one batch.

This value has some impact in performances, a higher value should be faster.

But if a problem occurs during the treatment on a folder, the next treatment may duplicate some emails on this folder less than the batch size.

The default value is a good compromise between the performance and the potential number of duplicated emails.

4.2. Transaction timeout

This configuration value is used to define the transaction timeout to the database.

When processing, a transaction is opened per folder. This means that when archiving a huge amount of emails on a folder, transaction timeout may be reached.

As only one archive process is running at the same time on a domain, and this process is persisting only data in it’s own tables; we can use a huge value on this parameter, such as the default (one hour).

5. Cyrus configuration

5.1. Prerequisite

IMAP Archive service needs a specific partition in order to store the archived mails.

Such partition has to be created manually, as we want the OBM admin to choose where its archives are located.

5.2. About

Archive folders are stored in another Cyrus partition than other folders, this means that the system administrator can associate another file system to this partition.

5.3. Adding the archive partition

In order to achieve this task, you have to edit the Cyrus configuration file /etc/imapd.conf and add the IMAP Archive partition:

partition-domain_suffix: /var/spool/cyrus/folder

where:

  • domain is the name of the domain associated to this IMAP Archive partition (dots replaced by underscores)

  • suffix is the Cyrus archive partition suffix defined in the Configuration

  • folder may be any not existing folder (read the note below for more information)

Under Debian, the partition folder is automatically created by Cyrus when needed.
Don’t create it manually, as you may encounter rights issues.
The cyrus user must have write rights on the parent directory.

Under RHEL/CentOS, this folder is not created, you should create it manually,
and give rights to cyrus user such as other partitions.

In a Cyrus murder configuration, the archive partition should be added in each murder backends.

Then, you will have to restart Cyrus in order to run with the new configuration.

Each domain configured for IMAP Archive service should have a corresponding Cyrus partition.

Sample configuration /etc/imapd.conf if your domain is mydomain.org
partition-mydomain_org: /var/spool/cyrus/mydomain_org
partition-mydomain_org_archive: /var/spool/cyrus/mydomain_org_archive
partition-default: /var/spool/cyrus/mail
defaultpartition: default
# Debian Cyrus imapd.conf
# $Id$
# See imapd.conf(5) for more information and more options
...

6. Admin interfaces

6.1. Prerequisites

6.1.1. Grant Rights to the Admin Profile

In order to access the IMAP Archive pages, you have to give extra rights to the OBM domain administrators.

To grant all rights on domains to an OBM domain administrator, you have to modify Admin user’s profile.

To achieve this, authenticate with the OBM web interface as an Admin for the global domain (like admin0), click on Administration, User profiles then update the Admin profile.
There is a Specific settings section where you can give all rights on the domains line.

6.1.2. Enable IMAP Archive

You should enable IMAP Archive in the host(s) configuration, then select the corresponding host for your domain(s) configuration.

*IMAP Archive* host
Figure 1. IMAP Archive host
*IMAP Archive* domain
Figure 2. IMAP Archive domain

6.2. General information

The goal of this feature is to provide archived IMAP folders to users. Those folders represent an image of the user IMAP folders grouped by year. Users can only read those folders, and so will not be able to add, delete or perform any non-read action on them.

The process will not modify users' emails, users are still responsible on taking care of their quotas.

When the configuration is disable, no archive will be produce by the scheduler; and manual launch will not be available.

The scheduling configuration determines the eligible emails to archive. In other words, when you are setting the repeat kind:

  • to daily (time selection): each emails older than one day will be archived

  • to monthly (day of month and time selection): each emails older than one month will be archived
    Example: current date is 11-25-2014, day of month is set to 5 and time is set to 21:30
    next run will be 12-05-2014 21:30, and every emails older than 11-05-2014 will be archived.

  • …​

6.3. Consultation page

This page is displaying some basic information:

  • Past operations last three runs, with start time, end time and status linked to the treatment logs

  • Simulation button immediately launches a simulation run

  • Manual launch immediately launches a run

  • Next run date and time of the next scheduled treatment

  • Last failure last failure, with start time, end time and status linked to the treatment logs

*IMAP Archive* consultation
Figure 3. IMAP Archive consultation

6.4. Update page

This page is used to configure the treatment:

  • Activating check to activate the IMAP Archive on this domain

  • Scheduling basic scheduling configuration, with the next scheduled treatment

  • Main archive folder IMAP folder where all archives will be stored

  • Excluded folder IMAP folder to be excluded for each user

  • Users concerned Allows selecting a list of users to either include or exclude of the archiving process

  • Shared mailboxes concerned Allows selecting a list of shared mailboxes to either include or exclude of the archiving process

  • Send emails to list of emails to be annotated at the end of each treatment

Changing the value of the Main archive folder after one or more archive treatments will lead to undefined behaviour.
In this case, the previous Main archive folder will be interpreted as a standard IMAP folder, and so will be archived.

*IMAP Archive* update
Figure 4. IMAP Archive update

6.5. Logs page

When launching a simulation launch or a manual launch, a new tab containing logs will be opened. Emails annotation at the end of the treatment will also include a link to this page.

This page will be automatically refreshed every ten seconds.

*IMAP Archive* logs
Figure 5. IMAP Archive logs