dockermail-server

Error while running Docker Mailserver via docker-compose up: You need at least one mail account to start Dovecot


I have tried to create an own mailserver with Docker Mailserver but it seems that it won't work.

I have created the docker-compose.yml

version: '3.8'
services:
  mailserver:
    image: docker.io/mailserver/docker-mailserver:latest
    container_name: mailserver
    hostname: mail-server
    domainname: domain.de
    ports:
      - "25:25"
      - "587:587"
      - "465:465"
    volumes:
      - ./docker-data/dms/mail-data/:/var/mail/
      - ./docker-data/dms/mail-state/:/var/mail-state/
      - ./docker-data/dms/mail-logs/:/var/log/mail/
      - ./docker-data/dms/config/:/tmp/docker-mailserver/
      - ./docker-data/nginx-proxy/certs/:/usr/local/psa/var/modules/letsencrypt/
      - /etc/localtime:/etc/localtime:ro
    environment:
      - ENABLE_FAIL2BAN=1
      - SSL_TYPE=letsencrypt
      - PERMIT_DOCKER=network
      - ONE_DIR=1
      - ENABLE_POSTGREY=0
      - ENABLE_CLAMAV=0
      - ENABLE_SPAMASSASSIN=0
      - SPOOF_PROTECTION=0
    cap_add:
      - NET_ADMIN # For Fail2Ban to work
      - SYS_PTRACE

And tried to run the container by docker-compose up but it gives me an error which I cannot sort out:

enter image description here

I have of course created a new email account by

./setup.sh email add user@domain password and the account exists in ./setup.sh email list but the error is still there.

Does anybody has an idea what is wrong? Thanks


Solution

  • With the help of the guys on docker-mailserver github I've managed to solve this.

    So you should:

    start the mail server, and then, when the message You need at least one mail account to start Dovecot is printed, run ./setup.sh email add email@domain.com password. setup.sh does not know about any running container in your setup (because when you executed it, no DMS container was running), or you have not provided -p , which would work as well.