Previous Topic

Next Topic

Book Contents

File synchronisation

MailRules can be used to ensure that files in remote locations are synchronised with those held at a central location (the 'master' collection). MailRules can do this intelligently by establishing which files have changed and only transmitting those files that have changed to the remote location, where they will similarly only replace files of an earlier version. This can be done for multiple folders and sub folders.

Furthermore, MailRules can establish if files have been removed from the 'master' collection and remove them from the remote location also.

We'll build this procedure up in three stages, each one demonstrating an aspect of MailRules functionality.

1. Creating a Standard Rule to send files that have changed

We start by creating an Outbound Rule by clicking the Add button on the Outbound Rule menu. MailRules shows us a blank Outbound Rule, the first thing we do is change the Rule Name to be more meaningful. The Rule Type defaults to Standard, this is fine for now.

File synchronisation 1

Next, we enter the recipients e-mail addresses into To:, we enter a Subject and some general explanatory text into the message body.

Now, click What and we'll select the folder & subfolders we'll be transmitting.

In What, we click Add Folder.. and select the folder we wish to transmit. Then, we tick Send subfolders and select "If date/time is newer".

File synchronisation 3

Finally, we need to say when this Rule should be sent. We click When, then Add and set a send time for EveryDay at 17:00.

File synchronisation 4

Now we click OK and the Rule is complete.

What will happen now: Every day, at 17:00, the contents of the folder we selected and it's subfolders will be inspected. Any files that have been amended since the last time they were sent will be e-mailed to the two recipients with a brief message. The recipients will be able to read this e-mail with their normal mail client and take whatever action they feel appropriate.

Note that the first time this Rule is sent, all the files from the folder & its subfolders will be transmitted - after this, changes will be tracked and only the amended files will be transmitted. Therefore, if you 'push' this Rule by using the Send Now button and then immediately attempt to send it again, nothing will be transmitted unless you or some process have changed the files.

2. Changing it to an Advanced Rule (to automatically store the data)

Select the Rule from the Outbound Rule menu and click Edit. We are now going to make MailRules work for us at the receiving end, so the first thing we do is change the Rule Type to Advanced. Notice that the Subject becomes "<<Advanced Rule>>" and cannot be changed - MailRules uses the Subject of the e-mail to transmit information to the recipient MailRules.

In order to transmit an Advanced Rule, we must be know the Advanced Rule Password that the recipient has specified in the Settings screen of their MailRules. For convenience, this password can be stored in the address book with the other contact details, so we should create Address Book entries for our two recipients. Click To: to access the Address Book. In the Address Book, click New and a blank contact will be created, enter the recipient name, e-mail address and the Advanced Rule password that their MailRules requires. Click Update to save the details. Create the second recipient, then click Select Recipients and double-click each recipient to bring them into the To: box. Now click OK to close the Address Book.

File synchronisation 5

Having entered our To: recipients into our Address Book, we can now specify where we would like the data to be saved at the destination. Click the Where tab and enter a destination directory/folder into the Folder/Alias, for example, C:\Inbound\Pottery. The folder that we wish to deliver to need not already exist at the destination, MailRues will create it if it does not. MailRules requires that you supply a Default Password for the destination (this is to allow persons outside of your address book to receive this rule as recipients supplied either by a Datasource or using the Reply To Sender options of Inbound and Advanced Outbound Rules). We also select Recreate sub folders.

File synchronisation 7

Now we click OK and the Rule is complete.

What will happen now: Every day, at 17:00, the contents of the folder we selected and it's subfolders will be inspected. Any files that have been amended since the last send time will be compressed & encrypted, then e-mailed to the two recipients. When MailRules running at the Recipients reads the e-mail, it will unencrypt the files, decompress them and finally place the contents in the folder specified under Folder/Alias. Additionally, because we used the Recreate sub folders option, files transmitted from subfolders of our original folder will be placed into similarly named subfolders.

Important note: if you are following these examples in MailRules, remember that your source files must change in some way, or no data will be transmitted.

3. How to remove files that are no longer members of our master collection

We only require a very minor change to our existing Outbound Rule to implement this last stage. Select the Outbound Rule from the Outbound Rule menu and click Edit.

Click the Where tab and, from the Replace Files drop-down, select "If date/time is newer". We are already transmitting only the files that are newer than those previously transmitted, so, theoretically, there should be no files newer at the destination. However, making this selection has presented us with some new options. Clicking Clear Redundant Files will instruct the destination MailRules to remove any files that were previously part of the 'master' collection and now no longer exist.

File synchronisation 8

Click OK and the Rule is fully defined.

What will happen now: Every day, at 17:00, the contents of the folder we selected and it's subfolders will be inspected. Any files that have been amended since the last send time will be compressed & encrypted, then e-mailed to the two recipients, in addition to this, the names of any files that have been removed (redundant files) will be transmitted. When MailRules running at the Recipients reads the e-mail, it will unencrypt the files, uncompress and finally place the contents in the folder specified under Folder/Alias, once this has been done, it will remove any files that were identified as Redundant.

Important note: if you are following these examples in MailRules, remember that your source files must change in some way, or no data will be transmitted.

Summary

In this topic you've seen:

See Also

Manage your e-mail

Simple file transfer

Large file transfer

Collaborating & unifying applications

Mass & personalised mailing

Respond to e-mail requests

Using MailRules as a List Server