Skip to content

Mailserver behind Traefik #2263

@dimitrimestdag

Description

@dimitrimestdag

Subject

I would like to configure a not documented mail server use case

Description

Hello,

I have configured your mail server with rainloop.
I receive emails well and when I configure an alias to an external address and I receive an email on my address, the email is transferred to the external address.
The concern is that when I try to send an email from rainloop I get the message "Authentication failed":
image

Here are the container logs regarding this error :

Oct 28 16:09:23 mail dovecot: imap([email protected])<18024><BXryQWrPUMtVqGs9>: Logged out in=90 out=982 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0,
Oct 28 16:13:38 mail dovecot: imap([email protected])<19420><UynoUGrPAs9VqGs9>: Logged out in=90 out=982 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0,
Oct 28 16:13:38 mail dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=my.ip, lip=traefik ip, mpid=19420, TLS, session=<UynoUGrPAs9VqGs9>,
Oct 28 16:13:34 mail dovecot: imap([email protected])<19384><wkHLUGrP7s5VqGs9>: Logged out in=11 out=449 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0,
Oct 28 16:13:34 mail postfix/smtps/smtpd[19385]: disconnect from my-ip.rev.numericable.fr[my.ip] ehlo=1 auth=0/1 quit=1 commands=2/3,
Oct 28 16:13:34 mail postfix/smtps/smtpd[19385]: warning: my-ip.rev.numericable.fr[my.ip]: SASL PLAIN authentication failed: ,
Oct 28 16:13:32 mail dovecot: auth: passwd-file(user,my.ip): unknown user (SHA1 of given password: ca7fbf),
Oct 28 16:13:32 mail postfix/smtps/smtpd[19385]: Anonymous TLS connection established from my-ip.rev.numericable.fr[my.ip]: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits),
Oct 28 16:13:32 mail postfix/smtps/smtpd[19385]: connect from my-ip.rev.numericable.fr[my.ip],
Oct 28 16:13:32 mail dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=my.ip, lip=traefik ip, mpid=19384, TLS, session=<wkHLUGrP7s5VqGs9>

I think the most important in these logs is "SASL PLAIN authentication failed" but I can't seem to find where it came from.

my mail server is behind Traefik which is in another container, here is my docker compose file :

traefik:
        restart: always
        image: traefik
        container_name: traefik
        hostname: traefik
        command:
          - "--entryPoints.smtp.address=:25"
          - "--entryPoints.smtp-ssl.address=:465"
          - "--entryPoints.imap-ssl.address=:993"
          - "--entryPoints.sieve.address=:4190"
          - [email protected]
          - --certificatesresolvers.myresolver.acme.storage=/certs/acme.json
        ports:
          - "25:25"
          - "465:465"
          - "993:993"
          - "4190:4190"
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock
          - ./traefik/certs:/certs
        networks:
          - backend
          - frontend
mailserver:
        image: docker.io/mailserver/docker-mailserver:latest
        container_name: mailserver
        hostname: mail
        domainname: domain.fr
        env_file: mail/mailserver.env
        labels:
          - "traefik.enable=true"
          - "traefik.tcp.routers.smtp.rule=HostSNI(`*`)"
          - "traefik.tcp.routers.smtp.entrypoints=smtp"
          - "traefik.tcp.routers.smtp.service=smtp"
          - "traefik.tcp.services.smtp.loadbalancer.server.port=25"
          - "traefik.tcp.services.smtp.loadbalancer.proxyProtocol.version=1"
          - "traefik.tcp.routers.smtp-ssl.rule=HostSNI(`*`)"
          - "traefik.tcp.routers.smtp-ssl.tls=false"
          - "traefik.tcp.routers.smtp-ssl.entrypoints=smtp-ssl"
          - "traefik.tcp.routers.smtp-ssl.service=smtp-ssl"
          - "traefik.tcp.services.smtp-ssl.loadbalancer.server.port=465"
          - "traefik.tcp.services.smtp-ssl.loadbalancer.proxyProtocol.version=1"
          - "traefik.tcp.routers.imap-ssl.rule=HostSNI(`*`)"
          - "traefik.tcp.routers.imap-ssl.entrypoints=imap-ssl"
          - "traefik.tcp.routers.imap-ssl.service=imap-ssl"
          - "traefik.tcp.services.imap-ssl.loadbalancer.server.port=10993"
          - "traefik.tcp.services.imap-ssl.loadbalancer.proxyProtocol.version=2"
          - "traefik.tcp.routers.sieve.rule=HostSNI(`*`)"
          - "traefik.tcp.routers.sieve.entrypoints=sieve"
          - "traefik.tcp.routers.sieve.service=sieve"
          - "traefik.tcp.services.sieve.loadbalancer.server.port=4190"
        volumes:
          - ./mail/dms/mail-data/:/var/mail/
          - ./mail/dms/mail-state/:/var/mail-state/
          - ./mail/dms/mail-logs/:/var/log/mail/
          - ./mail/dms/config/:/tmp/docker-mailserver/
          - ./traefik/certs/acme.json:/etc/letsencrypt/acme.json:ro
          - /etc/localtime:/etc/localtime:ro
        restart: always
        stop_grace_period: 1m
        cap_add:
          - NET_ADMIN
          - SYS_PTRACE
        networks:
          - backend

and the dovecot and postfix conf are the same as here: https://docker-mailserver.github.io/docker-mailserver/edge/examples/tutorials/mailserver-behind-proxy/

It should not be a problem coming from Rainloop like here: RainLoop/rainloop-webmail#1629 since I also cannot send mail from my Outlook client

Do you have any idea where the problem could come from?

thanks in advance,

Dimo

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/questionSomeone asked a question - feel free to answermeta/help wantedThe OP requests help from others - chime in! :Dmeta/needs triageThis issue / PR needs checks and verification from maintainerspriority/low

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions