Archiving e-mails

From support-works
Revision as of 15:33, 20 August 2015 by Deenc (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search




Status: Published
Version: 1.0
Authors: HTL
Applies to: Supportworks ESP

Emails should be archived periodically in order to avoid performance issues caused by attempting retrieve a large number of emails via the client each time a folder / sub-folder is accessed. The following method Archives emails by moving the mail to folders / sub-folders within the Mailbox folder structure. It should be noted that the maximum recommended number of emails in each folder/sub-folder should not exceed 4000.

Administrators can create folders and sub-folders and subsequently move mail messages to them via MySQL. However before proceeding, it is recommended that a full server backup is taken.

The following describes the necessary steps for the procedure (replace ‘MAILBOX’ with the name of the Shared Mailbox):

Use Sw_Messagestore;
Select * from Shared__MAILBOX_folders;

A list of folders and IDs will now be shown, make a note of the results.

Moving Emails to Subfolders:

You will be required to create the new folders / subfolders (replace ‘MAILBOX’ with the name of the Shared Mailbox, ‘folderparent’ with the FolderID of the main folder in which the sub folder will be created (if root set to 0) and ‘folderName’ with the appropriate value):

Insert into Shared__MAILBOX_folders (folderparent, foldername, folderhaschild, folderunreadcount) values ( FolderParent, 'FolderName', 0,0 );

Once completed, FolderID for the newly created folder can be obtained by running the following query:

Select folderid from shared__MAILBOX_folders where foldername = 'FolderName';

This will return an integer value. Use this integer in the following statement in place of FOLDERID and replace ORIGFolder with the Value for the existing folder from which items are being moved:

Update shared__MAILBOX_mailbox set MsgFolder = FOLDERID where msgfolder = OrigFolder limit 4000;

This will move 4000 items to the new folder. This can be repeated as required.

Once completed the emails will now be visible within the new folders from within the client.