Configuring preprocessing rules
Typically, threaded messages include all the succeeding replies starting with the original message. If the Mail Connector updates object's Activity log with every reply from the communication thread without preprocessing, each subsequent record will include the content of the previous records.
In order to prevent the Mail Connector from creating duplicate records Alloy Navigator uses preprocessing rules. The Mail Connector analyzes e-mail messages and cleans unwanted text from the message when it matches the rule. Alloy Navigator offers a set of preconfigured rules for the popular e-mail clients, which are initially disabled. You can enable these rules, and add your own preprocessing rules, if needed. You enable (select) the rules when configuring the Mail Connector job.
NOTE: The Mail Connector applies preprocessing rules only if the e-mail message is part of an object’s communication thread (the message contains a special MessageID Tag) and the object is not in a terminal status, such as “Closed” or “Retired.” For details, see Updating objects with data from incoming messages and Default processing statement.
To access all available preprocessing rules or design a new one, go to E-Mail Processing > Preprocessing.
A preprocessing rule consists of the following components:
-
A regular expression to search for a specific text block in the message,
NOTE: A regular expression is a pattern that consists of one or more character literals, operators, or constructs. For details, see Regular expressions.
- Actions to perform when the matched text is found.
To add a preprocessing rule:
-
In the E-Mail Processing> Preprocessing section, click New. The Reply Preprocessing Rule window opens.
-
Type in the rule name.
-
Create a regular expression as you need.
-
Select a processing option:
- Depending on the format of the e-mail, unwanted text could be located either before or after the matched text block. Specify what part you want to remove.
- If the unwanted part of the message is located after the matched text, click after the Expression.
- If the unwanted part of the message is located before the matched text, click before the Expression.
- To delete the matched text block itself, select the Also remove matched text check box.
- If you enable several preprocessing rules for the Mail Connector job, you may want to stop processing after a certain rule. To do this, select Stop processing remaining rules.
- Depending on the format of the e-mail, unwanted text could be located either before or after the matched text block. Specify what part you want to remove.
-
Optional: In the Sample Message section, test how the rule processes the sample e-mail message.
-
Click OK.
Regular expressions
Most POSIX Extended Regular Expressions are supported. For tutorial and examples of regular expressions, see https://regexr.com/.
Our preconfigured rules contain regular expressions.
The examples of regular expressions provided in our production database:
-
Preprocessing rule - Replies in Mozilla Thunderbird messages
The rule should detect the following text block:
On 9/6/2017 12:55 PM, Danielle Fischer wrote:
Regular expression (?is)On [0-9/]+.*wrote: can be interpreted as follows:
(?is) Do case-insensitive pattern matching (using installed in you system locale settings).
Treat string as single line.
On [0-9/]+.*wrote: Match strings that contain the following parts:
- the word On and any symbol from the list: digits from 0 to 9, or /; repeated one or more times
- the word wrote:
- zero or more symbols between the above parts
-
Preprocessing rule - Replies in Microsoft Outlook messages.
The rule should detect the following text block:
From: Danielle Fischer Sent: Friday, 26 May, 2017 23:41 To: Lynch Stevens [mailto:lstevens@example.com] Subject: Strip replies from email
Regular expression From:.*Subject:.+?\r\n can be interpreted as follows:
From:.*Subject:. Match strings that contain words From: and Subject with zero or more symbols between these words.
+? one or more times \r predefined by car return \n predefined by new line