Skip to content

User Management


Users (email accounts) are managed in /tmp/docker-mailserver/ The best way to manage accounts is to use the reliable setup command inside the container. Just run docker exec <CONTAINER NAME> setup help and have a look at the section about subcommands, specifically the email subcommand.

Adding a new Account

Via setup inside the container

You can add an account by running docker exec -ti <CONTAINER NAME> setup email add <NEW ADDRESS>. This method is strongly preferred.



This method is discouraged!

Alternatively, you may directly add the full email address and its encrypted password, separated by a pipe. To generate a new mail account data, directly from your host, you could for example run the following:

docker run --rm -it                                      \
  --env                      \
  --env MAIL_PASS=mypassword                             \     \
  /bin/bash -c \
    'echo "${MAIL_USER}|$(doveadm pw -s SHA512-CRYPT -u ${MAIL_USER} -p ${MAIL_PASS})" >>docker-data/dms/config/'

You will then be asked for a password, and be given back the data for a new account entry, as text. To actually add this new account, just copy all the output text in docker-data/dms/config/ file of your running container.

The result could look like this:|{SHA512-CRYPT}$6$2YpW1nYtPBs2yLYS$z.5PGH1OEzsHHNhl3gJrc3D.YMZkvKw/vp.r5WIiwya6z7P/CQ9GDEJDr2G2V0cAfjDFeAQPUoopsuWPXLk3u1


  • imap-quota is enabled and allow clients to query their mailbox usage.
  • When the mailbox is deleted, the quota directive is deleted as well.
  • Dovecot quotas support LDAP, but it's not implemented (PRs are welcome!).


The best way to manage aliases is to use the reliable setup script inside the container. Just run docker exec <CONTAINER NAME> setup help and have a look at the section about subcommands, specifically the alias-subcommand.


You may read Postfix's documentation on virtual aliases first. Aliases are managed in /tmp/docker-mailserver/ An alias is a full email address that will either be:

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

Alias and target are space separated. An example on a server with as its domain:

# Alias delivered to an existing account

# Alias forwarded to an external email address

Configuring RegExp Aliases

Additional regexp aliases can be configured by placing them into docker-data/dms/config/ The regexp aliases get evaluated after the virtual aliases (container path: /tmp/docker-mailserver/ For example, the following docker-data/dms/config/ causes all email sent to "test" users to be delivered to instead:


Address Tags (Extension Delimiters) as an alternative to Aliases

Postfix supports so-called address tags, in the form of plus (+) tags - i.e. will end up at This is configured by default and the (configurable!) separator is set to +. For more info, see Postfix's official documentation.


If you do decide to change the configurable separator, you must add the same line to both docker-data/dms/config/ and docker-data/dms/config/, because Dovecot is acting as the delivery agent. For example, to switch to -, add:

recipient_delimiter = -