docker-mailserver/docs/content/config/user-management/aliases.md

38 lines
1.6 KiB
Markdown
Raw Normal View History

2016-04-24 15:17:17 +00:00
Please first read [Postfix documentation on virtual aliases](http://www.postfix.org/VIRTUAL_README.html#virtual_alias).
2016-05-24 04:08:23 +00:00
### Configuring aliases
2016-04-24 15:17:17 +00:00
Aliases are managed in `config/postfix-virtual.cf`.
An alias is a full email address that will be:
* delivered to an existing account in `config/postfix-accounts.cf`
* redirected to one or more other email addresses
Alias and target are space separated.
Example:
# Alias to existing account
alias1@domain.tld user1@domain.tld
# Forward to external email address
2016-05-24 04:08:23 +00:00
alias2@domain.tld external@gmail.com
### Configuring regexp aliases
2016-12-14 19:19:31 +00:00
Additional regexp aliases can be configured by placing them into `config/postfix-regexp.cf`. The regexp aliases get evaluated after the virtual aliases (postfix-virtual.cf). For example, the following `config/postfix-regexp.cf` causes all email to "test" users to be delivered to qa@example.com:
2016-05-24 04:08:23 +00:00
```
/^test[0-9][0-9]*@example.com/ qa@example.com
```
2017-03-19 13:54:58 +00:00
### Address tags as an alternative
Postfix supports address tags - i.e. address+tag@example.com will end up at address@example.com. This is configured by default and the (configurable) separator is set to `+`.
For more info, see [How to use Address Tagging (user+tag@example.com) with Postfix](https://www.stevejenkins.com/blog/2011/03/how-to-use-address-tagging-usertagexample-com-with-postfix/).
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 = -
```