添加 'mailserver'
This commit is contained in:
parent
419b46e3eb
commit
be24d95901
1 changed files with 40 additions and 0 deletions
40
mailserver
Normal file
40
mailserver
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
version: '2.1'
|
||||||
|
services:
|
||||||
|
mailserver:
|
||||||
|
image: docker.io/mailserver/docker-mailserver:latest
|
||||||
|
container_name: mailserver
|
||||||
|
# If the FQDN for your mail-server is only two labels (eg: example.com),
|
||||||
|
# you can assign this entirely to `hostname` and remove `domainname`.
|
||||||
|
hostname: mail
|
||||||
|
domainname: example.com
|
||||||
|
env_file: mailserver.env
|
||||||
|
# More information about the mail-server ports:
|
||||||
|
# https://docker-mailserver.github.io/docker-mailserver/edge/config/security/understanding-the-ports/
|
||||||
|
# To avoid conflicts with yaml base-60 float, DO NOT remove the quotation marks.
|
||||||
|
ports:
|
||||||
|
- "25:25" # SMTP (explicit TLS => STARTTLS)
|
||||||
|
- "143:143" # IMAP4 (explicit TLS => STARTTLS)
|
||||||
|
- "465:465" # ESMTP (implicit TLS)
|
||||||
|
- "587:587" # ESMTP (explicit TLS => STARTTLS)
|
||||||
|
- "993:993" # IMAP4 (implicit TLS)
|
||||||
|
volumes:
|
||||||
|
- ./dms/mail-data/:/var/mail/
|
||||||
|
- ./dms/mail-state/:/var/mail-state/
|
||||||
|
- ./dms/mail-logs/:/var/log/mail/
|
||||||
|
- ./dms/config/:/tmp/docker-mailserver/
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
- ./ssl:/tmp/ssl:ro #在mailserver.env 指定ssl证书路径
|
||||||
|
restart: always
|
||||||
|
stop_grace_period: 1m
|
||||||
|
cap_add:
|
||||||
|
- NET_ADMIN
|
||||||
|
healthcheck:
|
||||||
|
test: "ss --listening --tcp | grep -P 'LISTEN.+:smtp' || exit 1"
|
||||||
|
timeout: 3s
|
||||||
|
retries: 0
|
||||||
|
|
||||||
|
|
||||||
|
# https://github.com/docker-mailserver/docker-mailserver/raw/master/setup.sh
|
||||||
|
./setup.sh email add username@example "xxx"
|
||||||
|
./setup.sh config dkim keysize 2048
|
||||||
|
cat config/opendkim/keys/example.com/mail.txt
|
||||||
Loading…
Add table
Add a link
Reference in a new issue