Archiving Emails from G Suite

This implementation guide covers the specifics of archiving G Suite mailboxes. It is assumed that you already have a MailStore Server installation or test installation and are familiar with the fundamentals of MailStore Server. Please refer to the Manual or the Quick Start Guide for more information.

MailStore Server offers several ways to archive emails from G Suite mailboxes, which are described below. If you are not sure which archiving method best suits your company, please refer to the chapter Choosing the Right Archiving Strategy.

Synchronizing Users

It is required to first set up a synchronization with G Suite as described in chapter G Suite Integration of the MailStore Server manual as the API credentials needed to configure archiving must first be created in the G Suite Integration configuration process.

Note that while G Suite uses it's own internal user database, this itself can be synchronized with external LDAP or Active Directory environments. Even if the G Suite directory is not the primary source of user account information, it is highly recommended to synchronize MailStore Server directly with G Suite to fetch all relevant information such as email addresses.

Archiving Individual Mailboxes

The following steps describe the setup of a single mailbox archiving profile by an administrator using a special service account. Alternatively, a single Gmail mailbox can also be archived using the GMail archiving profile in MailStore where the mailbox owner authorizes mailbox access by MailStore Server through OAuth.

In MailStore Server G Suite archiving tasks are stored in archiving profiles. By following the procedure described here you can archive a single G Suite mailbox for a specific MailStore user. The archiving process can be executed manually or automatically. You can find further information about executing archiving profiles in chapter Email Archiving with MailStore Basics.

Please proceed as follows for each individual mailbox:

Make sure that you configured the service account as descibes in the G Suite Integration chapter of the MailStore Server manual.

Log on to MailStore Client as MailStore administrator. Only an administrator can archive emails via a G Suite Service Account.

Click on Archive Email.

From the Email Servers list in the Create Profile area of the window, select G Suite to create a new archiving profile.

A wizard opens to assist in specifying the archiving settings.

Select Single Mailbox and click on OK.

Configure the basic archiving settings. The JSON file generated by Google for the service account during the G Suite Integration configuration is also required for mailbox access.

Fill out the following fields:

Email AddressThe email address of the user to be archived.

Key IDTo import the private key, select the JSON file that has been generated by Google for the service account.

Service AccountThe service account is determined automatically from the JSON file.

Received and SentThe target folder in which MailStore will store received and send email.

Archive SpamG Suite spam folders are excluded by default, but can be archived by selecting this option.

Important notice: MailStore will archive all mail contained within the selected mailbox, excluding Spam and Deleted messages. Due to the nature of how Google represents user defined labels in IMAP, they are not supported by MailStore; as a consequence, the entire mailbox will be archived.

Click on Next.

If needed, adjust the filter and the deletion rules. By default, no emails will be deleted from the mailbox. The Timeout value only has to be adjusted in specific cases. Please keep in mind that these settings apply to all mailboxes to be archived.

Click on Next.

The Target Archive must be specified. Select the archive of the user for whom the selected mailbox is to be archived. If the user does not exist yet, click on Create a New User.

Click on Next.

In the last step, a name for the archiving profile can be specified. After clicking Finish, the archiving profile will be listed under Saved Profiles and can be run immediately or automatically, if desired.

Archiving Multiple Mailboxes Centrally

By following the procedure described here, multiple G Suite mailboxes can be archived without specific configuration for each MailStore user. The archiving process can be executed manually or automatically.

Make sure that you configured the service account as described in the G Suite Integration chapter of the MailStore Server manual.

Log on to MailStore Client as MailStore administrator. Only an administrator can archive emails via a G Suite Service Account.

Click on Archive Email.

From the Email Servers list in the Create Profile area of the window, select G Suite to create a new archiving profile.

A wizard opens to assist in specifying the archiving settings.

Select Multiple Mailboxes and click on OK.

Configure the basic archiving settings. The JSON file generated by Google for the service account during the G Suite Integration configuration is also required for mailbox access.

Fill out the following fields:

Key IDTo import the private key, select the JSON file that has been generated by Google for the service account.

Service AccountThe service account is determined automatically from the JSON file.

Received and SentThe target folder in which MailStore will store received and send email.

Archive SpamG Suite spam folders are excluded by default, but can be archived by selecting this option.

Important notice: MailStore will archive all mail contained within the selected mailbox, excluding Spam and Deleted messages. Due to the nature of how Google represents user defined labels in IMAP, they are not supported by MailStore, as a consequence, the entire mailbox will be archived.

Click on Next.

If needed, adjust the filter and the deletion rules. By default, no emails will be deleted from the mailbox. The Timeout value only has to be adjusted in specific cases. Please keep in mind that these settings apply to all mailboxes to be archived.

Click on Next.

Select the users whose mailboxes are to be archived.

The following options are available:

All users with configured email addressChoose this option to archive the mailboxes of all users who are set up, along with their email addresses, in MailStore's user management.

All users except the followingChoose this option to exclude individual users (and thereby their G Suite mailboxes) from the archiving process, using the list of users below.

Only the following usersChoose this option to include individual users (and thereby their G Suite mailboxes) in the archiving process, using the list of users below. Only the mailboxes of those users explicitly specified will be archived.

Synchronize with Directory Services before archivingIf selected, the MailStore user list will be synchronized with the configured directory service before any archiving process is executed. This has the advantage that, for example, new employees will be created as MailStore users before archiving, so once the archiving process is executed, their G Suite mailbox is archived automatically as well. This option is especially recommended when the archiving process is to be executed automatically.

Click on Next.

In the last step, a name for the archiving profile can be specified. After clicking Finish, the archiving profile will be listed under Saved Profiles and can be run immediately or automatically, if desired.

Archiving Incoming and Outgoing Emails Directly

MailStore can archive all incoming and outgoing emails of all users within a G Suite email domain. Using this scenario it is possible to ensure a complete and compliant archive.

Basic Functionality

In G Suite, Google Mail can be configured to forward a copy of all incoming, outgoing or internal email traffic to an external mailbox.

MailStore Server can be configured to archive this so called multidrop mailbox at regular intervals. During this process, the emails from the multidrop mailbox will be assigned to their respective MailStore users (i.e. their user archives) automatically. This means that each user is able to view only their own emails.

Before the archiving process can be set up in MailStore Server, email forwarding has to be set up for the G Suite email domain.

Step 1: Configuring email forwarding for a G Suite email domain

Please proceed as follows:

Log on to your G Suite domain as an administrator.

Navigate to Apps > G Suite > Settings for Gmail > Advanced settings.

Configure Receiving routing:

Under Also deliver to, activate the Add more recipients option.

Select Advanced and activate the Change envelope recipient option.

Enter the email address of the multidrop mailbox into the Replace recipient field.

Activate the Add X-Gm-Original-To header option.

Click on Save further down the window and then on Add setting.

Repeat steps 1 to 5 for Sending routing.

Click on Save changes.

Important: The multidrop mailbox needs to be an external IMAP mailbox, that must not belong to the G Suite email domain because the Gmail duplicate detection would drop identical emails that have been addressed to several recipients. By using an internal Gmail mailbox completeness of the archive cannot be achieved.

Step 2: Setting up the Archiving Process

The above settings will ensure that a copy of all emails will be forwarded to a single external multidrop mailbox. MailStore extracts the sender and recipient information from the email headers to assign them to the appropriate users. By using this type of mailboxes it is possible to archive all incoming and outgoing emails.

Setting up archiving processes for multidrop mailboxes is done using archiving profiles. General information about archiving profiles is available in chapter Working with Archiving Profiles.

Please proceed as follows:

Log on as MailStore administrator using MailStore Client.

In MailStore, click on Archive Email.

To create a new archiving profile, select G Suite from the Email Server list in the Create Profile area of the application window.

A wizard opens guiding you through the setup process.

Select Multidrop Mailbox and click OK.

Fill out the fields Access via, Host, Username and Password. Click on Test to verify the data entered.

For the TLS and SSL protocols only: You have the option to ignore SSL warnings. Generally, these warnings appear if an unofficial certificate is used on the server.

Adjust any further settings such as how to handle emails with unknown addresses or asking MailStore to delete emails after they have been archived. The latter option is especially sensible when dealing with mailboxes that are exclusively used for archiving.

Click on Next.

The timeout value only has to be adjusted on a case-by-case basis (e.g. with very slow servers).

Click on Next.

At the last step, select a name for the new archiving profile. After clicking on Finish, the archiving profile will be listed under Saved Profiles and can be run immediately or automatically, if desired.