Table of Contents

Class EmailMessageEvaluator

Namespace
ArcanaDevelopment.adTempus.Shared.EmailProcessing
Assembly
ArcanaDevelopment.adTempus.Shared.dll

Evaluator used to filter e-mail messages.

[Serializable]
[DataContract]
public class EmailMessageEvaluator : ExpressionNode
Inheritance
object
EmailMessageEvaluator

Fields

FilterType

Specifies whether the evaluator will evaluate the message or its attachments.

[DataMember]
public EmailFilterType FilterType

Field Value

EmailFilterType

IgnoreCase

Specifies whether the comparison should be case-sensitive. Default: true (case-insensitive).

[DataMember]
public bool IgnoreCase

Field Value

bool

MatchRule

The rule to use when comparing the PropertyName to the TargetValue value.

[DataMember]
public TextMatchRule MatchRule

Field Value

TextMatchRule

PropertyName

The field to look at.

[DataMember]
public string PropertyName

Field Value

string

Remarks

The following standard tags can be used for EmailFilterType.Message:

FromThe message sender (name and address)
ToThe recipients in the TO field (names and addresses)
CCThe recipients in the CC field (names and addresses)
RecipientsThe recipients in either the TO or CC fields (names and addresses)
SubjectThe message subject
Body The message body. Will look at both text and HTML body parts, if present, but not other attachments.
HeaderThe header with the name specified in the PropertySubName field.

For any other value, the evaluator looks for a header with the specified name.

The following tags can be used for EmailFilterType.Attachment:

NameThe name of the attachment
ExtensionThe file extension of the attachment
ContentTypeThe content type/subtype of the attachment
ContentThe content of the attachment

PropertySubName

The name of the header to match if PropertyName is "header"

[DataMember]
public string PropertySubName

Field Value

string

TargetValue

The value to compare the PropertyName to.

[DataMember]
public string TargetValue

Field Value

string

Remarks

The TargetValue will be either simple text or a regular expression (using .NET regex syntax) depending on the setting of UseRegEx

UseRegEx

Specifies whether the TargetValue is a regular expression

[DataMember]
public bool UseRegEx

Field Value

bool

Methods

Evaluate(object, object)

Evaluates the rule against an e-mail message.

public override bool Evaluate(object target, object parameters)

Parameters

NameTypeDescription
target object

The object to evaluate the rule against. This must be of type System.Net.Mail.MailMessage or an ArgumentException is thrown.

parameters object

Optionally specify an object of type IVariableExpansionProvider to resolve variables and tokens in text.

Returns

bool

True if the rule matches the message; False otherwise.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.