Configuring an Email Archive Profile’s XML
You can configure advanced archiving options directly in a profile's XML file. Profile files are located here: C:\ProgramData\Laserfiche\EmailArchiveService\Profiles
Example XML File
<xml version="1.0" /> <Profile Address="address@LaserficheEmailArchiveServer" ID="New profile" SchemaVersion="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <RuleDef IsConjunction="true" IsNegated="false"> <Rule Operator="Equal" Key="EmailSenderAddr"> <Value>sender@example.com</Value> </Rule> <Rule Operator="Equal" Key="EmailSubject"> <Value>Subject</Value> </Rule> <Rule Operator="AnyIn" Key="EmailSentToAddrs"> <Value>email@example.com</Value> </Rule> </RuleDef> <EmailServerSettings Protocol="0" /> <RepositorySettings CloudPassword="" IsCloud="false" Password="" Username="" UseSSL="false" Repository="MyRepo" Server="myserver.com" /> <DocSettings SuppressMetadataErrors="false" CollisionHandling="0" RetainExtension="false" DocTemplate="General" DocVolume="default" DocFolder="\ImportedMails\%(EmailReceivedTime;yyyy-MM-dd)" DocName="%(EmailSubject)" /> <AttachmentSettings CollisionHandling="0" RetainExtension="false" LinkMessageWithDistributionList="false" LinkMessageWithAttachments="true" ApplyMailFieldsToAttachments="true" IgnoreInlineAttachment="true" FileDistributionList="false" AttachmentHandling="0" /> <ImportSettings ImportConversionList=" " TextLinesPerPage="2147483647" KeepPDFFile="true" PDFImportResolution="0" GeneratePagesOnPDFImport="false" PDFImportMonochrome="false" PreservePDFAnnotations="true" BurnPDFAnnotationsOnImage="false" ExtractEdocText="true" /> <Fields> <LFField Name="Email Recipients"> <Value>%(EmailRecipients)</Value> </LFField> <LFField Name="Notes"> <Value>%(EmailSentTime)<Value /> </LFField> </Fields> <Tags> <LFTag Name="Archived" Comment="" /> </Tags> </Profile>
Retain file extension for messages and attachments
By default, file extensions are not retained when messages and attachments are saved to Laserfiche. To retain file extensions, change the RetainExtension attribute to "true."
<AttachmentSettings CollisionHandling="0" RetainExtension="true" LinkMessageWithDistributionList="false" LinkMessageWithAttachments="false" ApplyMailFieldsToAttachments="false" IgnoreInlineAttachment="true" FileDistributionList="false" AttachmentHandling="0"/>
File conversion list
This attribute specifies the extensions of the types of files that will be converted to Laserfiche pages on import. By default, the ImportConversionList attribute is not set and will default to this list: "tif,tiff,bmp,pcx,jpg,jpeg,txt,gif,png".
Note: The file types specified in this attribute will override the ImportConversionList trustee attribute in Laserfiche.
<ImportSettings ImportConversionList=" " TextLinesPerPage="2147483647" KeepPDFFile="true" PDFImportResolution="0" GeneratePagesOnPDFImport="false" PDFImportMonochrome="false" PreservePDFAnnotations="true" BurnPDFAnnotationsOnImage="false" ExtractEdocText="true"/>
Import rules
If you have configured your profile to use SMTP, then the Import Rule tab of the Email Archive Create Profile dialog has an advanced option that lets you configure more precise import rules using XML. Import rules are optional. If no import rule is configured, then the profile will be applied to all emails.
The RuleDef element contains import rules that control the type of emails the profile will process.
Name |
Type |
Default Value |
Notes |
---|---|---|---|
IsNegated |
Boolean |
false |
If this option is set to true, the logic of the RuleDef element will be negated. If this option is set to false, the logic of the RuleDef element will not be negated. |
IsConjunction |
Boolean |
true |
If set to true, all the rules must be true (AND logic). If set to false, only one of the rules must be true (OR logic). |
Import rule settings
Within the RuleDef block, create one or more Rule elements defining each rule.
Name |
Type |
Notes |
---|---|---|
Key |
String |
The email property used in the rule |
Operator |
String |
How the value returned by the key will be evaluated against the value configured in the profile |
Value |
String |
The value that the values returned by the key will be evaluated against |
Use these keys to specify the emails the profile will apply to.
Example:
<Rule="Subject" Operator="Equal"> <Value>Test</Value> </Rule>
In this example, the profile will apply to all emails whose Subject equals “Test.”
Key |
Value Type |
Possible Values |
---|---|---|
From |
List<string> |
|
Sender |
List<string> |
|
To |
List<string> |
|
CC |
List<string> |
|
Importance |
String |
High, Normal, or Low |
Subject |
String |
|
ImportanceInt |
Integer |
1, 3, or 5 |
Date |
DateTime |
Format: Mon, 23 Jan 2017 07:47:24 +0000 |
Note: If the key’s value type is “List<String>”, then if any value matches, the rule will be satisfied. For example, if an email is sent to two addresses: aa@example.com and bb@example.com, and the rule is: <Rule Key="To" >Operator="Equal"> <Value>aa@example.com></Value> </Rule> then the rule will be satisfied.
Operators for import rule settings
Use the operator to specify the relationship between the values returned by the key and the values configured in the XML.
Example:
<Rule Key="Subject" Operator="Equal"> <Value>Test</Value> </Rule>
In this example, the profile will apply to all emails whose key value (the subject of the email) equals the value configured (“Test”).
Operator |
Key value type |
Number of values configured in the profile |
How the value returned by the Key is evaluated against the configured value |
---|---|---|---|
Equal |
String |
1 |
Equals |
|
|
More than one value elements |
Equals any value in the list |
|
DateTime |
1 |
The DateTime equals |
|
|
More than one value elements |
The DateTime equals any value in the list |
|
Integer |
1 |
The integer equals |
|
|
More than one value elements |
The integer equals any value in the list |
|
List<string> |
>= 1 |
The whole specified list equals the list returned by the key |
Greater |
DateTime |
1 |
After |
|
Integer |
1 |
Greater |
GreaterOrEqual |
DateTime |
1 |
After or equal to |
|
Integer |
1 |
Greater than or equal to |
Less |
DateTime |
1 |
Earlier than |
|
Integer |
1 |
Less than |
LessOrEqual |
DateTime |
1 |
Earlier than or equal to |
|
Integer |
1 |
Less than or equal to |
Contain |
String |
1 |
Contains |
|
List<string> |
1 |
Any string contains |
StartWith/EndWith |
String |
1 |
Starts/ends with |
|
List<string> |
1 |
Any string starts/ends with |
IsEmpty |
String |
0 |
String is empty |
|
List<string> |
0 |
List is empty or contains empty strings only |
MatchRegex |
String |
1 |
Matches the regular expression |
|
List<string> |
1 |
Any string matches the regular expression |
Between |
DateTime |
More than one value elements |
Between the first two values |
|
Integer |
More than one value elements |
Between first two values |
IsIn |
String |
1 |
Equals |
|
|
More than one value elements |
Included in the list |
|
DateTime |
1 |
DateTime equals |
|
|
More than one value elements |
DateTime included in the list |
|
Integer |
1 |
Integer equals |
|
|
More than one value elements |
Integer included in the list |
|
List<string> |
>= 1 |
List includes all values |
Example:
<EARuleDef IsNegated="false" IsConjunction="true">
<Rule Key="Subject" Operator="Contain">
<Value>test</Value>
</Rule>
</EARuleDef>