Setup docker mailserver using the script

17Halbe edited this page Mar 6, 2018 · 9 revisions

The latest version of the script is included in the docker-mailserver repository. Get the last version to the script by copying this command in your console:

wget -q -O; chmod a+x ./

if you use curl:

curl -o; chmod a+x ./

Run ./ without arguments and you get some usage informations.

Usage: ./ [-i IMAGE_NAME] [-c CONTAINER_NAME] <subcommand> <subcommand> [args]


  -i IMAGE_NAME     The name of the docker-mailserver image, by default
  -c CONTAINER_NAME The name of the running container.



    ./ email add <email> <password>
    ./ email update <email> <password>
    ./ email del <email>
    ./ email restrict <add|del|list> <send|receive> [<email>]
    ./ email list

    ./ alias add <email> <recipient>
    ./ alias del <email> <recipient>
    ./ alias list


    ./ config dkim <keysize> (default: 2048)
    ./ config ssl


    ./ debug fetchmail
    ./ debug show-mail-logs
    ./ debug inspect
    ./ debug login <commands>


  • ./ email add <email> [<password>]: Add an email-account (<password> is optional)
  • ./ email update <email> [<password>]: Change the password of an email-account (<password> is optional)
  • `./ email del ': delete an email-account
  • ./ email restrict <add|del|list> <send|receive> [<email>]: deny users to send or receive mail. You can also list the respective denied mail-accounts.
  • ./ email list: list all existing email-accounts


  • ./ alias add <email> <recipient>: add an alias(email) for an email-account(recipient)
  • ./ alias del <email> <recipient>: delete an alias
  • ./ alias list: list all aliases


  • ./ config dkim <keysize> (default: 2048): autoconfig the dkim-config with an (optional) keysize value
  • ./ config ssl: generate ssl-certificates


  • ./ debug fetchmail: see wiki
  • ./ debug fail2ban <unban> <ip-address>: omitt all options to get a list of banned IPs, otherwise unban the specified IP.
  • ./ debug show-mail-logs: show the logfile contents of the mail container
  • ./ debug inspect: show infos about the running container
  • ./ debug login <commands>: run a inside the mail container (omit the command to get shell access)
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.