2021-03-01 10:41:19 +00:00
---
title: Your best friend setup.sh
hide:
- toc # Hide Table of Contents for this page
---
[`setup.sh`][github-file-setupsh] is an administration script that helps with the most common tasks, including initial configuration. It is intented to be used from the host machine, _not_ from within your running container.
2020-06-09 20:39:39 +00:00
2020-06-09 20:42:44 +00:00
The latest version of the script is included in the `docker-mailserver` repository. You may retrieve it at any time by running this command in your console:
2016-08-29 19:51:09 +00:00
2021-03-01 10:41:19 +00:00
```sh
2021-01-19 08:45:01 +00:00
wget https://raw.githubusercontent.com/docker-mailserver/docker-mailserver/master/setup.sh
chmod a+x ./setup.sh
2017-03-17 22:34:05 +00:00
```
2016-08-29 19:51:09 +00:00
2021-03-02 16:39:06 +00:00
!!! info
Make sure to get the `setup.sh` that comes with the release you're using. Look up the release and the git commit on which this release is based upon by selecting the appropriate tag on GitHub. This can done with the "Switch branches/tags" button on GitHub, choosing the right tag. This is done in order to rule out possible inconsistencies between versions.
2020-06-09 20:42:44 +00:00
## Usage
2021-03-23 23:44:28 +00:00
Run `./setup.sh help` and you'll get some usage information:
2021-01-19 08:45:01 +00:00
2021-03-01 10:41:19 +00:00
```bash
2021-01-19 08:45:01 +00:00
setup.sh Bootstrapping Script
2016-08-29 19:51:09 +00:00
2016-12-03 00:11:25 +00:00
Usage: ./setup.sh [-i IMAGE_NAME] [-c CONTAINER_NAME] < subcommand > < subcommand > [args]
OPTIONS:
2021-01-19 08:45:01 +00:00
-i IMAGE_NAME The name of the docker-mailserver image
The default value is
2021-03-23 23:44:28 +00:00
'docker.io/mailserver/docker-mailserver:latest'
2020-10-30 17:36:38 +00:00
2016-12-03 00:11:25 +00:00
-c CONTAINER_NAME The name of the running container.
2016-08-29 19:51:09 +00:00
2021-01-19 08:45:01 +00:00
-p PATH Config folder path (default: /home/georg/github/docker-mailserver/config)
-h Show this help dialogue
2020-10-30 17:36:38 +00:00
-z Allow container access to the bind mount content
that is shared among multiple containers
on a SELinux-enabled host.
-Z Allow container access to the bind mount content
that is private and unshared with other containers
on a SELinux-enabled host.
2016-08-29 19:51:09 +00:00
SUBCOMMANDS:
email:
2021-01-19 08:45:01 +00:00
./setup.sh email add < email > [< password > ]
./setup.sh email update < email > [< password > ]
2016-08-29 19:51:09 +00:00
./setup.sh email del < email >
2018-02-08 07:32:56 +00:00
./setup.sh email restrict < add | del | list > < send | receive > [< email > ]
2016-08-29 19:51:09 +00:00
./setup.sh email list
2017-05-13 18:15:04 +00:00
alias:
./setup.sh alias add < email > < recipient >
./setup.sh alias del < email > < recipient >
./setup.sh alias list
2020-04-25 21:32:25 +00:00
quota:
./setup.sh quota set < email > [< quota > ]
./setup.sh quota del < email >
2016-08-29 19:51:09 +00:00
config:
2021-01-27 12:41:53 +00:00
./setup.sh config dkim < keysize > (default: 4096) < domain.tld > (optional - for LDAP setups)
2021-01-19 08:45:01 +00:00
./setup.sh config ssl < fqdn >
relay:
./setup.sh relay add-domain < domain > < host > [< port > ]
./setup.sh relay add-auth < domain > < username > [< password > ]
./setup.sh relay exclude-domain < domain >
2016-08-29 19:51:09 +00:00
debug:
./setup.sh debug fetchmail
2021-01-19 08:45:01 +00:00
./setup.sh debug fail2ban [< unban > < ip-address > ]
2016-12-03 00:11:25 +00:00
./setup.sh debug show-mail-logs
./setup.sh debug inspect
./setup.sh debug login < commands >
2020-06-09 20:37:53 +00:00
2021-01-19 08:45:01 +00:00
help: Show this help dialogue
2021-03-01 10:41:19 +00:00
```
[github-file-setupsh]: https://github.com/docker-mailserver/docker-mailserver/blob/master/setup.sh