docker-compose.yml

version: "3.5"
services:
  maddy:
    image: foxcpp/maddy:latest
    restart: unless-stopped
    ports:
      - "25:25"
      - "143:143"
      - "465:465"
      - "587:587"
      - "993:993"
    volumes:
      - ./maddydata:/data
    environment:
        # REPLACE DOMAINS WITH YOURS
      - MADDY_HOSTNAME=mx.example.com
      - MADDY_DOMAIN=example.com
    
  snappymail:
    image: ajanvier/snappymail
    volumes:
      - ./snappymail/data:/snappymail/data
    depends_on:
      - maddy
    ports:
      - "80:8888"

maddy.conf

下载 https://github.com/foxcpp/maddy/raw/master/maddy.conf.docker
放入maddydata文件夹改名maddy.conf

maddy SSL 证书

maddydata/tls/fullchain.pem
maddydata/tls/privkey.pem

dkim 记录

域名添加txt 记录 default._domainkey
复制 maddydata/dkim/example.com_default.dns 填入

添加账户

docker-compose exec maddy maddyctl creds create foxcpp@maddy.test
docker-compose exec maddy maddyctl imap-acct create foxcpp@maddy.test

snappymail 配置

mx.example.com/?admin 打开管理面板 用户admin 密码在snappymail/data/_data_/_default_/
snappymail 后台添加域名,设置主机地址为maddy IMAP端口993 SMTP 587

自定义nginx配置

nginx.conf https://github.com/ajanvier/docker-snappymail/blob/master/rootfs/etc/nginx/nginx.conf

已知问题

snappymail 收到新邮件无法查看,是个bug,推荐使用桌面客户端

内存占用真的很少,当然是没有垃圾邮件和病毒防护的
Screenshot_20230301_220246.png

Read More