docker-mailserver: BUG with sedfile

Miscellaneous first checks

  • I checked that all ports are open and not blocked by my ISP / hosting provider.
  • I know that SSL errors are likely the result of a wrong setup on the user side and not caused by DMS itself. I’m confident my setup is correct.

Affected Component(s)

Docker container startup

What happened and when does this occur?

Hi all,

I am actually encountering an issue and was wondering if you could help.

When i try to launch the container with the desired parameters, i get the following error : 

{"log":"Error: sed -i -r s|^(smtpd_tls_chain_files =).*|\\1 /etc/letsencrypt/live/mail.XXXXXXXXXXXXXXXX.fr/privkey.pem /etc/letsencrypt/live/mail.XXXXXXXXXXXXXXXX.fr/fullchain.pem| /etc/postfix/main.cf\n","stream":"stderr","time":"2022-03-04T16:29:03.525043318Z"}
{"log":"2022-03-04 16:29:03,524 DEBG 'mailserver' stderr output:\n","stream":"stdout","time":"2022-03-04T16:29:03.525088275Z"}
{"log":"Error: sed -i -r s|^(smtpd_tls_chain_files =).*|\\1 /etc/letsencrypt/live/mail.XXXXXXXXXXXXXXXX.fr/privkey.pem /etc/letsencrypt/live/mail.XXXXXXXXXXXXXXXX.fr/fullchain.pem| /etc/postfix/main.cf\n","stream":"stdout","time":"2022-03-04T16:29:03.525103699Z"}
{"log":"\n","stream":"stdout","time":"2022-03-04T16:29:03.525112301Z"}


it seems to be an error with the script sedfile

What did you expect to happen?

I enable debug mode and expected the container to run

How do we replicate the issue?

1.Generate certs with the docker command for certbot
2.run docker compose up
3.enable logging like exposed in the documentation
...

DMS version

docker.io/mailserver/docker-mailserver:latest

What operating system is DMS running on?

Linux

What instruction set architecture is DMS running on?

x86_64 / AMD64

What container orchestration tool are you using?

Docker Compose

docker-compose.yml

services:
  mailserver:
    image: docker.io/mailserver/docker-mailserver:latest
    container_name: mailserver
    # If the FQDN for your mail-server is only two labels (eg: example.com),
    # you can assign this entirely to `hostname` and remove `domainname`.
    hostname: XXXXXX
    domainname: XXXXXXXXX
    env_file: mailserver.env
    # More information about the mail-server ports:
    # https://docker-mailserver.github.io/docker-mailserver/edge/config/security/understanding-the-ports/
    # To avoid conflicts with yaml base-60 float, DO NOT remove the quotation marks.
    ports:
      - "25:25"    # SMTP  (explicit TLS => STARTTLS)
      - "143:143"  # IMAP4 (explicit TLS => STARTTLS)
      - "465:465"  # ESMTP (implicit TLS)
      - "587:587"  # ESMTP (explicit TLS => STARTTLS)
      - "993:993"  # IMAP4 (implicit TLS)
    volumes:
      - ./docker-data/certbot/certs/:/etc/letsencrypt/
      - ./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/
      - /etc/localtime:/etc/localtime:ro
    restart: always
    stop_grace_period: 1m
    cap_add:
      - SYS_PTRACE

Relevant log output

{"log":"Error: sed -i -r s|^(smtpd_tls_chain_files =).*|\\1 /etc/letsencrypt/live/mail.XXXXXXXXXXXXXXXX.fr/privkey.pem /etc/letsencrypt/live/mail.XXXXXXXXXXXXXXXX.fr/fullchain.pem| /etc/postfix/main.cf\n","stream":"stderr","time":"2022-03-04T16:29:03.525043318Z"}
{"log":"2022-03-04 16:29:03,524 DEBG 'mailserver' stderr output:\n","stream":"stdout","time":"2022-03-04T16:29:03.525088275Z"}
{"log":"Error: sed -i -r s|^(smtpd_tls_chain_files =).*|\\1 /etc/letsencrypt/live/mail.XXXXXXXXXXXXXXXX.fr/privkey.pem /etc/letsencrypt/live/mail.XXXXXXXXXXXXXXXX.fr/fullchain.pem| /etc/postfix/main.cf\n","stream":"stdout","time":"2022-03-04T16:29:03.525103699Z"}
{"log":"\n","stream":"stdout","time":"2022-03-04T16:29:03.525112301Z"}

Other relevant information

No response

What level of experience do you have with Docker and mail servers?

  • I am inexperienced with docker
  • I am inexperienced with mail servers
  • I am uncomfortable with the CLI

Code of conduct

Improvements to this form?

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (8 by maintainers)

Most upvoted comments

mailserver | [ FATAL ] Unless using LDAP, you need at least 1 email account to start Dovecot.

That is your problem. Try this:

docker-compose down
./setup.sh email add someuser@yourdomain.com secretpassword
docker-compose up

Thanks for your help, sorry for the time i wasted you, should have read the logs more carefully.