Self-hosted mail settings - Socket Exceptions?

I’ve recently set up my self-hosted eCloud instance and (with thanks from @smu44) I’ve got my file storage all working. The only thing left I haven’t managed to get working is self-hosted email.

I’m using Hetzner, and according to their networking settings,

Outgoing traffic to ports 25 and 465 are blocked by default on all Cloud Servers. Sending mails from servers is not possible for this reason.

I can request these to be unblocked at some point, but not immediately as my account is new I have to wait for a while, but I don’t think it’s this that’s causing me issues.

I can log into my RainLoop Webmail admin account and tinker with settings, but trying to actually access a mail account (presumably using the same login details I use to login to my eCloud / Nextcloud dashboard) just gives me an ‘Authentication Failed’ message.

My settings in the Rainloop Admin Panel are currently:

Does anyone have any idea what settings I need to update? Or if there are any bash commands I need to run to sort things out?

Hi,

For external access :
You definitively don’t need ports 25 & 465 (yes, there is a mapping for them in docker-compose.yml, but it’s useless).
Ports are : 993 for IMAP (reading your emails) & 587 for SMTP (sending emails).
You can retrieve all settings in an XML file using https://autoconfig.yourdomain.tld :wink:

But … this is only for external (through Internet) access to the mail server.


Accessing your emails with Rainloop is 100% internal to your server, from one Docker container to another.
Instead of using a email client from your PC, the client is running on your server, with a web interface to let us, poor humans, interact with email system :wink:

So, for the Rainloop mail client running on your server, the address for the email server is the Docker internal container name, you won’t need the domain name (which is to be used only for external -Internet- access) :

  • if you have a NC18 /e/ Cloud, it’s “eelomailserver”
  • if you have a recent NC20 /e/ Cloud, it’s “mailserver”
  • it is the container name for email container in /mnt/repo-base/docker-compose.yml

Filling your settings, exactly as below, should work :


(note the green test button)

For Sieve :

NB : Sieve is an essential component to move messages : for example, it allow system to move spam emails to “Spam” folder, and also allow users to make they own rules :


(here, I want to move all messages with specific subject to a specific folder, and mark them read)


I’m wondering why the Rainloop domain configuration hasn’t be done automatically for you by the install script …
Did you keep the output of install scripts ?
Can you check in your /mnt/repo-base/scripts/postinstall.sh that you have the necessary lines as in scripts/postinstall.sh · master · e / infra / ecloud-selfhosting · GitLab ( lines 73 to 78) ?

1 Like

Also, while you’re in Ranloop admin please check the followings.

For Login, please check/enter your domain name (i.e. yourdomain.tld) :
image

If you want users to be able to use their contacts in Rainloop, you can also check this settings :

Thank you, although I’ve updated my settings and still get some errors:

I’m not too bothered about using RainLoop itself; I thought it was required but if it’s only a webclient then I’m happy ignoring it and just trying to get it working with an external client. I tried a couple of mail apps, using the IMAP settings through the autoconfig XML file you suggested and I get a similar problem: “Can’t contact server”, so there’s definitely something wrong. :confused:

I have 2FA setup, so in case some of this is due to me using incorrect credentials, I’ve tried with normal password and with the app token but still no luck.

Hmmmm … Weird !

Could you please :

  • post back your /mnt/repo-base/docker-compose.yml file (it should not contain any sensitive information)
  • run as root : cd /mnt/repo-base then source scripts/base/sh then docker-compose ps -a mailserver, then post back the result of the latest
    – if status “up”, please post back the output of docker container inspect mailserver (take care of passwords and domain). Then run docker network ls, locate the “default” network (may be something like “blabla_default”), then post back the result of docker network inspect blabla_default
    – if status not “up”, run docker container prune then docker-compose -d up and retry the docker-compose ps -a mailserver

Ok, my docker-compose.yml:

version: '3'

services:
  mailserver:
    image: mailserver2/mailserver:1.1.4
    container_name: mailserver
    domainname: ${DOMAIN} # Mail server A/MX/FQDN & reverse PTR = mail.${DOMAIN}.
    hostname: mail
    restart: always
    networks:
      - default
    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
    environment:
      - DBPASS=${DBPASS}
      - RSPAMD_PASSWORD=${RSPAMD_PASSWORD}
      - ADD_DOMAINS=${ADD_DOMAINS}
      - ENABLE_POP3=${ENABLE_POP3}
      - DISABLE_RATELIMITING=${DISABLE_RATELIMITING}
      - RELAY_NETWORKS=172.16.0.0/12
      # Full list of options: https://github.com/hardware/mailserver#environment-variables
    volumes:
      - /mnt/repo-base/volumes/mail:/var/mail
      - /mnt/repo-base/config/letsencrypt/certstore:/etc/letsencrypt
      - /mnt/repo-base/config/mail/dovecot/10-mail.conf:/etc/dovecot/conf.d/10-mail.conf
      - /mnt/repo-base/config/mail/dovecot/90-quota.conf:/etc/dovecot/conf.d/90-quota.conf
      - /mnt/repo-base/config/mail/dovecot/90-sieve.conf:/etc/dovecot/conf.d/90-sieve.conf
      - /mnt/repo-base/config/mail/rspamd/multimap.conf:/etc/rspamd/local.d/multimap.conf
      - /mnt/repo-base/config/mail/rspamd/whitelist.sender.domain.map:/etc/rspamd/local.d/whitelist.sender.domain.map
      - /mnt/repo-base/config/mail/rspamd/ratelimit.conf:/etc/rspamd/local.d/ratelimit.conf
      - /mnt/repo-base/config/mail/clamav/freshclam.conf:/etc/clamav/freshclam.conf
    depends_on:
      - mariadb
      - redis

  postfixadmin:
    image: registry.gitlab.e.foundation/e/infra/docker-postfixadmin:2.0.1
    container_name: postfixadmin
    restart: always
    networks:
      - default
    environment:
      - DBPASS=${DBPASS}
      - DBHOST=mariadb
      - DOMAIN=${DOMAIN}
      - DRIVE_SMTP_PASSWORD=${DRIVE_SMTP_PASSWORD}
      - POSTFIXADMIN_SSH_PASSWORD=${POSTFIXADMIN_SSH_PASSWORD}
      - POSTFIXADMIN_DB_TYPE=mysqli
      - POSTFIXADMIN_DB_HOST=mariadb
      - POSTFIXADMIN_DB_USER=postfix
      - POSTFIXADMIN_DB_NAME=postfix
      - POSTFIXADMIN_DB_PASSWORD=${DBPASS}
      - POSTFIXADMIN_SMTP_SERVER=mail.${DOMAIN}
      - POSTFIXADMIN_SMTP_PORT=587
    volumes:
      - /mnt/repo-base/volumes/mail:/var/mail
    depends_on:
      - mailserver
      - mariadb

  mariadb:
    image: mariadb:10.3
    container_name: mariadb
    restart: always
    networks:
      - default
    environment:
      # Note: These variables are only used for the first start. Later changes are ignored.
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_DATABASE=${PFDB_DB}
      - MYSQL_USER=${PFDB_USR}
      - MYSQL_PASSWORD=${DBPASS}
    volumes:
      - /mnt/repo-base/volumes/mysql/db/data:/var/lib/mysql
      - /mnt/repo-base/config/mariadb/:/etc/mysql/conf.d/:ro
  redis:
    image: redis:6.0-alpine
    container_name: redis
    restart: always
    networks:
      - default
    command: redis-server --appendonly yes
    volumes:
      - /mnt/repo-base/volumes/redis/db:/data
      - /mnt/repo-base/volumes/redis/tmp:/tmp/redis

  welcome:
    image: registry.gitlab.e.foundation/e/infra/docker-welcome:2.1.3
    container_name: welcome
    environment:
      - DOMAINS=${VHOSTS_ACCOUNTS}
      - DOMAIN=${DOMAIN}
      - IS_WELCOME=true
      - PFDB_HOST=mariadb
      - PFDB_DB=${PFDB_DB}
      - PFDB_USR=${PFDB_USR}
      - PFDB_PW=${DBPASS}
      - POSTFIXADMIN_SSH_PASSWORD=${POSTFIXADMIN_SSH_PASSWORD}
      - WELCOME_SECRET_SHA=${WELCOME_SECRET_SHA}
      - WEBSITE_SECRET=${WEBSITE_SECRET}
      - SMTP_HOST=${SMTP_HOST}
      - SMTP_FROM=${SMTP_FROM}
      - SMTP_PW=${SMTP_PW}
      - SMTP_PORT=587
      - NEXTCLOUD_ADMIN_USER=${NEXTCLOUD_ADMIN_USER}
      - NEXTCLOUD_ADMIN_PASSWORD=${NEXTCLOUD_ADMIN_PASSWORD}
      - NEXTCLOUD_EMAIL_RECOVERY_APP_SECRET=${NEXTCLOUD_EMAIL_RECOVERY_APP_SECRET}
      - CREATE_ACCOUNT_PASSWORD=${CREATE_ACCOUNT_PASSWORD}
    restart: always
    networks:
      - default
    volumes:
      - /mnt/repo-base/volumes/accounts:/var/accounts
      - /mnt/repo-base/config/welcome/apache2/remoteip.conf:/etc/apache2/conf-available/remoteip.conf
    extra_hosts:
      - "${DOMAIN}:${NC_HOST_IP}"

  nextcloud:
    image: registry.gitlab.e.foundation/e/infra/ecloud/nextcloud:selfhost
    container_name: nextcloud
    restart: always
    networks:
      - default
    environment:
      - MYSQL_DATABASE=${MYSQL_DATABASE_NC}
      - MYSQL_USER=${MYSQL_USER_NC}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD_NC}
      - MYSQL_HOST=mariadb
      - NEXTCLOUD_ADMIN_USER=${NEXTCLOUD_ADMIN_USER}
      #  below ENV disabled so NC container do not start install
      # - NEXTCLOUD_ADMIN_PASSWORD=${NEXTCLOUD_ADMIN_PASSWORD}
      - OVERWRITEPROTOCOL=https 
      - NEXTCLOUD_EMAIL_RECOVERY_APP_SECRET=${NEXTCLOUD_EMAIL_RECOVERY_APP_SECRET}
    volumes:
      - /mnt/repo-base/volumes/nextcloud/html:/var/www/html/
      - /mnt/repo-base/volumes/nextcloud/data:/var/www/data/
      - /mnt/repo-base/config/nextcloud/x-fpm-overloads.conf:/usr/local/etc/php-fpm.d/x-fpm-overloads.conf
      - /mnt/repo-base/config/nextcloud/x-php-overloads.ini:/usr/local/etc/php/conf.d/x-php-overloads.ini
      - /mnt/repo-base/volumes/nextcloud/log:/var/www/log/
      - /mnt/repo-base/volumes/redis/db:/tmp/redis
    depends_on:
      - mariadb
      - redis

  automx:
    image: registry.gitlab.e.foundation/e/infra/docker-mailstack:automx-0.1.0
    container_name: automx
    hostname: automx
    environment:
      - VIRTUAL_HOST=${VIRTUAL_HOST}
      - DOMAIN=${DOMAIN}
      - HOSTNAME=automx
    restart: always
    networks:
      - default
    volumes:
      - /mnt/repo-base/config/automx/automx.conf:/etc/automx.conf

  nginx:
    image: nginx:1.19-alpine
    container_name: nginx
    restart: unless-stopped
    networks:
      - default
    ports:
      - "80:8000"
      - "443:4430"
    volumes:
      - /mnt/repo-base/config/nginx/sites-enabled:/etc/nginx/conf.d/
      - /mnt/repo-base/config/nginx/params:/etc/nginx/params/
      - /mnt/repo-base/config/letsencrypt/certstore:/certs
      - /mnt/repo-base/config/nginx/passwds:/passwds
      - /mnt/repo-base/config/letsencrypt/acme-challenge:/etc/letsencrypt/acme-challenge
      - /mnt/repo-base/volumes/nextcloud/html:/var/www/html
    depends_on:
      - nextcloud
      - automx
      - postfixadmin
      - welcome
      - mailserver

Here’s the result of running docker-compose ps -a mailserver:

Name      Command   State                                                                                Ports
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
mailserver   run.sh    Up      0.0.0.0:110->110/tcp,:::110->110/tcp, 11334/tcp, 0.0.0.0:143->143/tcp,:::143->143/tcp, 0.0.0.0:25->25/tcp,:::25->25/tcp,
                               0.0.0.0:4190->4190/tcp,:::4190->4190/tcp, 465/tcp, 0.0.0.0:587->587/tcp,:::587->587/tcp, 0.0.0.0:993->993/tcp,:::993->993/tcp,
                               0.0.0.0:995->995/tcp,:::995->995/tcp

The result of docker container inspect mailserver (I’ve redacted some IDs with “…” and replaced my domain with “domain.tld”):

[
  {
    "Id": "...",
    "Created": "2021-11-15T20:07:53.57305938Z",
    "Path": "run.sh",
    "Args": [],
    "State": {
      "Status": "running",
      "Running": true,
      "Paused": false,
      "Restarting": false,
      "OOMKilled": false,
      "Dead": false,
      "Pid": 2124,
      "ExitCode": 0,
      "Error": "",
      "StartedAt": "2021-11-16T18:11:33.444297337Z",
      "FinishedAt": "2021-11-16T18:11:27.815765675Z"
    },
    "Image": "...",
    "ResolvConfPath": "/var/lib/docker/containers/.../resolv.conf",
    "HostnamePath": "/var/lib/docker/containers/.../hostname",
    "HostsPath": "/var/lib/docker/containers/.../hosts",
    "LogPath": "/var/lib/docker/containers/.../...-json.log",
    "Name": "/mailserver",
    "RestartCount": 0,
    "Driver": "overlay2",
    "Platform": "linux",
    "MountLabel": "",
    "ProcessLabel": "",
    "AppArmorProfile": "docker-default",
    "ExecIDs": null,
    "HostConfig": {
      "Binds": [
        "/mnt/repo-base/config/mail/rspamd/multimap.conf:/etc/rspamd/local.d/multimap.conf:rw",
        "/mnt/repo-base/config/mail/rspamd/whitelist.sender.domain.map:/etc/rspamd/local.d/whitelist.sender.domain.map:rw",
        "/mnt/repo-base/config/letsencrypt/certstore:/etc/letsencrypt:rw",
        "/mnt/repo-base/config/mail/clamav/freshclam.conf:/etc/clamav/freshclam.conf:rw",
        "/mnt/repo-base/config/mail/dovecot/90-sieve.conf:/etc/dovecot/conf.d/90-sieve.conf:rw",
        "/mnt/repo-base/config/mail/dovecot/90-quota.conf:/etc/dovecot/conf.d/90-quota.conf:rw",
        "/mnt/repo-base/config/mail/rspamd/ratelimit.conf:/etc/rspamd/local.d/ratelimit.conf:rw",
        "/mnt/repo-base/volumes/mail:/var/mail:rw",
        "/mnt/repo-base/config/mail/dovecot/10-mail.conf:/etc/dovecot/conf.d/10-mail.conf:rw"
      ],
      "ContainerIDFile": "",
      "LogConfig": {
        "Type": "json-file",
        "Config": {}
      },
      "NetworkMode": "repo-base_default",
      "PortBindings": {
        "110/tcp": [
          {
            "HostIp": "",
            "HostPort": "110"
          }
        ],
        "143/tcp": [
          {
            "HostIp": "",
            "HostPort": "143"
          }
        ],
        "25/tcp": [
          {
            "HostIp": "",
            "HostPort": "25"
          }
        ],
        "4190/tcp": [
          {
            "HostIp": "",
            "HostPort": "4190"
          }
        ],
        "587/tcp": [
          {
            "HostIp": "",
            "HostPort": "587"
          }
        ],
        "993/tcp": [
          {
            "HostIp": "",
            "HostPort": "993"
          }
        ],
        "995/tcp": [
          {
            "HostIp": "",
            "HostPort": "995"
          }
        ]
      },
      "RestartPolicy": {
        "Name": "always",
        "MaximumRetryCount": 0
      },
      "AutoRemove": false,
      "VolumeDriver": "",
      "VolumesFrom": [],
      "CapAdd": null,
      "CapDrop": null,
      "CgroupnsMode": "host",
      "Dns": [],
      "DnsOptions": [],
      "DnsSearch": [],
      "ExtraHosts": null,
      "GroupAdd": null,
      "IpcMode": "shareable",
      "Cgroup": "",
      "Links": null,
      "OomScoreAdj": 0,
      "PidMode": "",
      "Privileged": false,
      "PublishAllPorts": false,
      "ReadonlyRootfs": false,
      "SecurityOpt": null,
      "UTSMode": "",
      "UsernsMode": "",
      "ShmSize": 67108864,
      "Runtime": "runc",
      "ConsoleSize": [
        0,
        0
      ],
      "Isolation": "",
      "CpuShares": 0,
      "Memory": 0,
      "NanoCpus": 0,
      "CgroupParent": "",
      "BlkioWeight": 0,
      "BlkioWeightDevice": null,
      "BlkioDeviceReadBps": null,
      "BlkioDeviceWriteBps": null,
      "BlkioDeviceReadIOps": null,
      "BlkioDeviceWriteIOps": null,
      "CpuPeriod": 0,
      "CpuQuota": 0,
      "CpuRealtimePeriod": 0,
      "CpuRealtimeRuntime": 0,
      "CpusetCpus": "",
      "CpusetMems": "",
      "Devices": null,
      "DeviceCgroupRules": null,
      "DeviceRequests": null,
      "KernelMemory": 0,
      "KernelMemoryTCP": 0,
      "MemoryReservation": 0,
      "MemorySwap": 0,
      "MemorySwappiness": null,
      "OomKillDisable": false,
      "PidsLimit": null,
      "Ulimits": null,
      "CpuCount": 0,
      "CpuPercent": 0,
      "IOMaximumIOps": 0,
      "IOMaximumBandwidth": 0,
      "MaskedPaths": [
        "/proc/asound",
        "/proc/acpi",
        "/proc/kcore",
        "/proc/keys",
        "/proc/latency_stats",
        "/proc/timer_list",
        "/proc/timer_stats",
        "/proc/sched_debug",
        "/proc/scsi",
        "/sys/firmware"
      ],
      "ReadonlyPaths": [
        "/proc/bus",
        "/proc/fs",
        "/proc/irq",
        "/proc/sys",
        "/proc/sysrq-trigger"
      ]
    },
    "GraphDriver": {
      "Data": {
        "LowerDir": "/var/lib/docker/overlay2/...-init/diff:/var/lib/docker/overlay2/.../diff:/var/lib/docker/overlay2/.../diff:/var/lib/docker/overlay2/.../diff:/var/lib/docker/overlay2/.../diff:/var/lib/docker/overlay2/.../diff",
        "MergedDir": "/var/lib/docker/overlay2/.../merged",
        "UpperDir": "/var/lib/docker/overlay2/.../diff",
        "WorkDir": "/var/lib/docker/overlay2/.../work"
      },
      "Name": "overlay2"
    },
    "Mounts": [
      {
        "Type": "bind",
        "Source": "/mnt/repo-base/config/letsencrypt/certstore",
        "Destination": "/etc/letsencrypt",
        "Mode": "rw",
        "RW": true,
        "Propagation": "rprivate"
      },
      {
        "Type": "bind",
        "Source": "/mnt/repo-base/config/mail/rspamd/ratelimit.conf",
        "Destination": "/etc/rspamd/local.d/ratelimit.conf",
        "Mode": "rw",
        "RW": true,
        "Propagation": "rprivate"
      },
      {
        "Type": "bind",
        "Source": "/mnt/repo-base/config/mail/rspamd/whitelist.sender.domain.map",
        "Destination": "/etc/rspamd/local.d/whitelist.sender.domain.map",
        "Mode": "rw",
        "RW": true,
        "Propagation": "rprivate"
      },
      {
        "Type": "bind",
        "Source": "/mnt/repo-base/volumes/mail",
        "Destination": "/var/mail",
        "Mode": "rw",
        "RW": true,
        "Propagation": "rprivate"
      },
      {
        "Type": "bind",
        "Source": "/mnt/repo-base/config/mail/dovecot/10-mail.conf",
        "Destination": "/etc/dovecot/conf.d/10-mail.conf",
        "Mode": "rw",
        "RW": true,
        "Propagation": "rprivate"
      },
      {
        "Type": "bind",
        "Source": "/mnt/repo-base/config/mail/dovecot/90-quota.conf",
        "Destination": "/etc/dovecot/conf.d/90-quota.conf",
        "Mode": "rw",
        "RW": true,
        "Propagation": "rprivate"
      },
      {
        "Type": "bind",
        "Source": "/mnt/repo-base/config/mail/dovecot/90-sieve.conf",
        "Destination": "/etc/dovecot/conf.d/90-sieve.conf",
        "Mode": "rw",
        "RW": true,
        "Propagation": "rprivate"
      },
      {
        "Type": "bind",
        "Source": "/mnt/repo-base/config/mail/clamav/freshclam.conf",
        "Destination": "/etc/clamav/freshclam.conf",
        "Mode": "rw",
        "RW": true,
        "Propagation": "rprivate"
      },
      {
        "Type": "bind",
        "Source": "/mnt/repo-base/config/mail/rspamd/multimap.conf",
        "Destination": "/etc/rspamd/local.d/multimap.conf",
        "Mode": "rw",
        "RW": true,
        "Propagation": "rprivate"
      }
    ],
    "Config": {
      "Hostname": "mail",
      "Domainname": "domain.tld",
      "User": "",
      "AttachStdin": false,
      "AttachStdout": false,
      "AttachStderr": false,
      "ExposedPorts": {
        "110/tcp": {},
        "11334/tcp": {},
        "143/tcp": {},
        "25/tcp": {},
        "4190/tcp": {},
        "465/tcp": {},
        "587/tcp": {},
        "993/tcp": {},
        "995/tcp": {}
      },
      "Tty": false,
      "OpenStdin": false,
      "StdinOnce": false,
      "Env": [
        "DBPASS=...",
        "RSPAMD_PASSWORD=...",
        "ADD_DOMAINS=domain.tld",
        "ENABLE_POP3=false",
        "DISABLE_RATELIMITING=false",
        "RELAY_NETWORKS=172.16.0.0/12",
        "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
        "LC_ALL=C",
        "PYTHONUNBUFFERED=1"
      ],
      "Cmd": [
        "run.sh"
      ],
      "Image": "mailserver2/mailserver:1.1.4",
      "Volumes": {
        "/etc/clamav/freshclam.conf": {},
        "/etc/dovecot/conf.d/10-mail.conf": {},
        "/etc/dovecot/conf.d/90-quota.conf": {},
        "/etc/dovecot/conf.d/90-sieve.conf": {},
        "/etc/letsencrypt": {},
        "/etc/rspamd/local.d/multimap.conf": {},
        "/etc/rspamd/local.d/ratelimit.conf": {},
        "/etc/rspamd/local.d/whitelist.sender.domain.map": {},
        "/var/mail": {}
      },
      "WorkingDir": "",
      "Entrypoint": null,
      "OnBuild": null,
      "Labels": {
        "com.docker.compose.config-hash": "...",
        "com.docker.compose.container-number": "1",
        "com.docker.compose.oneoff": "False",
        "com.docker.compose.project": "repo-base",
        "com.docker.compose.project.config_files": "docker-compose.yml",
        "com.docker.compose.project.working_dir": "/mnt/repo-base",
        "com.docker.compose.service": "mailserver",
        "com.docker.compose.version": "1.25.0",
        "description": "Simple and full-featured mail server using Docker",
        "maintainer": "Hardware <contact@meshup.net>",
        "rspamd_version": "Rspamd v2.6 built from source",
        "s6_version": "s6 v2.9.2.0 built from source"
      }
    },
    "NetworkSettings": {
      "Bridge": "",
      "SandboxID": "...",
      "HairpinMode": false,
      "LinkLocalIPv6Address": "",
      "LinkLocalIPv6PrefixLen": 0,
      "Ports": {
        "110/tcp": [
          {
            "HostIp": "0.0.0.0",
            "HostPort": "110"
          },
          {
            "HostIp": "::",
            "HostPort": "110"
          }
        ],
        "11334/tcp": null,
        "143/tcp": [
          {
            "HostIp": "0.0.0.0",
            "HostPort": "143"
          },
          {
            "HostIp": "::",
            "HostPort": "143"
          }
        ],
        "25/tcp": [
          {
            "HostIp": "0.0.0.0",
            "HostPort": "25"
          },
          {
            "HostIp": "::",
            "HostPort": "25"
          }
        ],
        "4190/tcp": [
          {
            "HostIp": "0.0.0.0",
            "HostPort": "4190"
          },
          {
            "HostIp": "::",
            "HostPort": "4190"
          }
        ],
        "465/tcp": null,
        "587/tcp": [
          {
            "HostIp": "0.0.0.0",
            "HostPort": "587"
          },
          {
            "HostIp": "::",
            "HostPort": "587"
          }
        ],
        "993/tcp": [
          {
            "HostIp": "0.0.0.0",
            "HostPort": "993"
          },
          {
            "HostIp": "::",
            "HostPort": "993"
          }
        ],
        "995/tcp": [
          {
            "HostIp": "0.0.0.0",
            "HostPort": "995"
          },
          {
            "HostIp": "::",
            "HostPort": "995"
          }
        ]
      },
      "SandboxKey": "/var/run/docker/netns/...",
      "SecondaryIPAddresses": null,
      "SecondaryIPv6Addresses": null,
      "EndpointID": "",
      "Gateway": "",
      "GlobalIPv6Address": "",
      "GlobalIPv6PrefixLen": 0,
      "IPAddress": "",
      "IPPrefixLen": 0,
      "IPv6Gateway": "",
      "MacAddress": "",
      "Networks": {
        "repo-base_default": {
          "IPAMConfig": null,
          "Links": null,
          "Aliases": [
            "849645ccb7e9",
            "mailserver",
            "mail"
          ],
          "NetworkID": "...",
          "EndpointID": "...",
          "Gateway": "172.18.0.1",
          "IPAddress": "172.18.0.3",
          "IPPrefixLen": 16,
          "IPv6Gateway": "",
          "GlobalIPv6Address": "",
          "GlobalIPv6PrefixLen": 0,
          "MacAddress": "02:42:ac:12:00:03",
          "DriverOpts": null
        }
      }
    }
  }
]

The result of docker network inspect repo-base_default:

[
    {
        "Name": "repo-base_default",
        "Id": "ed001a50e9c094719cedcf686924b9172ce5e4e9cc56ed303e6c1b33875e2623",
        "Created": "2021-11-15T20:06:45.675085963Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": true,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "08846ce870d57efc6d367da72006565d0281be2ad68f80d25d65f7aeb3e4d4c4": {
                "Name": "nginx",
                "EndpointID": "d9c9c80ef20ffeaef9a81837ff8beda7fd535f75b4fc96754ba5e54d8a9043de",
                "MacAddress": "02:42:ac:12:00:05",
                "IPv4Address": "172.18.0.5/16",
                "IPv6Address": ""
            },
            "35104f668f5407a424417666f0dba58defd3721de95547add2d7aab8b3ffe599": {
                "Name": "welcome",
                "EndpointID": "c7d75448ceed8cbdc9e6fc99128838d16f6fab412b8890705136daa319b07b14",
                "MacAddress": "02:42:ac:12:00:07",
                "IPv4Address": "172.18.0.7/16",
                "IPv6Address": ""
            },
            "42da147d8cb4baf5c3b061fad90094f991f2804266a31898d391ec0a7a4c9324": {
                "Name": "redis",
                "EndpointID": "efc0700b253afdd1a49684e34f13231162c47a1ffd25a3850df9e37ae7262af0",
                "MacAddress": "02:42:ac:12:00:06",
                "IPv4Address": "172.18.0.6/16",
                "IPv6Address": ""
            },
            "67a6e387dcb0f2eed7f82d950bc432a5bda32d608323873d3316498ed3b523cb": {
                "Name": "mariadb",
                "EndpointID": "9711361f0cfa025012a0d5cb4481aad5eebe79c56a09dda337a18cfdb0556793",
                "MacAddress": "02:42:ac:12:00:09",
                "IPv4Address": "172.18.0.9/16",
                "IPv6Address": ""
            },
            "7c6bf0c86db4790ad59dd7032446ea7964da93b0390a9dabfc9d54e8f94e3992": {
                "Name": "automx",
                "EndpointID": "f07cb474c9d67bd16412c42ea75341bab6de60487682c1cb5f38ae1293fab87c",
                "MacAddress": "02:42:ac:12:00:04",
                "IPv4Address": "172.18.0.4/16",
                "IPv6Address": ""
            },
            "849645ccb7e993fcf29a438f80289bf51d483b0cb35d25f5db4c3a9482dc383c": {
                "Name": "mailserver",
                "EndpointID": "a8331aa476eabbcd2cca16cf27758b59fd2d00547874f6da9739ba93bf0e4938",
                "MacAddress": "02:42:ac:12:00:03",
                "IPv4Address": "172.18.0.3/16",
                "IPv6Address": ""
            },
            "c2bfcee2a9a63f4f5ab40ed160fdf60988204da63a45ffa4fb3cb875750688a3": {
                "Name": "postfixadmin",
                "EndpointID": "b7e015fb14fc22789adfd46a5bcfd51732496d33b19bee82a0d02b8dd8b58e4b",
                "MacAddress": "02:42:ac:12:00:02",
                "IPv4Address": "172.18.0.2/16",
                "IPv6Address": ""
            },
            "fbd9214c12cf9171d0e681f48b48b6ac56611173c25441479da6423b6db84fc5": {
                "Name": "nextcloud",
                "EndpointID": "b59acfa9e331354051ecc2bd59c68ccbf31f7fc7613000ae3a07f1cf71b522f2",
                "MacAddress": "02:42:ac:12:00:08",
                "IPv4Address": "172.18.0.8/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {
            "com.docker.compose.network": "default",
            "com.docker.compose.project": "repo-base",
            "com.docker.compose.version": "1.25.0"
        }
    }
]

At first glance, I don’t see anything weird.

Please allow me some time to compare finely and come back with further diagnostics.

I compared with my own server, couldn’t find any significant difference :frowning:

We may try to re-create the container from the original image (don’t worry, configuration & data will be kept) :

  • cd /mnt/repo-base
  • docker-compose -s rm mailserver <= this will stop mailserver, and remove container
  • docker image prune -a <= this will remove unused images (the mailserver one)
  • docker-compose -d up <= this will download the missing image (mailserver for instance), and fire up the missing container
  • docker-compose logs mailserver <= you may post back this, obfuscated, or send it to me privately if you prefer

A few words about Docker : you download images (kind of “templates”) and when you run them, Docker will create a container (run-able instance of the image). Container content may change, but not image.
That’s why we deleted the container, then the image (Docker won’t allow deleting the image when it has a container, of course).
A container may get some variables from host OS (the “environment” part), and some variable data may be stored outside the container, allowing then to be kept if the container is re-created (the “volumes” part).
As you have already seen, Docker has it’s own network, allowing container to talk without using the host’s network. If you want a container to be reachable from the outside, you have to explicitly describe it (the “ports” part).
Docker Compose comes on top of that, assembling several container (called “services” here) into a whole infrastructure.

1 Like

I forgot to mention : to send me a private message, click on my brainless avatar :smile_cat: then “Message”.
If you do that from this thread, message should have a appropriate subject.

Also, if you are interested in Docker commands, you can find the guide here : Reference documentation | Docker Documentation (command-line reference).

Whatever the problem was, removing the container and re-downloading it seemed to fix it!

Thank you, once again!

1 Like

Nice to read that ! :smile_cat:

You may also like to play with https://spam.yourdomain.tld and https://mail.yourdomain.tld :slight_smile:
If you forgot the credentials, just run /mnt/repo-base/scripts/show-info.sh.