CodeTwo Exchange Rules Pro is the ultimate powerhouse tool in the hands of an Exchange administrator. On a very general level it lets you create rules that redefine email flow and modify email content in your organization.
A common example of the program’s application is extended control over server-level email signatures. There are, however, numerous other ways it can be utilized. In this article I will talk about one of them: archiving attachments from outgoing email in SharePoint server libraries. A feature that can prove very useful when it comes to monitoring what your users send to external recipients.
My environment
For the purpose of this presentation, I have prepared the following server environment:
Domain: example.com
Domain controller: DC.example.com
Exchange Server 2013 CU13 (EX2013.example.com)
SharePoint Server 2013 SP1 (SP2013.example.com)
All servers operated by Windows Server 2012 R2
I deployed a domain controller running Exchange 2013 in the internet.com domain, so that I can simulate email going out into the Internet.
Scenario
Imagine a scenario in which a Sales manager, in order to audit attachments sent by his or her department, wants to archive the attachments in a dedicated library on a SharePoint 2013 server. The additional requirements are that:
- the collection should only apply to files with .doc, .docx and .pdf extensions
- only emails traveling outside of the organization are to be audited
- apart from the filename, saved attachments should also include the senders’ names
Infrastructure preparation
In order to meet the above requirements, the following IT infrastructure elements will be necessary:
– SharePoint server,
– Exchange server,
– CodeTwo Exchange Rules Pro software installed on the Exchange server,
1. Set up a new document library on the SharePoint server and give the Exchange Trusted Subsystem user write permissions to it.
(In my example I created a new subsite named “Sales” with a new document library named “Sales External Attachments” inside it.)
2. Start the WebDAV client service on the Exchange server. The protocol allows for managing files on www servers. With it enabled, Exchange will be able to access SharePoint libraries like standard network resources. Depending on the version of the operating system the WebDAV protocol client can be started by:
– Windows Server 2008/2008 R2 – in the Add Feature Wizard add the Desktop Experience feature
– Windows Server 2012/2012 R2 – in the Add Feature Wizard expand User Interface and Infrastructure and add the Desktop Experience feature
NOTE: The WebDAV client service needs to be installed on all Exchange servers running the Transport service. Specifically:
- Exchange 2007 – Hub Transport servers,
- Exchange 2010 – Hub Transport servers,
- Exchange 2013 – Mailbox servers,
- Exchange 2016 – Mailbox servers,
3. Once the WebDAV client service has been installed, go to the services.msc snap-in and start the WebClient service (remember to set the Startup type to Automatic):
Having done all this, you should now be able to browse SharePoint libraries as UNC paths via Windows Explorer on all Exchange transport servers.
My example produced the below path:
\\sp2013\DavWWWRoot\Example\sales\Sales External Attachments (the key folder being DevWWWRoot)
UNC paths are a common problem in SharePoint. If you get stuck, as a workaround, try mapping the SharePoint library as a network drive on Exchange.
Note that, if you do this, the path will not include the DevWWWRoot folder. My example produced:
\\sp2013\Example\sales\Sales External Attachments
Configuration of Exchange Rules Pro
Once the infrastructure is ready, you can start to configure rules in CodeTwo Exchange Rules Pro. Let’s go over the requirements one more time:
- the manager wants to archive attachments sent by Sales people in a dedicated library on a SharePoint server;
- the collection should only apply to files with .doc, .docx and .pdf extensions;
- only emails traveling outside of the organization are to be audited;
- apart from the name of the attachment, saved filenames should also include the senders’ names.
Just to keep things in order, lets add one more requirement – the folder names should reflect the date on which the email was sent.
Here is what you have to do:
1. Create a new rule and fill out all the necessary information:
2. In the Conditions tab define two conditions linked with an And operator (this way both have to be met for the rule to be applied):
- The sender must belong to OU=Sales,
- Message direction must be outgoing
(leave the Exceptions tab blank)
3. In the Actions tab add the Strip/dump attachments action:
4. The action lets you specify additional conditions which will have to be met by attachments. Our manager wanted to collect files with .doc, .docx and .pdf extensions only, so under If email contains select attachments with a specific extension:
and use the Add button to provide the extensions:
The .pdf extension is defined by clicking Add, Other and typing it in:
The defined extensions will be displayed in the dialog window:
5. Next, configure the action:
Under then, choose save these attachments to disk, click Options and provide the path to which CodeTwo Exchange Rules Pro will save files.
As mentioned before, my example path is:
\\sp2013\DavWWWRoot\Example\sales\Sales External Attachments
In the Target Folder Structure tab, configure the program to create folders named after the dates attachments are sent on…
…and define the date format.
In the FileName Pattern tab, define the behavior in case a file already exists, and the default filename pattern. In this example the pattern will include the sender’s email address and the original filename.
Having completed all of the above configuration steps, save the setup and test the rule.
Testing the rule
Let’s test the rule by sending an email to k.green[at]internet.com (in an external organization) with a .pdf file attached. The email will be sent by a user belonging to OU=Sales.
After the email is sent, the sales_report.pdf file should appear in the Sharepoint Sales External Attachments library in a folder named after the email send date:
Now let’s test the rule by sending an email from a different account belonging to the OU=Sales and attaching a .docx file to it.
The result:
Looks good. The Sales Manager can now perform real-time monitoring of attachments sent by his or her users to contacts located outside of the organization.
Conclusion
The scenario described in this article is only one of many ways CodeTwo Exchange Rules Pro can help an administrator.
To find out what else the application can do, download and play around with the free trial version: https://www.codetwo.com/exchange-rules-pro/download?sts=6357
CodeTwo sp. z o.o. sp. k. is a controller of your personal data.
See our Privacy Policy to learn more.