Skip to content

relaying: mails are not relayed with implicit tls (465) / improve scripts & configuration #2601

@edge90

Description

@edge90

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)

Mails are not relayed with implicit tls (465)

What happened and when does this occur?

DEFAULT_RELAY_HOST=[relay.smtp.isp.tld]:465
RELAY_HOST=relay.smtp.isp.tld
RELAY_PORT=465
RELAY_USER=MYUSERNAME
RELAY_PASSWORD=MYCOMPLICATEDPASSWORD

What did you expect to happen?

Mail should be forwarded through the relay.

How do we replicate the issue?

1. mailserver.env:

DEFAULT_RELAY_HOST=[relay.smtp.isp.tld]:465
RELAY_HOST=relay.smtp.isp.tld
RELAY_PORT=465
RELAY_USER=MYUSERNAME
RELAY_PASSWORD=MYCOMPLICATEDPASSWORD
  1. Will complain about smtp_tls_wrappermode = yes and smtp_tls_security_level = encrypt.
    Added the following to docker-data/dms/config/postfix-main.cf
smtp_tls_wrappermode = yes
smtp_tls_security_level = encrypt
  1. Sendmail from the cli works.
    sendmail -F "Firstname surname" -f "[email protected]" -t [email protected]
    Subject: Hello
    World
  2. Sending from a smtp client does not.
warning: smtp_tls_wrappermode requires "smtp_tls_security_level = encrypt" (or stronger)
to=<....>, relay=none, delay=0.33, delays=0.33/0/0/0, dsn=4.3.0, status=deferred (server unavailable or unable to receive mail)

DMS version

v11.0.0

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: mail
    domainname: domain.tld
    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/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
      - /etc/letsencrypt:/etc/letsencrypt:ro
    restart: always
    stop_grace_period: 1m
    cap_add:
      - NET_ADMIN
      - SYS_PTRACE

Relevant log output

No response

Other relevant information

To get it to work I had to add `-o smtp_tls_wrappermode=no` to `smtp-amavis` and `127.0.0.1:10025` in master.cf.

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

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions