Configure Aliases - afareed007/docker-mailserver GitHub Wiki

Please first read Postfix documentation on virtual aliases.

Configuring aliases

You can use setup.sh instead of creating and editing files manually.

Aliases are managed in /tmp/docker-mailserver/postfix-virtual.cf.

An alias is a full email address that will either be:

  • delivered to an existing account registered in /tmp/docker-mailserver/postfix-accounts.cf
  • redirected to one or more other email addresses

Alias and target are space separated.

Example (on a server with domain.tld as its domain):

# Alias delivered to an existing account
[email protected] [email protected]

# Alias forwarded to an external email address
[email protected] [email protected]

Configuring regexp aliases

Additional regexp aliases can be configured by placing them into config/postfix-regexp.cf. The regexp aliases get evaluated after the virtual aliases (/tmp/docker-mailserver/postfix-virtual.cf).

For example, the following config/postfix-regexp.cf causes all email to "test" users to be delivered to [email protected]:

/^test[0-9][0-9]*@example.com/ [email protected]

Address tags (extension delimiters) as an alternative to aliases

Postfix supports so-called address tags, in the form of plus (+) tags - i.e. [email protected] will end up at [email protected].

This is configured by default and the (configurable !) separator is set to +.

For more info, see How to use Address Tagging ([email protected]) with Postfix and the official documentation.

Note that if you do decide to change the configurable separator, you must add the same line to both config/postfix-main.cf and config/dovecot.cf, because Dovecot is acting as the delivery agent. For example, to switch to -, add:

recipient_delimiter = -