This is an internal documentation. There is a good chance you’re looking for something else. See Disclaimer.

Outgoing Mail in Nice

Set Default Sender

Tip

For installations managed via Ansible, set mail_sender_default instead, see Configure Default Sender Addresses. Ansible will, in turn, set this property correctly.

The application property email.default.from defines the global fallback sender address. It is used for mails whose sender domain isn’t allowed, see next section, or if no sender address is available.

email.default.from=noreply@tocco.ch

Allow Domains in Outgoing Mails

Tip

For installations managed via Ansible, set mail_domains instead, see Configure Email Sender Domains. Ansible will, in turn, set this property correctly.

Domains are allowed using the email.allowedFromDomainsRegex application property. The value is a regular expression matching the domains that are allowed as From in emails.

Mail send from a domain not covered by the given regular expression are rewritten to the mail address specified on the business unit, if any, and email.default.from otherwise.

email.allowedFromDomainsRegex=tocco.ch|tocco.net

Warning

Before you allow a domain make sure SPF, DKIM and DMARC are set up.

Rewrite Recipient Addresses

Tip

For installations managed via Ansible, set mail_allowed_recipients_enabled and mail_allowed_recipients instead, see Restrict Allowed Mail Recipients. Ansible will, in turn, set this property correctly.

The recipientrewrite.mappings application property can be used to rewrite recipient addresses.

The syntax is very simple:

recipientrewrite.mappings=ORIGINAL -> REDIRECT1[, REDIRECT2]...[; ORIGINAL -> REDIRECT1[, REDIRECT2]...]...

ORIGINAL

Recipient address before rewriting. To, Cc and Bcc addresses rewritten.

REDIRECTED1..

Rewrite rule for the address. You can specify multiple REDIRECT rules to have the mail redirected to multiple addresses at once.

Rewrite All Recipients

A single asterisk (*) can be used to redirect all mails.

recipientrewrite.mappings=* -> fallback@tocco.ch

Rewrite One Domain

Rewrite example.com to example.net

recipientrewrite.mappings=(.*?)@example.com -> $1@example.net

Note

$1 matches the first group (=content of first ( )) in the regular expression.

Rewrite to Multiple Recipients

Rewrite xxx@tocco.ch to xxx-mail1@tocco.ch and xxx-mail2@tocco.ch.

recipientrewrite.mappings=(.*?)@tocco.ch -> $1-mail1@tocco.ch, $1-mail2@tocco.ch;

Note

The name of the recipient is not preserved if multiple recipients are used.

Combine Multiple Rules

Redirect mails for example.com to example.net and redirect everything else to fallback@tocco.ch.

recipientrewrite.mappings=(.*?)@example\.com -> $1@example.net; * -> fallback@tocco.ch

Warning

Because the first matching pattern, from left to right, wins make sure the wildcard pattern (*) is at the very right.

Use a Custom Mail Server

Tip

For installations managed via Ansible, set mail_relay instead, see Configure Mail Relay. Ansible will, in turn, set this property correctly.

In case a customer wishes to use his own SMTP server the application property email.hostname can be used to set a custom mail server. (Our mail server is preconfigured.)

email.hostname=relay.cyberlink.ch

A custom port can be set too (default is 25):

email.port=225