Annex: Conditions
The following conditions are available (details in the following chapters):
Body Language
Communication Classification
Cryptographic Content
Header Field
Recipient (EnvelopeTo address or domain)
Sender (EnvelopeFrom address or domain)
Source IP
Source IP Country (Inbound only)
Subject
In the following chapters, all conditions are listed with a description, their JSON format and the allowed values.
Example text/values are written in italic.
Alternative keys/operators/values are separated by “|”.
Arrays of multiple, comma-separated values are possible wherever it is indicated by brackets: “[ ]”.
Body Language
This condition detects the language of the text in either the html or text body part of an email. The condition only matches if a language can be determined with a certain reliability. It does not match if the reliability is reduced, e.g. due to multiple languages in an email and/or a very short text.
The comparison operator “Is/IsNot” is used for exact matching of the language code from the list below. Multiple values may be used in one condition, separated by commas. In this case, all values are OR-connected or, when using a negation (operator “Is Not”), multiple values are AND-connected.
JSON format
{
"condition": "BodyLanguage",
"operator": "Is" | "IsNot"
"values": [
"en",
"fr"
]
}
Valid entries:
Up to 32 addresses (values) may be configured.
2-letter and 3-letter language codes (ISO 639-1 and ISO 639-2) listed below, case-insensitive; no wildcards allowed.
Communication Classification
This condition checks if an email is “external” (sender and recipient domains belong to different customer numbers or one of them doesn’t belong to any Retarus customer number) or “internal” (sender and recipient domains belong to the same customer number).
JSON format
{
"condition": "CommunicationClassification",
"operator": "External" | "Internal"
}
Cryptographic Content
This condition detects if an email is PGP or S/MIME encrypted or signed (or contains any cryptographic content as attachment).
This condition has been developed for custom use cases with external encryption solutions, but most customers will not be able to use it.
For Retarus customers using the embedded Retarus Email Encryption service, this condition doesn’t work: Encrypted Inbound emails are already decrypted when they reach the Policy Engine for evaluation, and Outbound emails are not yet encrypted when they reach the Policy Engine. So in both cases, this condition does not apply.
JSON format
{
"condition": "CryptoContent",
"operator": "Contained" | "NotContained"
}
Header Field
With this condition, the content of any header field of an email may be detected, e.g. the To, From, Reply-to, any custom X-header field or any other header field.
Multiple comparison operators may be used:
Is/IsNot is used for exact matching of the complete header field string. Multiple values may be used in one condition, separated by commas. In this case, all values are OR-connected or, when using a negation (operator “Is Not”), the values are AND-connected.
Contains/ContainsNot is used to match exactly a certain part of a header field. Multiple values may be used in one condition, separated by commas. In this case, all values are OR-connected or, when using a negation (operator “Contains Not”), the values are AND-connected.
Matches/MatchesNot allows to use wildcards to match parts of a header field. For every condition, max. one asterisk (*) and max. eight question marks (?) may be included. An asterisk replaces zero or any one or more characters, a question mark replaces zero or exactly one character. The “Matches” operator allows only one comparison value.
JSON format
{
"condition": "HeaderField",
"key": "From",
"operator": "Contains" | "DoesNotContain" | "Is" | "IsNot" | "Matches" |
"DoesNotMatch",
"values": [
"noreply@domain.com",
"domain1.com",
"John Doe"
]
}
Valid entries
Up to 32 values may be configured.
Value matching for strings (e.g. header field keys and values) is case-sensitive.
Example: For header field values, only the exact spelling matches: “NOREPLY@customer.com” in the subject does not match a condition referring to the value “noreply@customer.com”.
For details on string validation pattern, see Annex: Validation regex patterns and examples.
If you would like to create a condition referring to the subject line of emails, please do not use the “Header Field” condition, but use the dedicated “Subject” condition. The reason is that when using the Header Field condition for the subject, there may be unwanted effects due to additional subject tags that are added by other components than the Predelivery Logic, e.g. a prefix like “[RMX:##]” inserted by AntiSpam Detection.
Subject
With this condition, the content of the subject line of an email may be analyzed.
Multiple comparison operators may be used:
Is/IsNot is used for exact matching of the complete subject line. Multiple values may be used in one condition, separated by commas. In this case, all values are OR-connected or, when using a negation (operator “Is Not”), the values are AND-connected.
Contains/ContainsNot is used to match exactly a certain part of the subject. Multiple values may be used in one condition, separated by commas. In this case, all values are OR-connected or, when using a negation (operator “Contains Not”), the values are AND-connected.
Matches/MatchesNot allows to use wildcards to match parts of the subject line. For every condition, max. one asterisk (*) and max. eight question marks (?) may be included. An asterisk replaces zero or any one or more characters, a question mark replaces zero or exactly one character. The “Matches” operator allows only one comparison value.
JSON format
{
"condition": "Subject",
"operator": "Contains" | "DoesNotContain" | "Is" | "IsNot" | "Matches" |
"DoesNotMatch",
"values": [
"Invoice",
"invoice"
]
}
Valid entries
Up to 32 addresses (values) may be configured.
Value matching for strings is case-sensitive.
Example: For the subject value, only the exact spelling matches: “URGENT MAIL” does not match a condition referring to the value “urgent mail”.
Wildcards: For every condition, max. one asterisk () and max. eight question marks (?) may be included. An asterisk replaces zero or any one or more characters, a question mark replaces zero or exactly one character.
For details on string validation pattern, see Annex: Validation regex patterns and examples.
Recipient (EnvelopeTo address or domain)
With this condition, the recipient (SMTP-To/EnvelopeTo) address or domain of an email may be addressed.
Multiple comparison operators may be used:
Is/IsNot is used for exact matching of the complete address or domain. Multiple values may be used in one condition, separated by commas. In this case, all values are OR-connected or, when using a negation (operator “Is Not”), the values are AND-connected.
Matches/MatchesNot allows to use wildcards to match parts of an address or domain. For every condition, max. one asterisk () and max. eight question marks (?) may be included. An asterisk replaces zero or any one or more characters, a question mark replaces zero or exactly one character. The “Matches” operator allows only one comparison value.
JSON format
{
"condition": "Recipient",
"type": "EnvToAddress" | "EnvToDomain"
"operator": "Matches" | "DoesNotMatch"
"values": [
"*from@example.com",
"*http://xmple.com "
]
}
Valid entries
Up to 32 addresses (values) may be configured.
Value matching for email addresses and domains is NOT case-sensitive, so it doesn’t matter if you are using capital or small letters.
Example: A condition including “Foo@BAR.com” matches the value “foo@bar.com”.For details on string validation pattern, see Annex: Validation regex patterns and examples.
Sender (EnvelopeFrom address or domain)
With this condition, the sender (SMTP-From/EnvelopeFrom) address or domain of an email may be addressed.
Multiple comparison operators may be used:
Is/IsNot is used for exact matching of the complete address or domain. Multiple values may be used in one condition, separated by commas. In this case, all values are OR-connected or, when using a negation (operator “Is Not”), the values are AND-connected.
Matches/MatchesNot allows to use wildcards to match parts of an address or domain. For every condition, max. one asterisk (*) and max. eight question marks (?) may be included. An asterisk replaces zero or any one or more characters, a question mark replaces zero or exactly one character. The “Matches” operator allows only one comparison value.
JSON format
{
"condition": "Sender",
"type": "EnvFromAddress" | "EnvFromDomain",
"operator": "Matches" | "DoesNotMatch",
"values": [
"*from@example.com",
"*http://xmple.com "
]
}
Valid entries
Up to 32 addresses (values) may be configured.
Value matching for email addresses and domains is NOT case-sensitive, so it doesn’t matter if you are using capital or small letters.
Example: A condition including “Foo@BAR.com” matches the value “foo@bar.com”.
For details on string validation pattern, see Annex: Validation regex patterns and examples.
Source IP
With this condition, the source IP address of an email may be detected.
Multiple comparison operators may be used:
Is/IsNot is used for exact matching of the complete IP address. Multiple values may be used in one condition, separated by commas. In this case, all values are OR-connected or, when using a negation (operator “Is Not”), the values are AND-connected.
Matches/MatchesNot allows to use wildcards to match parts of an IP address. For every condition, max. one asterisk (*) and max. eight question marks (?) may be included. An asterisk replaces zero or any one or more characters, a question mark replaces zero or exactly one character. The “Matches” operator allows only one comparison value.
JSON format
{
"condition": "SourceIP",
"operator": "Is" | "IsNot" | "Matches" | "DoesNotMatch" ,
"values": [
"62.245.148.8",
"94.199.92.181"
]
}
Valid entries
Up to 32 IP addresses (values) may be configured.
For details on string validation pattern, see Annex: Validation regex patterns and examples.
Source IP Country (Inbound only)
With this condition, the country of origin of the source IP address of an email may be detected. The condition is only available for Predelivery Logic Inbound.
The comparison operator “Is/IsNot” is used for exact matching of the country ISO code (2 letters, case-
insensitive) from the list below.
Multiple values may be used in one condition, separated by commas. In this case, all values are OR-
connected or, when using a negation (operators “Is Not”), multiple values are AND-connected.
JSON format
{
"condition": "SourceIPCountry",
"operator": "Is" | "IsNot",
"values": [
"RU",
“CN”
]
}
Valid entries
Up to 32 country codes (values) may be configured.
2-letter country ISO codes listed below (case-insensitive), no wildcards allowed.