Mailu / Mailu

Insular email distribution - mail server as Docker images
https://mailu.io
Other
5.82k stars 830 forks source link

Brand new setup on clear VPS not working on v1.7 #1340

Closed nizovtsevnv closed 4 years ago

nizovtsevnv commented 4 years ago

Simple docker-compose configuration from mailu setup on brand new VPS with disabled firewall is not working. I've tried it at three different servers. Mail ports just closed. I've tried change 'ports' section with '0.0.0.0:PORT:PORT' variation, with '::1:PORT:PORT' and with 'PORT:PORT' variations.

docker-compose.yml

version: '2.2'

services:
  redis:
    image: redis:alpine
    restart: always
    volumes:
      - "/mailu/redis:/data"

  front:
    image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}nginx:${MAILU_VERSION:-1.7}
    restart: always
    env_file: mailu.env
    logging:
      driver: json-file
    ports:
      - "0.0.0.0:80:80"
      - "0.0.0.0:443:443"
      - "0.0.0.0:25:25"
      - "0.0.0.0:465:465"
      - "0.0.0.0:587:587"
      - "0.0.0.0:110:110"
      - "0.0.0.0:995:995"
      - "0.0.0.0:143:143"
      - "0.0.0.0:993:993"
    volumes:
      - "/mailu/certs:/certs"
      - "/mailu/overrides/nginx:/overrides"

  admin:
    image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}admin:${MAILU_VERSION:-1.7}
    restart: always
    env_file: mailu.env
    volumes:
      - "/mailu/data:/data"
      - "/mailu/dkim:/dkim"
    depends_on:
      - redis

  imap:
    image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}dovecot:${MAILU_VERSION:-1.7}
    restart: always
    env_file: mailu.env
    volumes:
      - "/mailu/mail:/mail"
      - "/mailu/overrides:/overrides"
    depends_on:
      - front

  smtp:
    image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}postfix:${MAILU_VERSION:-1.7}
    restart: always
    env_file: mailu.env
    volumes:
      - "/mailu/overrides:/overrides"
    depends_on:
      - front

  antispam:
    image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}rspamd:${MAILU_VERSION:-1.7}
    restart: always
    env_file: mailu.env
    volumes:
      - "/mailu/filter:/var/lib/rspamd"
      - "/mailu/dkim:/dkim"
      - "/mailu/overrides/rspamd:/etc/rspamd/override.d"
    depends_on:
      - front

  # Optional services
  antivirus:
    image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}clamav:${MAILU_VERSION:-1.7}
    restart: always
    env_file: mailu.env
    volumes:
      - "/mailu/filter:/data"

networks:
  default:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 192.168.203.0/24

mailu.env:

###################################
# Common configuration variables
###################################

# Set to a randomly generated 16 bytes string
SECRET_KEY=1234567890123456

# Subnet of the docker network. This should not conflict with any networks to which your system is connected. (Internal and external!)
SUBNET=192.168.203.0/24

# Main mail domain
DOMAIN=mydomain.com

# Hostnames for this server, separated with comas
HOSTNAMES=mail.mydomain.com

# Postmaster local part (will append the main mail domain)
POSTMASTER=admin

# Choose how secure connections will behave (value: letsencrypt, cert, notls, mail, mail-letsencrypt)
TLS_FLAVOR=letsencrypt

# Authentication rate limit (per source IP address)
AUTH_RATELIMIT=10/minute;1000/hour 

# Opt-out of statistics, replace with "True" to opt out
DISABLE_STATISTICS=True

###################################
# Optional features
###################################

# Expose the admin interface (value: true, false)
ADMIN=true

# Choose which webmail to run if any (values: roundcube, rainloop, none)
WEBMAIL=none

# Dav server implementation (value: radicale, none)
WEBDAV=none

# Antivirus solution (value: clamav, none)
#ANTIVIRUS=clamav

###################################
# Mail settings
###################################

# Message size limit in bytes
# Default: accept messages up to 50MB
# Max attachment size will be 33% smaller
MESSAGE_SIZE_LIMIT=50000000

# Networks granted relay permissions
# Use this with care, all hosts in this networks will be able to send mail without authentication!
RELAYNETS=

# Will relay all outgoing mails if configured
RELAYHOST=

# Fetchmail delay
FETCHMAIL_DELAY=600

# Recipient delimiter, character used to delimiter localpart from custom address part
RECIPIENT_DELIMITER=+

# DMARC rua and ruf email
DMARC_RUA=admin
DMARC_RUF=admin

# Welcome email, enable and set a topic and body if you wish to send welcome
# emails to all users.
WELCOME=false
WELCOME_SUBJECT=Welcome to your new email account
WELCOME_BODY=Welcome to your new email account, if you can read this, then it is configured properly!

# Maildir Compression
# choose compression-method, default: none (value: bz2, gz)
COMPRESSION=
# change compression-level, default: 6 (value: 1-9)
COMPRESSION_LEVEL=

###################################
# Web settings
###################################

# Path to redirect / to
WEBROOT_REDIRECT=

# Path to the admin interface if enabled
WEB_ADMIN=/mailu-admin

# Path to the webmail if enabled
WEB_WEBMAIL=

# Website name
SITENAME=Mailu

# Linked Website URL
WEBSITE=https://mail.mydomain.com

###################################
# Advanced settings
###################################

# Log driver for front service. Possible values:
# json-file (default)
# journald (On systemd platforms, useful for Fail2Ban integration)
# syslog (Non systemd platforms, Fail2Ban integration. Disables `docker-compose log` for front!)
# LOG_DRIVER=json-file

# Docker-compose project name, this will prepended to containers names.
COMPOSE_PROJECT_NAME=mailu

# Default password scheme used for newly created accounts and changed passwords
# (value: BLF-CRYPT, SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT)
PASSWORD_SCHEME=BLF-CRYPT

# Header to take the real ip from
REAL_IP_HEADER=

# IPs for nginx set_real_ip_from (CIDR list separated by commas)
REAL_IP_FROM=

# choose wether mailu bounces (no) or rejects (yes) mail when recipient is unknown (value: yes, no)
REJECT_UNLISTED_RECIPIENT=

# Log level threshold in start.py (value: CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET)
LOG_LEVEL=WARNING

###################################
# Database settings
###################################
DB_FLAVOR=sqlite

netstat -lntu

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp6       0      0 :::587                  :::*                    LISTEN     
tcp6       0      0 :::110                  :::*                    LISTEN     
tcp6       0      0 :::143                  :::*                    LISTEN     
tcp6       0      0 :::80                   :::*                    LISTEN     
tcp6       0      0 :::465                  :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 :::25                   :::*                    LISTEN     
tcp6       0      0 :::443                  :::*                    LISTEN     
tcp6       0      0 :::993                  :::*                    LISTEN     
tcp6       0      0 :::995                  :::*                    LISTEN     
udp        0      0 0.0.0.0:68              0.0.0.0:*                          

nmap -Pn mail.mydomain.com

PORT   STATE SERVICE
22/tcp open  ssh
25/tcp open  smtp
80/tcp open  http

docker ps

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                    PORTS                                                                                                                                                                                                                    NAMES
a19d7e3cb777        mailu/postfix:1.7   "/bin/sh -c /start.py"   13 minutes ago      Up 13 minutes (healthy)   25/tcp, 10025/tcp                                                                                                                                                                                                        mailu_smtp_1
778417da1f85        mailu/rspamd:1.7    "/bin/sh -c /start.py"   13 minutes ago      Up 13 minutes (healthy)   11332/tcp, 11334-11335/tcp                                                                                                                                                                                               mailu_antispam_1
31a4495a759d        mailu/dovecot:1.7   "/bin/sh -c /start.py"   13 minutes ago      Up 13 minutes (healthy)   110/tcp, 143/tcp, 993/tcp, 2525/tcp, 4190/tcp                                                                                                                                                                            mailu_imap_1
51ef0186e42c        mailu/admin:1.7     "/bin/sh -c /start.py"   13 minutes ago      Up 13 minutes (healthy)   80/tcp                                                                                                                                                                                                                   mailu_admin_1
219b83d2bd0c        mailu/clamav:1.7    "/bin/sh -c /start.py"   13 minutes ago      Up 13 minutes (healthy)   3310/tcp                                                                                                                                                                                                                 mailu_antivirus_1
afe0dbe0206b        redis:alpine        "docker-entrypoint.s…"   13 minutes ago      Up 13 minutes             6379/tcp                                                                                                                                                                                                                 mailu_redis_1
559068ebf54a        mailu/nginx:1.7     "/bin/sh -c /start.py"   13 minutes ago      Up 13 minutes (healthy)   0.0.0.0:25->25/tcp, 0.0.0.0:80->80/tcp, 0.0.0.0:110->110/tcp, 0.0.0.0:143->143/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:465->465/tcp, 0.0.0.0:587->587/tcp, 0.0.0.0:993->993/tcp, 10025/tcp, 0.0.0.0:995->995/tcp, 10143/tcp   mailu_front_1
kaiyou commented 4 years ago

First, you should not use 0.0.0.0, this is stated in the setup utility and the documentation. Please use a specific IP address as it will remove a lot of issues of Mailu not being able to listen on ports because of other processes conflicting (starting with local Postfix on localhost).

On your specific issue however, it looks like TLS is not properly setup and thus HTTPS, IMAPS, etc. are not enabled. Could you have a look at logs from the front container?

Nebukadneza commented 4 years ago

Hi There,

The Mailu-Project is currently in a bit of a bind! We are short on man-power, and we need to judge if it is possible for us to put in some work on this issue.

To help with that, we are currently trying to find out which issues are actively keeping users from using Mailu, which issues have someone who want to work on them — and which issues may be less important. These a less important ones could be discarded for the time being, until the project is in a more stable and regular state once again.

In order for us to better assess this, it would be helpful if you could put a reaction on this post (use the :smiley: icon to the top-right).

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Nebukadneza commented 4 years ago

Hi There,

we see this issue had only little attention 😟. As much as it pains us: In order to get the current issues a bit more manageable for us, we decided to close it. 👋👋

We hope that no one feels offended by doing so. Should the issue get really pressing in the future, please feel free to re-open it.

Thank you for your patience and understanding, 🙇