Introduction
The Mail Sync is a service which synchronises data between the TriSys database and any IMAP data store.
In summary the application essentially goes through the following life cycle:
Service is started, polling time is read from the Config file.
Waits for X minutes as specified in the polling time.
For each user configured with an IMAP account details the latest emails from the specified email folders and recorded into TriSys.
Sleep until the next poll is due.
Utility Install
In order to install this product run the MSI and leave all of the options at default unless you need to install to another location. However the size of the install is very small therefore I can’t see this being an issue:

During the install you will be prompted to enter the account credentials for the Windows account that the service will run under. Note that this is not a true modal dialog for some reason and therefore can get lost behind another window.

The account specified must have access to all of the TriSys shares (G drives) in order to save Emails to disk.
At the end of the install the Mail Sync Configuration file requires editing to setup the details of SQL Database to connect to and a system setting must be added to TriSys before the servers is started.
The file MailSync.Exe.Config can be found in the folder Mail Sync was installed into. The config file is an XML file and the valid start/end tags need to be maintained. The settings in the file should be set as follows :-
|
ServerName |
The name of the SQL Server to connect to |
|
UserName |
The username to login into the SQL Server as |
|
Password |
The above users password |
|
RefreshInterval |
The number of minutes to wait between each run of Mail Sync. Default is every 30 minutes. |
|
MaxThread |
The maximum number of threads Mail Sync will use. Default is 5 |
The system setting “MailSync Message Path” should be added to TriSys and set to the path where copies of the emails are to be saved. This folder needs to accessible by the user the service is run as.
Configuring User Accounts
The setting used by the service to access each users email account is taken from the users Contact record in TriSys. These settings can be found on the IMAP tab on the users Contact record as follows:-

|
Server |
The name of the IMAP Server |
|
User Name |
The users login name |
|
Password |
The users password. You will be prompted for the users password twice to ensure it is entered correctly. |
|
Port |
The port to connect to for the IMAP Server. Usually this is either 143 or 993 if SSL encryption is used. |
|
Use SSL |
Use Secure Sockets to communicate with the IMAP Server if supported. |
|
Sync Mailboxes |
A List of IMAP folders to sync. A comma-separated list of mailbox names can be entered. Any sub-folders of the specified folders are also synchronised. |
|
Last Synchronised |
The date the user as synchronised by Mail Sync. This is updated by the mail sync server and can be set back to pickup old email. |
Uninstalling
In order to remove the service simply go to the “Add/Remove Programs” or “Programs and Features” option under control panel, find the “TriSys Mail Sync” entry in the list of programs and click “Remove”:

Troubleshooting
The exchange synchronisation tool is relatively complex, coupled with the fact that it is handling large volumes of data and relies upon users can make it troublesome.
The service records log entries in to the Windows Application Event Log:

The next place to look for relevant information is the TriSys database in the “Email” tables.
The most common issue raised by users is that an Email has
gone missing. In order to track the said Email down you should follow its path
through the system, which involves these steps:
Get the subject of the Email in question and approximate time the Email was received.
Check the log file related to this user and see if it contains entries related to that Email (You should be able to search it for the subject). This will give you an immediate confirmation of whether the Email has been processed or not. If the Email cannot be found in here then check that the mailbox has been synchronising correctly and that the Email is prior to the last sync.
The next place to check is the Email table in the database. You may find that the Email is in there but it has been marked as deleted and is therefore not showing up for the user. This may be due to a rule which can be checked using the v_IllegalEMailsIncludingDeletedAndProcessed view.
You can force the system to re-process an Email and observe the output by executing the p_ProcessEmail stored procedure and passing it the Email in question. The output from this should give you some indication of why the Email ended up where it did.
