docker-mailserver

https://hub.docker.com/r/mailserver/docker-mailserver
https://github.com/docker-mailserver/docker-mailserver/pkgs/container/docker-mailserver

操作简介
https://www.5axxw.com/wiki/content/pm5pn3
https://www.cnblogs.com/turingguo/p/15802479.html

version: "3.9"

services:
  mailserver:
    image: docker.io/mailserver/docker-mailserver:latest
    container_name: mailserver
    hostname: mail
    domainname: example.com
    ports:
      - "25:25"
      - "143:143"
      - "587:587"
      - "993:993"
    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
    environment:
      - ENABLE_SPAMASSASSIN=1
      - SPAMASSASSIN_SPAM_TO_INBOX=1
      - ENABLE_CLAMAV=1
      - ENABLE_FAIL2BAN=1
      - ENABLE_POSTGREY=1
      - ENABLE_SASLAUTHD=0
      - ONE_DIR=1
    cap_add:
      - NET_ADMIN
    restart: always

./setup.sh help
./setup.sh email list
./setup.sh email add lren@xxx.cn password
./setup.sh email del
./setup.sh email update