Annex: Actions

The following actions are available (details in the following chapters):

In the following sections, all actions are listed with a description, JSON format and the allowed values.

  • Example text/values are written in italic.

  • Alternative keys/operators/values are separated by “|”.

Add BCC Recipient

With this action, up to five BCC (“Blind Carbon Copy”) recipient addresses may be added to an email. These additional recipients in the “BCC” header are invisible for other recipients of the email. BCC recipients may be used for compliance reasons.

JSON format (Inbound)

JSON
{
  "action": "BccRecipient",
  "values": [
    "address1@domain1.com",
    "address2@domain2.com"
  ]
}

JSON format (Outbound):

JSON
{
  "action": "BccRecipientOutbound",
  "values": [
    "address1@domain1.com",
    "address2@domain2.com"
  ]
}

Valid entries

  • Between one and five BCC addresses (values) may be configured.

  • See email address and domain validation patterns listed here: 7.2 Email address and domain
    validation regex patterns.

“Add BCC recipient” as action for Inbound emails in combination with Retarus Email Continuity

The “Add BCC recipient” action is automatically disabled if the Continuity switch-over (failover routing) has been activated for the main recipient. Also, failover routing isn’t working for the BCC recipient if it is not activated for the main recipient of an email.

Header actions: general information

Header actions add, change, or delete MIME headers of an email before delivery. They are available for Inbound and Outbound emails. The JSON format is identical for both directions (the action names have no "Outbound" suffix).

  • A header action can address one or several headers: between one and 32 header names (keys) may be configured per action. Each header name may be used only once per action.

  • Header names are not case-sensitive.

  • Header names and values may only contain the following characters: printable ASCII characters (space to tilde, e.g. letters, digits, punctuation) and line feed. Other characters such as umlauts, accented letters, emojis, or tabs are not accepted.

  • The following headers are protected and cannot be used in any header action: Authentication-Results, Bcc, Cc, Content-Disposition, Content-Transfer-Encoding, Content-Type, Date, Disposition-Notification-To, From, Message-ID, Received, Reply-To, Resent-From, Resent-Sender, Return-Receipt-To, Sender, To, and all headers starting with X-RMX-.

  • Remember that only one action can be configured per rule and that only the first matching rule is executed (see Predelivery Logic Administrator Manual).

Header - Add Header

With this action, a new header with a defined value is added to an email. If the header already exists in the email, it is not changed. The action can be used for internal processing, for example to hand over a value to Microsoft Exchange or another internal application.

JSON format (Inbound and Outbound)

JSON
{
  "action": "AddHeaders",
  "headerNames": ["X-Customer-Individual"],
  "value": "individual_value"     
}

Valid entries

  • headerNames: 1 to 32 unique header names, each 1 to 256 characters. Protected headers are not allowed (see general information).

  • value: 1 to 256 characters (printable ASCII and line feed).

Example: header name X-Customer-Individual, value individual_value.

Header - Add Value Prefix

With this action, a string is added in front of the existing value of one or more headers.

JSON format (Inbound and Outbound)

JSON
{ 
  "action": "AppendPrefixToHeaders",
  "headerNames": ["Subject"],
  "prefix": "[External Email]"
}

Valid entries

  • headerNames: 1 to 32 unique header names, each 1 to 256 characters. Protected headers are not allowed (see general information).

  • prefix: 1 to 256 characters (printable ASCII and line feed). Spaces are valid characters: add a trailing space to separate the prefix from the original text.

Example: the subject "Quarterly report" becomes "[External Email] Quarterly report".

Header - Add Value Suffix

With this action, a string is added after the existing value of one or more headers.

JSON format (Inbound and Outbound)

JSON
{
  "action": "AppendSuffixToHeaders",
  "headerNames": ["Subject"],
  "suffix": " [External Email]"
}

Valid entries

  • headerNames: 1 to 32 unique header names, each 1 to 256 characters. Protected headers are not allowed (see general information).

  • suffix: 1 to 256 characters (printable ASCII and line feed). Add a leading space to separate the suffix from the original text.

Example: the subject "Quarterly report" becomes "Quarterly report [External Email]".

Header - Delete Header

With this action, one or more headers are removed from an email.

JSON format (Inbound and Outbound)

JSON
{
  "action": "DeleteHeaders",
  "headerNames": ["X-Customer-Individual"]
}

Valid entries

  • headerNames: 1 to 32 unique header names, each 1 to 256 characters. Protected headers are not allowed (see general information).

Header - Value Complete Replacement

With this action, the entire value of one or more headers is replaced with a new value.

JSON format (Inbound and Outbound)

JSON
{
  "action": "ReplaceValueOfHeaders",
  "headerNames": ["X-Customer-Individual"],
  "value": "new_value"
}

Valid entries

  • headerNames: 1 to 32 unique header names, each 1 to 256 characters. Protected headers are not allowed (see general information).

  • value: 1 to 256 characters (printable ASCII and line feed).

Header - Value Partly Replacement

With this action, a string within the value of one or more headers is replaced with another string. All other parts of the value remain unchanged.

JSON format (Inbound and Outbound)

JSON
{
  "action": "ReplaceStringInHeaders",
  "headerNames": ["X-Customer-Individual"],
  "searchString": "existing_string",
  "replacementString": "new_string"
}

Valid entries

  • headerNames: 1 to 32 unique header names, each 1 to 256 characters. Protected headers are not allowed (see general information).

  • searchString: 1 to 256 characters (printable ASCII and line feed). Wildcards and regular expressions are not supported: special characters such as * or . are interpreted as the characters themselves.

  • replacementString: 0 to 256 characters (printable ASCII and line feed). An empty string is allowed and removes the search string from the value. Special characters are interpreted as the characters themselves.

Example: to remove the tag "[External Email] " from the subject, use "Subject" as header name, "[External Email] " as search string, and leave the replacement string empty.

Block Email: Quarantine (Inbound only), Delete (Inbound only), Discard

With this action, an email may be blocked. There are three different ways available for configuration:

  • Quarantine: This action is available for Inbound traffic only. The email is put into the recipient’s user quarantine. It is listed in the user’s Email Security Report (digest) and in the online quarantine the same way as for example spam emails, but with a different classification (quarantine reason) called “Custom Rule” (Threat Level 2 of 5). Emails with this quarantine reason may be released by the recipient or the administrator and the sender address may be added to the user’s AntiSpam Block- or Allowlist.

  • Delete: This action is available for Inbound traffic only. The email is deleted, but mentioned in the user’s digest and in the online quarantine the same way as for example virus-infected emails, but with the classification (quarantine reason) “Custom Rule” (Threat Level 2 of 5). Like emails that have been rejected due to a virus finding, deleted emails may NOT be released by the recipient or the administrator (but the sender address may be added to the user’s AntiSpam Block- or Allowlist). No NDR is generated for the sender.

  • Discard: This action is available for In- and Outbound traffic. The email is discarded silently, so it is not mentioned in the digest nor in the online quarantine and it may NOT be released. No NDR is generated for the sender.

In the Inbound processing chain at Retarus There are several filters in front of the Policy Engine. In this case, this means that an email might be quarantined (e.g. due to a high spam rating) before it even reaches the Policy Engine. If an email has been quarantined (with a different quarantine reason) already, the quarantine/delete/discard action will not be applied.

JSON format (Inbound)

JSON
{
  "action": "BlockEmail",
  "type": "Quarantine" | "Delete" | "Discard"
}

JSON format (Outbound)

JSON
{
  "action": "BlockEmailOutbound",
  "type": "Discard"
}

Address Rewrite: Sender or Recipient Rewrite

General functionality

The Address Rewrite action is used to do automatic rewriting of sender or recipient email addresses or domains for Inbound or Outbound traffic. Consequently, the email is sent to another mailbox or appears to have been sent from another address. This feature is particularly useful for hybrid email environments or migration scenarios (M365 migration, company mergers or acquisitions, carve-outs etc.), where you would like to use dedicated addresses/domains for Outbound traffic in order to keep your reputation and make sure that Inbound emails still reach the recipient using a different, “internal” address.

By default, only the SMTP/Envelope addresses are rewritten, but it is also possible to include the corresponding MIME headers, displayed to the recipient of an email: MIME From, MIME To etc.

The following rewrites can be configured for In- and Outbound traffic; the most common use case is to rewrite the sender address for Outbound and the recipient address for Inbound traffic:

  • Sender Rewrite (address or domain):

    • SMTP/Envelope From

    • Optional header rewrite: MIME From, Reply-To, Sender, Return-Receipt-To, Disposition-Notification-To, Resent-From, Resent-Sender (Return-Path is not rewritten, as this could lead to SMTP-related problems)

  • Recipient Rewrite (address or domain):

    • SMTP/Envelope To

    • Optional header rewrite: MIME To, CC

Depending on the use case, address rewriting can be set up in two different ways:

  • Address rewriting via custom rules, created and managed via the myEAS portal (as any other actions described in this document). The first possibility is used if you have only few, static rewrites to manage (e.g. domain rewrite only), or if you would like to react instantly by creating a new rule.

  • Address rewriting via automated file sync in the backend. This possibility is used if you have large numbers of address rewrites to configure that change dynamically.

If for the same address and direction, an Address Rewrite by custom rule and by file sync are configured, the custom rule wins. The two different possibilities are described in detail in the following sections.

Address rewriting via custom rules (myEAS portal)

If you have only few static rewrites, you may set up a custom rule via the myEAS portal using the dedicated “Address Rewrite” action of the Predelivery Logic, just as described in this document for all other actions.

JSON format (Inbound)

JSON
{
  "action": "AddressRewrite",
  "reference": "Recipient" | "Sender",
  "scope": "Address" | "Domain",
  "value": "foo@bar.de" | "bar.de",
  "IncludeHeaders": "Yes" | "No" (default value: Yes)
}

JSON format (Outbound)

JSON
{
  "action": "AddressRewriteOutbound",
  "reference": "Recipient" | "Sender",
  "scope": "Address" | "Domain",
  "value": "foo@bar.de" | "bar.de",
  "IncludeHeaders": "Yes" | "No" (default value: Yes)
}

Valid entries

See email address and domain validation patterns listed here: Annex: Validation regex patterns and examples.ns

For Outbound Sender Rewrite and Inbound Recipient Rewrite, the target domain has to belong to your Retarus account (see details below).

Please note the following:

  • For large, dynamic lists of users and their rewrite target addresses, the automated file sync should be used. See Address Rewriting via file sync (backend).

  • If for the same address and direction, an Address Rewrite by custom rule and by file sync are configured, the custom rule wins.

  • Inbound Recipient Rewrite: Target domain has to belong to your Retarus account, forwarding Inbound emails to an external address isn’t possible. In order to avoid errors during processing (Inbound Recipient Rewrite with external/outbound target), an address/domain rewrite is only executed if the target domain belongs to your Retarus account.
    Therefore, for those rewrite configurations, you have to make sure that the rewrite target domain is registered at Retarus. This can be done by adding it via the EAS portal (see Email Security Admin Documentation). You don’t have to specify a relay host or any other information, if you don’t want Retarus to actually accept emails for this domain.

  • Inbound Recipient Rewrite: Original address might be visible in NDRs: Independently from the address rewrite feature, in rare cases, a customer MTA might reject an Inbound email coming in from Retarus. This isn’t very likely as Retarus already accepted the original email, but might be possible for example if the mailbox storage space is exceeded at the customer infrastructure. In this case, the original sender of the email receives a Non-Delivery Report (NDR) stating the reason of the rejection. If the recipient address had been rewritten by the Retarus Inbound Address Rewriting service, the rewritten address is displayed in the NDR visible to the sender instead of the address that he originally was writing to.

  • Outbound Sender Rewrite: Target domain has to belong to your Retarus account: In order to avoid spoofing (Outbound Sender Rewrite with foreign domain), an address/domain rewrite is only executed if the target domain belongs to your Retarus account. Therefore, for those rewrite configurations, you have to make sure that the rewrite target domain is registered at Retarus. This can be done by adding it via the EAS portal (see Email Security Admin Documentation). You don’t have to specify a relay host or any other information, if you don’t want Retarus to actually accept emails for this domain.

  • Outbound Sender Rewrite: Recipient addresses on To/CC are rewritten implicitly: When configuring an Outbound sender rewrite, you normally don’t think of the case that one of your users might put a colleague in the To or CC header of an Outbound email. These recipient addresses would normally not be rewritten when simply configuring an Outbound Sender Rewrite. Therefore, the original domain would be visible to the communication partner and he would reply to this address as well (which might not even be configured to accept external emails). In order to avoid this unwanted behavior, an implicit recipient rewrite has been implemented: If an Outbound sender rewrite is configured for the addresses in the To and CC headers, these addresses are rewritten as well (if the header rewrite is configured at all).

Address rewriting via file sync (backend)

For dynamic lists of large numbers of users and their rewrite target addresses, address rewriting can also be used via automated file sync in the backend.

By default, only the SMTP/Envelope addresses are rewritten, but it is also possible to include the corresponding MIME headers, displayed to the recipient of an email: MIME From, MIME To etc.

Typical use cases include migration scenarios, company mergers, acquisitions or carve-outs, where you would like to use dedicated addresses for Outbound traffic in order to keep your reputation and make sure that Inbound emails still reach the recipient using a different, “internal” address.

The service rewrites email address or domains based on a mapping list provided by the customer (e.g. by sftp upload). An automatic synchronization in regular intervals can be implemented.

In this case, the Predelivery Logic rules via myEAS portal are not required and the address rewriting is not visible or manageable there. For Address Rewriting via file sync, there is no self-service possibility to activate or configure the service inside the myEAS portal.

If you would like to use address rewriting via file sync (or use it already), contact the Retarus Support, your Service Implementation Engineer, or Technical Consultant.

When activated, a mapping file has to be provided. If multiple rewrites (e.g. Outbound sender and Inbound recipient rewrite) shall be configured, one file is required for every combination of direction and entity. The filenames can be chosen freely, but ideally, they state the direction and entity to be applied, e.g. “outbound_sender_rewrite.map”.

The mapping files have to contain email addresses (domain only is not possible) and have the following structure (one rewrite per line; whitespaces are eliminated automatically when processing the file):
originaladdress@originaldomain.com:rewrittenaddress@rewrittendomain.com

Apart from the mapping files that are synchronized with Retarus by sftp upload, the information is required if headers shall be rewritten or only the envelope To/From.

For address rewriting via file sync, the same restrictions and notes as for the solution via custom rules apply. Therefore, please also check the notes in Address Rewriting via custom rules.

Relay To Host

With this action, an email may be routed to a defined relay host.

For dynamic lists of large numbers of users and their relay targets, Retarus Advanced Routing & Rewriting is better suited than the Predelivery Logic.

If you would like to use Advanced Routing & Rewriting (or use it already), contact the Retarus Support or your Service Implementation Engineer. The “Relay To Host” action will override the target host specified in the Advanced Routing & Rewriting transport table, which also leads to the email being delivered by another MTA with a different IP address. Messages will be sent out using enforced TLS.

JSON format (Inbound)

JSON
{
  "action": "RelayToHost",
  "value": "foo.bar"
}

JSON format (Outbound)

JSON
{
  "action": "RelayToHostOutbound",
  "value": "foo.bar"
}

Valid entries

Host names or IP v4 addresses. Value matching for relay host addresses is NOT case-sensitive, so it doesn’t matter if you are using capital or small letters.

Details see relay host validation pattern listed here: Annex: Validation regex patterns and examples.