mailserver2 / mailserver

Simple and full-featured mail server using Docker
https://store.docker.com/community/images/mailserver2/mailserver
MIT License
141 stars 30 forks source link

I can send emails but Do not receive emails from outside! telnet smtp works inside container but not outside ! #44

Closed chtiou75 closed 1 year ago

chtiou75 commented 2 years ago

Classification

Please delete options that are not relevant.

Reproducibility

Please delete options that are not relevant.

Docker information

# docker info                                                                                                                                                                                          127 ↵
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Docker Buildx (Docker Inc., v0.7.1-docker)
  scan: Docker Scan (Docker Inc., v0.12.0)

Server:
 Containers: 15
  Running: 13
  Paused: 0
  Stopped: 2
 Images: 46
 Server Version: 20.10.12
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc version: v1.0.2-0-g52b36a2
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.10.0-11-amd64
 Operating System: Debian GNU/Linux 11 (bullseye)
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.74GiB
 Name: zer-sh-01
 ID: WTKU:BMQQ:YXZN:75XJ:FW5L:XNZA:XPAZ:5VEX:GKSQ:ZYUL:ZUW3:2M7P
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

╰─# docker images mailserver2/mailserver --digests --filter "dangling=false"
REPOSITORY               TAG       DIGEST                                                                    IMAGE ID       CREATED        SIZE
mailserver2/mailserver   latest    sha256:239ce71c62053b1240d13780c3f41e4998b310f46069b6607e06ebf37100c643   7a52702d6ef6   2 months ago   324MB

Description

Do not receive emails from outside! telnet smtp works inside container but not outside

Steps to reproduce

1. 2. 3.

Expected results

Actual results

Debugging information

mail dovecot: imap-login: Disconnected: Too many invalid commands (no auth attempts in 10 secs): user=<>, rip=172.29.0.1, lip=172.29.0.4, session= mailserver_1 | 2022-03-18T20:04:05.859755+00:00 mail dovecot: imap-login: Disconnected (no auth attempts in 10 secs): user=<>, rip=172.29.0.1, lip=172.29.0.4, TLS handshaking: SSL_accept() failed: error:1408F10B:SSL routines:ssl3_get_record:wrong version number, session=

Configuration (docker-compose.yml,

Version: '3.7'

# IPv4 only
# docker network create nmp-proxy
# IPv4/IPv6 network
# docker network create nmp-proxy --ipv6 --subnet "fd00:0000:0000:0000::/64"
# Refer to https://github.com/hardware/mailserver/#ipv6-support for more information.

networks:
  nmp-proxy:
    external: true
  postfixadmin_back:
    external: false

services:
  mailserver:
    image: mailserver2/mailserver
    restart: always
    domainname: hadj-bouziane.net                    # Mail server A/MX/FQDN & reverse PTR = mail.domain.tld.
    hostname: mail
    # extra_hosts:                          - Required for external database (on other server or for local database on host)
    #  - "mariadb:xx.xx.xx.xx"              - Replace with IP address of MariaDB server
    #  - "redis:xx.xx.xx.xx"                - Replace with IP address of Redis server
    ports:
      - "25:25"       # SMTP                - Required
    # - "110:110"     # POP3       STARTTLS - Optional - For webmails/desktop clients
      - "143:143"     # IMAP       STARTTLS - Optional - For webmails/desktop clients
    # - "465:465"     # SMTPS      SSL/TLS  - Optional - Enabled for compatibility reason, otherwise disabled
      - "587:587"     # Submission STARTTLS - Optional - For webmails/desktop clients
      - "993:993"     # IMAPS      SSL/TLS  - Optional - For webmails/desktop clients
    # - "995:995"     # POP3S      SSL/TLS  - Optional - For webmails/desktop clients
      - "4190:4190"   # SIEVE      STARTTLS - Optional - Recommended for mail filtering
    # - "11334:11334" # HTTP                - Optional - Rspamd WebUI

    environment:

      - DBPASS=xxxxxxx       # MariaDB database password (required)
      - RSPAMD_PASSWORD=xxxxxxx     # Rspamd WebUI password (required)
      - ADD_DOMAINS=hbmail.fr             # Add additional domains separated by commas (needed for dkim keys etc.)
    # - DEBUG_MODE=true                        # Enable Postfix, Dovecot, Rspamd and Unbound verbose logging
    # - ENABLE_POP3=true                       # Enable POP3 protocol
    # - ENABLE_FETCHMAIL=true                  # Enable fetchmail forwarding
    # - DISABLE_RATELIMITING=false             # Enable ratelimiting policy
    # - DISABLE_CLAMAV=true                    # Disable virus scanning
    # - DISABLE_SIGNING=true                   # Disable DKIM/ARC signing
    # - DISABLE_GREYLISTING=true               # Disable greylisting policy
    # - DISABLE_VHOSTS_OWNERSHIP_SET=true     # Disable vhosts directory ownship set (useful, when you have lots of mailboxes)
    #
    # Full list : https://github.com/hardware/mailserver#environment-variables
    #

    volumes:

      - /data/mail6:/var/mail

      # Uncomment the line below, when you want whitelist some IP Addresses or domains in Postfix (please check the 'Whitelist Hosts/IP Addresses In Postfix' in README.md for more info)
      # - ${VOLUMES_ROOT_PATH}/postfix/rbl_override:/etc/postfix/rbl_override

    depends_on:
      - mariadb
      - redis

    networks:

      - postfixadmin_back
      - nmp-proxy

  # Administration interface
  # https://github.com/hardware/postfixadmin
  # http://postfixadmin.sourceforge.net/
  # Configuration : https://github.com/hardware/mailserver/wiki/Postfixadmin-initial-configuration
  postfixadmin:

    image: mailserver2/postfixadmin
    restart: always
    domainname: hadj-bouziane.net
    hostname: mail

    environment:
      - DBPASS=xxxxxxx
    depends_on:
      - mailserver
      - mariadb

    networks:
      - postfixadmin_back
      - nmp-proxy

  # Database
  # https://github.com/docker-library/mariadb
  # https://mariadb.org/
  mariadb:
    image: mariadb:10.5
    restart: always
    # Info : These variables are ignored when the volume already exists (if databases was created before).
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=yes
      - MYSQL_DATABASE=postfix
      - MYSQL_USER=postfix
      - MYSQL_PASSWORD=xxxxxxx
    volumes:
      - /data/mail5/db/mysql:/var/lib/mysql
    networks:
      - postfixadmin_back

  # Cache Database
  # https://github.com/docker-library/redis.
  # https://redis.io/
  redis:

    image: redis:6.0-alpine
    restart: always
    command: redis-server --appendonly yes
    sysctls:

      - net.core.somaxconn=1024

    volumes:
      - /data/mail5/db/redis/:/data

    networks:
      - postfixadmin_back
SaraSmiseth commented 2 years ago

Hello, have you tried some of the testing websites. See https://github.com/mailserver2/mailserver#testing. Maybe they will provide some helpful information.

AndrewSav commented 1 year ago

Closing, as no feedback received. If you have configuration issues pop up on the discord, I'll try and help you out.