diff --git a/README.md b/README.md index 81e343a7..489f1b81 100644 --- a/README.md +++ b/README.md @@ -108,17 +108,36 @@ If you're using `docker-mailserver` version `v10.1.x` or below, you will need to ### Get up and running +#### First Things First + +**Use `docker-compose up / down`, not `docker-compose start / stop`**. Otherwise, the container is not properly destroyed and you may experience problems during startup because of inconsistent state. + +You are able to get a full overview of how the configuration works by either running: + +1. `./setup.sh help` which includes the options of `setup.sh`. +2. `docker run --rm docker.io/mailserver/docker-mailserver:latest setup help` which provides you with all the information on configuration provided "inside" the container itself. + +#### Starting for the first time + +On first start, you will likely see an error stating that there are no mail accounts and the container will exit. You must now do one of two things: + +1. Use `setup.sh` to help you: `./setup.sh email add `. You may need the `-c` option to provide the local path for persisting configuration (_a directory that mounts to `/tmp/docker-mailserver` inside the container_). This will spin up a new container, mount your configuration volume, and create your first account. +2. Execute the complete command yourself: `docker run --rm -v "${PWD}/docker-data/dms/config/:/tmp/docker-mailserver/" docker.io/mailserver/docker-mailserver setup email add `. Make sure to mount the correct configuration directory. + +You can then proceed by creating the postmaster alias and by creating DKIM keys. + ``` BASH docker-compose up -d mailserver -# for SELinux, use -Z +# you may add some more users +# for SELinux, use -Z ./setup.sh [-Z] email add [] + +# and configure aliases, DKIM and more ./setup.sh [-Z] alias add postmaster@ ./setup.sh [-Z] config dkim ``` -If you're seeing error messages about unchecked errors, please **verify that you're using the right version of `setup.sh`**. Refer to the [Get the tools](#get-the-tools) section and / or execute `./setup.sh help` and read the `VERSION` section. - In case you're using LDAP, the setup looks a bit different as you do not add user accounts directly. Postfix doesn't know your domain(s) and you need to provide it when configuring DKIM: ``` BASH