Login

Solution #678 - Can Dovetail Carrier monitor multiple email accounts for incoming messages?

7/28/2014 (11 years ago)
Clarify
Any
Not yet rated.
9/10/2014 (11 years ago)
Any
Any

As of version 1.3, Carrier’s EmailAgent extension does support processing of email from multiple accounts.

With version 1.2 and below, the out of the box Email-Agent extension only supports processing from one email address.
Although Dovetail Carrier provides many great features out of the box, it is expected that customers will modify existing Carrier extensions as well as create new ones. Every Dovetail Carrier extension is provided with source code, so developers can not only customize the existing extensions, but can follow the patterns and examples of the baseline extensions in order to create their own.
If you’d like the Email-Agent extension to support multiple email addresses, it’s an easy change to make.

Resolution 11 years ago

For carrier version 1.2 and below:

In the Carrier install directory, there should be a developers folder.
In it, there’s an extensions-source.zip file. If it hasn’t been done already, extract the contents of this file.
That contains the source code for the extensions, including the Email-Agent extension.

If you look at the rules that process incoming emails (EmailAgentRulesRegistry.cs), you’ll see the ruleset, and you’ll see the first rule is:

rule.Unless<EmailIsFromEmailAgentEmailAccount>().Exit();

This is what’s causing it to only process mail from one email address.

Two changes need to be made to that extension:

  1. Change the EmailAccountUserName in emailAgentExtension.config to include both email accounts:

<add key="EmailAgentExtensionSettings.EmailAccountUserName" value="primary@mail.com, secondary@mail.com"/>

  1. Change the EmailIsFromEmailAgentEmailAccount condition to look for the incoming email anywhere in that string: (EmailIsFromEmailAgentEmailAccount.cs, line 20)

Change it from this:

var isForEmailAgent = _emailAgentSettings.EmailAccountUserName == context.Message.EmailAccountUserName;

to this:

var isForEmailAgent = _emailAgentSettings.EmailAccountUserName.Contains(context.Message.EmailAccountUserName);

With those two files changed, run the build-extensions.bat file to rebuild the Email Agent extension.

During that build process, a new Carrier.Extensions.EmailAgent.dll gets created and copied to the build folder.

To get the updated DLL into action, stop the Dovetail Carrier service.

Go to the carrierservice folder, and backup the baseline Carrier.Extensions.EmailAgent.dll file.

Copy new Carrier.Extensions.EmailAgent.dll file from the build folder to carrierservice folder, replacing the old one.

Restart the Dovetail Carrier service.

Check the Dovetail Carrier log files and make sure that both accounts are getting processed.

Explore the Email-Agent code for more ways to customize the Dovetail Carrier application to match your need.

You must be logged in to post a comment.

Login

You must be logged in to post a comment.

Login