跳到主要内容

动态IP建邮件服务

1 前述

在当前即时通讯如此发达的今天,电子邮件的功能并没有完全被替代,电子邮件的重要性和必要性主要体现在以下几个方面:

  1. 高效沟通:电子邮件可以快速、方便地发送给多个人,不受地域限制。与即时通讯相比,电子邮件更适合处理复杂的问题和需要长时间讨论的议题。

  2. 正式记录:电子邮件可以作为正式的书面记录,有助于保留证据和便于查阅。在商业、学术和其他领域,电子邮件已成为重要的沟通工具。

  3. 个性化定制:用户可以根据自己的需求设置电子邮件签名、模板等,使邮件更具个性化和专业性。

  4. 安全性:虽然电子邮件也存在安全风险,但通过使用加密技术、设置强密码等方式,可以有效保护个人信息和隐私。

  5. 跨平台兼容:电子邮件可以在各种设备和操作系统上使用,如电脑、手机、平板等,方便用户随时随地查看和回复邮件。

总之,电子邮件作为一种重要的沟通工具,具有高效、便捷、安全等特点,对于个人和企业来说都具有很高的价值。

很多企业,特别是初创企业,建议自己域名来建立自己的邮件系统是非常必要的。

本文件讲述如何在动态IP环境下创建邮件系统,主要有如下知识点。

  • 动态IP网络
  • 邮件所需的DNS记录
  • 邮件服务器创建

2 准备工作

  • 国际域名(很便宜,可在aliyun上申请)、动态域名(可采用花生壳,很多家用路由器都支持)。 Alt text

  • 可上网的网络、下沉性动态IP Alt text

    针对下沉性动态IP,有些ISP接入商不提供,可要求线路接入商将动态IP下沉到用户路由设备。

  • 可简单配置的路由器,可简单开放tcp端口,如邮件SMTP端口等。

  • 普通电脑,可安装docker。

以上几点很简单,除第1个外,其它3个家用环境wifi网格基本具备。

提示

需在fw上开放如下端口 110,25,143,587,8800

3 邮件服务器选型

邮件服务器软件非常多,不同的公司或项目都有其独特的需求和应用场景,选型的邮件服务器软件也所不同,还有一些公司使用人员有特定的选型偏好等。

简单介绍几个,如下几种基本上我都自己测试过和使用过,各有千秋,。

  • postfix
    Postfix 是一种 邮件传输代理(Mail Transfer Agent)(MTA),功能非常强大,。它本身可能不是一个独立的服务器,但它可以与其他一些解决方案配合使用来构建电子邮件服务器。准确地来说,postfix是一个SMTP核心,一个邮件架构,需整合其它组件才能使用。基于postfix的邮件系统有很多,如下几个。
    • mailcow
      mailcow是一个强大的邮件服务器套件,为您提供构建Web服务器和管理邮箱的工具。除了发送交易性电子邮件外,mailcow还可以作为团队协作工具来帮助您更好地进行组内沟通和合作。
      Mailcow是一个免费的开源基于Dovecot、Postfix、SOGo、Rspamd和其他开源软件的邮箱服务器套件,它为邮件管理提供了一个现代化的Web UI。可使用docker compose搭建。
    • Mailu
      Mailu 是一个使用docker compose搭建的轻量级标准邮件服务器,自带有垃圾邮件检测、病毒邮件检测。UI更符保中国习惯。但没有队列管理、日志查看等功能。用户端web支持Roundcubesnappymail,手机端和PC端、多语言等都能很好支持。
    • EwoMail
      EwoMail是由深圳智沃科技有限公司开发,有商业版和开源版,集成了众多优秀稳定的组件。用户端web采用开源Roundcube。 支持docker部署,各类服务集成中单一docker容器。
    • ExtMai
      广州领立斯网络科技有限公司采用perl开发,管理端和用户端都是该公司自主开发,开源版:web源码、ISO、docker三种。ExtMail是我早期学习postfix集成各类组件时最早接触的webmail,曾使用过它的早期开源版,它是非常优秀的wemail.
    • zimbra
      它定位于“办公协同软件”.
    • iredmail
      由中国公司开发,用户端web采用开源Roundcube
  • Postal
    Postal 是一个功能丰富的邮件服务器,可供网站和服务器使用。它专为出站邮件而设计,没有邮箱管理功能。
  • Haraka
    Haraka 是一个使用 Node.js 构建的现代开源 SMTP 服务器。如果你可以为你的业务/网站构建它,你就不需要寻找其他 SMTP 服务。araka 的一个亮点是,它具有模块化插件系统,允许程序员根据需要更改服务器的行为。
    其中poste.io是基于Haraka
  • Poste
    Poste是基于haraka而开发的一款小巧而精悍的邮件服务器,其功能非常丰富,收发信可靠,非常适合小微公司或初创公司。 支持docker部署,各类服务集成中单一docker容器。
  • Apache James
    James 是 “Java Apache Mail Enterprise Server” 的缩写。是一个使用 Java 构建的面向企业的开源邮件服务器。根据需求,你可以将该邮件服务器用作 SMTP 中继或 IMAP 服务器。
  • Win平台
    • Exchange,微软自己提供的邮箱系统,功能强大。
    • MDaemon,非常好的软件。
    • Lotus iNotes,IBM商业软件
    • winmail,国版商业软件
    • hmailserver,开源软件,后台帐号可采用LDAP、mysql等。

本文测试以Mailu为例,域名采用a-deploy.com、动态域名201zh900.zicp.vip

Mailu的部署非常简单,手机端和PC端、多语言等都能很好支持。

4 安装mailu

4.1 在线生成安装文档

采用 https://setup.mailu.io/ 在线生成安装文档,并提示完成安装。

4.1.1 版本选择

Alt text

4.1.2 初始化配置

关健配置

  • Mailu storage path: 邮件的存储目录
  • Main mail domain and server display name. 邮件服务软件MTA的名称,即负责接收和发送邮件的MTA软件的主机名称,它不是用户的邮件域名称,与用户的邮件域完全是两件事。 在发送邮件时,邮件header中会显示该名称。
  • Postmaster local part 管理员名称
  • TLS证书 对于证书的选译,如下
    • cert手工配置,只应用于https is the default and requires certificates to be setup manually;只对https。
    • letsencrypt自动配置,只应用于https will use the Letsencrypt! CA to generate automatic certificates;
    • mail手工配置,只应用于IMAPSMTP is similar to cert except that TLS will only be served for emails (IMAP and SMTP), not HTTP (use it behind reverse proxies);
    • mail-letsencrypt自动配置,只应用于IMAPSMTP is similar to letsencrypt except that TLS will only be served for emails (IMAP and SMTP), not HTTP (use it behind reverse proxies);
    • notls,不配置TLS will disable TLS, this is not recommended except for testing.

采用letsencrypt时,需要给 hostnames 指定的域名配置 AAAA DNS记录。

Alt text

4.1.3 额外功能

关键配置

  • Web email client 用户接收邮件时,web端采用什么软件,如:Roundcubesnappymail
  • 功能适配置 如杀毒等等

Alt text

4.1.4 暴露化配置

关键配置

  • 侦听地址 建立使用宿主IP,同时不建议使用IPv6
  • Public hostnames 即邮件服务器所在的主机名称,该名称是一个可解析的DNS。

Alt text

4.1.5 产生配置步骤

Alt text

按照上面的步骤安装即可。 产生的配置文件docker-compose.ymlmailu.env可修改。

4.2 安装

mkdir /opt/mailu
cd /opt/mailu
wget https://setup.mailu.io/master/file/4fd4c646-bad5-47a7-ae30-7d1c1c5c9df8/docker-compose.yml
wget https://setup.mailu.io/master/file/4fd4c646-bad5-47a7-ae30-7d1c1c5c9df8/mailu.env

# 配置文件 docker-compose.yml 和 mailu.env 修改,如修改端口。
# vi docker-compose.yml
...
ports: # 侦听IP,建议采用宿主的ip。
- "0.0.0.0:8080:80" # 8080 ---> 80
- "0.0.0.0:4438:443" # 4438 ---> 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"

# 拉取镜像
docker compose pull
# 启动服务
docker compose -p mailu up -d
# 创建管理员admin@a-deploy.com,密码为123321+Pp
docker compose -p mailu exec admin flask mailu admin admin a-deploy.com 123321+Pp

访问:
http://192.168.3.238:8080
输入密码后在此界面中选择是进入收发邮件的界面或是管理界面。

Alt text

为方便,通常要配置nginx代理。

4.3 nginx代理。

宿主安装nginx,代理mailu等,如下:

# cat /etc/nginx/conf.d/mailu.conf 
server {
listen 80;
listen [::]:80;
server_name mail.a-deploy.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name mail.a-deploy.com;

ssl_certificate ssl/web.pem;
ssl_certificate_key ssl/web-key.pem;
# See https://ssl-config.mozilla.org/#server=nginx for the latest ssl settings recommendations
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5:!SHA1:!kRSA;
ssl_prefer_server_ciphers off;
ssl_session_timeout 2h;
ssl_session_cache shared:mailu:8m;
ssl_session_tickets off;

proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

location / {
proxy_pass http://127.0.0.1:8080;
}

location ~* ^/(admin|api|sso|static|webdav|webmail|(apple\.)?mobileconfig|(\.well\-known/autoconfig/)?mail/|Autodiscover/Autodiscover) {
proxy_pass http://127.0.0.1:8080;
}
}

Alt text

4.4 日常维护命令

# docker compose images
CONTAINER REPOSITORY TAG IMAGE ID SIZE
mailu-admin-1 ghcr.io/mailu/admin master a045d560b5c0 246MB
mailu-antispam-1 ghcr.io/mailu/rspamd master c7733a36b921 295MB
mailu-antivirus-1 clamav/clamav-debian 1.2.0-6 7cd3be49466e 428MB
mailu-fetchmail-1 ghcr.io/mailu/fetchmail master 5f1cca2718df 240MB
mailu-front-1 ghcr.io/mailu/nginx master 1b5f97228c08 286MB
mailu-fts_attachments-1 ghcr.io/paperless-ngx/tika 2.9.0-full 956bde5d8ac2 700MB
mailu-imap-1 ghcr.io/mailu/dovecot master 7eb09892a1ac 307MB
mailu-oletools-1 ghcr.io/mailu/oletools master a7af772f67fe 243MB
mailu-redis-1 redis alpine d2d4688fcebe 41MB
mailu-resolver-1 ghcr.io/mailu/unbound master bbaf228de385 244MB
mailu-smtp-1 ghcr.io/mailu/postfix master 3934a2460259 245MB
mailu-webdav-1 ghcr.io/mailu/radicale master 627b8a497a67 234MB
mailu-webmail-1 ghcr.io/mailu/webmail master cd43038aedcc 522MB
# 更多
docker compose -p mailu stop
yes | docker compose -p mailu rm
docker network rm mailu_default
docker network rm mailu_noinet
docker network rm mailu_radicale
docker network rm mailu_webmail
docker compose -p mailu down --volumes
rm -fr {certs,data,dav,dkim,filter,mail,mailqueue,overrides,redis,webmail}

4.5 收发日志查看

如下日志是从外部邮箱发邮件组用户产生的,可以看出,已成功接收。

# cd /opt/mailu
# docker compose logs -f smtp
mailu-smtp-1 | Dec 14 10:03:09 mail postfix/smtpd[6852]: 8107412E2C54: client=n169-113.mail.139.com[120.232.169.113]
mailu-smtp-1 | Dec 14 10:03:09 mail postfix/cleanup[6857]: 8107412E2C54: message-id=<2b03657ad2d95db-00001.Richmail.00018519810621105671@139.com>
mailu-smtp-1 | Dec 14 10:03:15 mail postfix/qmgr[397]: 8107412E2C54: from=<SRS0=HCYq=HZ=139.com=guofs@mail.a-deploy.com>, size=5623, nrcpt=1 (queue active)
mailu-smtp-1 | Dec 14 10:03:15 mail postfix/smtpd[6852]: disconnect from n169-113.mail.139.com[120.232.169.113] ehlo=2 xclient=0/1 mail=1 rcpt=1 data=1 quit=1 commands=6/7
mailu-smtp-1 | Dec 14 10:03:16 mail postfix/lmtp[6858]: 8107412E2C54: to=<guofs@a-deploy.com>, relay=front[192.168.203.4]:2525, delay=6.8, delays=6.5/0.05/0.04/0.27, dsn=2.0.0, status=sent (250 2.0.0 <guofs@a-deploy.com> lGkjOuPSemXdHAAAax4V7A Saved)
mailu-smtp-1 | Dec 14 10:03:16 mail postfix/qmgr[397]: 8107412E2C54: removed

5 管理配置

5.1 邮件域添加

可以添加无限多的邮件域。 Alt text

5.2 用户添加

如下图,进入用户添加。 Alt text 添加用户 Alt text Alt text

5.3 邮件域DNS

mailu给出需添加的DNS记录,如下: Alt text 然后在域名注册商那里直接添加即可。 Alt text 在注册商配置如下: Alt text

5.4 反垃圾邮件

Alt text

6 用户端

6.1 PC端

Alt text 如下: Alt text

6.2 手机端

Alt text

7 邮件评分

垃圾邮件匹配度测试 https://www.mail-tester.com

Alt text

优化配置,可以得到更高评分。

8 API

mailu提供了丰富的接口,可集成到OA流中。 Alt text

9 mailu配置样例说明

mailu.env

TLS_FLAVOR配置说明如下

  • cert手工配置,只应用于https is the default and requires certificates to be setup manually;只对https。
  • letsencrypt自动配置,只应用于https will use the Letsencrypt! CA to generate automatic certificates;
  • mail手工配置,只应用于IMAPSMTP is similar to cert except that TLS will only be served for emails (IMAP and SMTP), not HTTP (use it behind reverse proxies);
  • mail-letsencrypt自动配置,只应用于IMAPSMTP is similar to letsencrypt except that TLS will only be served for emails (IMAP and SMTP), not HTTP (use it behind reverse proxies);
  • notls,不配置TLS will disable TLS, this is not recommended except for testing.

采用letsencrypt时,需要给 hostnames 指定的域名配置 AAAA DNS记录。

# Mailu main configuration file
#
# This file is autogenerated by the configuration management wizard for compose flavor.
# For a detailed list of configuration variables, see the documentation at
# https://mailu.io

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

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

# 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=mail.a-deploy.com

# Hostnames for this server, separated with commas
HOSTNAMES=mail.a-deploy.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=notls

# Authentication rate limit per IP (per /24 on ipv4 and /48 on ipv6)
AUTH_RATELIMIT_IP=5/hour

# Authentication rate limit per user (regardless of the source-IP)
AUTH_RATELIMIT_USER=50/day

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

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

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

# Choose which webmail to run if any (values: roundcube, snappymail, none). To enable this feature, recreate the docker-compose.yml file via setup.
WEBMAIL=roundcube

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

# Dav server implementation (value: radicale, none). To enable this feature, recreate the docker-compose.yml file via setup.
WEBDAV=radicale

# Antivirus solution (value: clamav, none). To enable this feature, recreate the docker-compose.yml file via setup.
ANTIVIRUS=clamav

# Scan Macros solution (value: true, false). To enable this feature, recreate the docker-compose.yml file via setup.
SCAN_MACROS=true

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

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

# Message rate limit (per user)
MESSAGE_RATELIMIT=200/day

# 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=

# Enable fetchmail
FETCHMAIL_ENABLED=true

# 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: gz, bz2, zstd)
COMPRESSION=
# change compression-level, default: 6 (value: 1-9)
COMPRESSION_LEVEL=

# IMAP full-text search is enabled by default.
# Set the following variable to off in order to disable the feature
# or a comma separated list of language codes to support
FULL_TEXT_SEARCH=en

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

# Path to redirect / to
WEBROOT_REDIRECT=/webmail

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

# Path to the webmail if enabled
WEB_WEBMAIL=/webmail

# Path to the API interface if enabled
WEB_API=/api

# Website name
SITENAME=MailServer

# Linked Website URL
WEBSITE=https://mail.a-deploy.com



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

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

# Number of rounds used by the password hashing scheme
CREDENTIAL_ROUNDS=12

# 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

# Timezone for the Mailu containers. See this link for all possible values https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
TZ=Etc/UTC

# Default spam threshold used for new users
DEFAULT_SPAM_THRESHOLD=80

# API token required for authenticating to the RESTful API.
# This is a mandatory setting for using the RESTful API.
API_TOKEN=X3AFGD8W427QP7YLYSVO47CWIINJ75UA

# Whether tika should be enabled (scan/OCR email attachements). To enable this feature, recreate the docker-compose.yml file via setup.
FULL_TEXT_SEARCH_ATTACHMENTS=true

docker-compose.yml

# This file is auto-generated by the Mailu configuration wizard.
# Please read the documentation before attempting any change.
# Generated for compose flavor

version: '2.2'

services:

# External dependencies
redis:
image: redis:alpine
restart: always
volumes:
- "/opt/mailu/redis:/data"
depends_on:
- resolver
dns:
- 192.168.203.254

# Core services
front:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}nginx:${MAILU_VERSION:-master}
restart: always
env_file: mailu.env
logging:
driver: journald
options:
tag: mailu-front
ports:
- "0.0.0.0:8080:80"
- "0.0.0.0:8443: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"
- "0.0.0.0:4190:4190"
networks:
- default
- webmail
- radicale
volumes:
- "/opt/mailu/certs:/certs"
- "/opt/mailu/overrides/nginx:/overrides:ro"
depends_on:
- resolver
dns:
- 192.168.203.254

resolver:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}unbound:${MAILU_VERSION:-master}
env_file: mailu.env
logging:
driver: journald
options:
tag: mailu-resolver
restart: always
networks:
default:
ipv4_address: 192.168.203.254

admin:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}admin:${MAILU_VERSION:-master}
restart: always
env_file: mailu.env
logging:
driver: journald
options:
tag: mailu-admin
volumes:
- "/opt/mailu/data:/data"
- "/opt/mailu/dkim:/dkim"
depends_on:
- redis
- resolver
dns:
- 192.168.203.254

imap:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}dovecot:${MAILU_VERSION:-master}
restart: always
env_file: mailu.env
logging:
driver: journald
options:
tag: mailu-imap
volumes:
- "/opt/mailu/mail:/mail"
- "/opt/mailu/overrides/dovecot:/overrides:ro"
networks:
- default
- fts_attachments
depends_on:
- front
- fts_attachments
- resolver
dns:
- 192.168.203.254

smtp:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}postfix:${MAILU_VERSION:-master}
restart: always
env_file: mailu.env
logging:
driver: journald
options:
tag: mailu-smtp
volumes:
- "/opt/mailu/mailqueue:/queue"
- "/opt/mailu/overrides/postfix:/overrides:ro"
depends_on:
- front
- resolver
dns:
- 192.168.203.254

oletools:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}oletools:${MAILU_VERSION:-master}
hostname: oletools
logging:
driver: journald
options:
tag: mailu-oletools
restart: always
networks:
- oletools
depends_on:
- resolver
dns:
- 192.168.203.254

fts_attachments:
image: ghcr.io/paperless-ngx/tika:2.9.0-full
hostname: tika
logging:
driver: journald
options:
tag: mailu-tika
restart: always
networks:
- fts_attachments
depends_on:
- resolver
dns:
- 192.168.203.254
healthcheck:
test: ["CMD-SHELL", "wget -nv -t1 -O /dev/null http://127.0.0.1:9998/tika || exit 1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s

antispam:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}rspamd:${MAILU_VERSION:-master}
hostname: antispam
restart: always
env_file: mailu.env
logging:
driver: journald
options:
tag: mailu-antispam
networks:
- default
- oletools
- clamav
volumes:
- "/opt/mailu/filter:/var/lib/rspamd"
- "/opt/mailu/overrides/rspamd:/overrides:ro"
depends_on:
- front
- redis
- oletools
- antivirus
- resolver
dns:
- 192.168.203.254

# Optional services
antivirus:
image: clamav/clamav-debian:1.2.0-6
restart: always
logging:
driver: journald
options:
tag: mailu-antivirus
networks:
- clamav
volumes:
- "/opt/mailu/filter/clamav:/var/lib/clamav"
healthcheck:
test: ["CMD-SHELL", "kill -0 `cat /tmp/clamd.pid` && kill -0 `cat /tmp/freshclam.pid`"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s

webdav:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}radicale:${MAILU_VERSION:-master}
restart: always
logging:
driver: journald
options:
tag: mailu-webdav
volumes:
- "/opt/mailu/dav:/data"
networks:
- radicale

fetchmail:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}fetchmail:${MAILU_VERSION:-master}
restart: always
env_file: mailu.env
logging:
driver: journald
options:
tag: mailu-fetchmail
volumes:
- "/opt/mailu/data/fetchmail:/data"
depends_on:
- admin
- smtp
- imap
- resolver
dns:
- 192.168.203.254

# Webmail
webmail:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}webmail:${MAILU_VERSION:-master}
restart: always
env_file: mailu.env
logging:
driver: journald
options:
tag: mailu-webmail
volumes:
- "/opt/mailu/webmail:/data"
- "/opt/mailu/overrides/roundcube:/overrides:ro"
networks:
- webmail
depends_on:
- front

networks:
default:
driver: bridge
ipam:
driver: default
config:
- subnet: 192.168.203.0/24
radicale:
driver: bridge
webmail:
driver: bridge
clamav:
driver: bridge
oletools:
driver: bridge
internal: true
fts_attachments:
driver: bridge
internal: true