测试应用 邮件服务器

Signed-off-by: 萌森 <qyg2297248353@163.com>
This commit is contained in:
2024-07-26 17:26:38 +08:00
parent 57b03ec45e
commit f27b7f569a
12 changed files with 315 additions and 78 deletions
+136
View File
@@ -0,0 +1,136 @@
additionalProperties:
formFields:
- default: "/home/bark"
edit: true
envKey: MAILSERVER_ROOT_PATH
labelZh: 数据持久化路径
labelEn: Data persistence path
required: true
type: text
- default: 25
edit: true
envKey: PANEL_APP_PORT_SMTP
labelZh: SMTP 端口 (保持默认)
labelEn: SMTP Port (keep default)
required: true
rule: paramPort
type: number
- default: 143
edit: true
envKey: PANEL_APP_PORT_IMAP
labelZh: IMAP 端口 (保持默认)
labelEn: IMAP Port (keep default)
required: true
rule: paramPort
type: number
- default: 465
edit: true
envKey: PANEL_APP_PORT_SMTPS
labelZh: SMTP SSL 端口 (保持默认)
labelEn: SMTP SSL Port (keep default)
required: true
rule: paramPort
type: number
- default: 587
edit: true
envKey: PANEL_APP_PORT_ESMTP
labelZh: SMTP 提交端口 (保持默认)
labelEn: SMTP Submission Port (keep default)
required: true
rule: paramPort
type: number
- default: 993
edit: true
envKey: PANEL_APP_PORT_IPAPS
labelZh: IMAP SSL 端口 (保持默认)
labelEn: IMAP SSL Port (keep default)
required: true
rule: paramPort
type: number
- default: 0
edit: true
envKey: ENABLE_POP3
labelZh: 启用 POP3
labelEn: Enable POP3
required: true
type: select
values:
- label: 启用
value: 1
- label: 禁用
value: 0
- default: 110
edit: true
envKey: PANEL_APP_PORT_POP
labelZh: POP3 端口 (保持默认)
labelEn: POP3 Port (keep default)
required: false
rule: paramPort
type: number
- default: 995
edit: true
envKey: PANEL_APP_PORT_POPS
labelZh: POP3 SSL 端口 (保持默认)
labelEn: POP3 SSL Port (keep default)
required: false
rule: paramPort
type: number
- default: "postmaster@domain.com"
edit: true
envKey: POSTMASTER_ADDRESS
labelZh: 管理员邮箱地址
labelEn: Postmaster email address
required: true
type: text
- default: 0
edit: true
envKey: ENABLE_AMAVIS
labelZh: 内容过滤器 (Amavis支持)
labelEn: Content filter (Amavis support)
required: true
type: select
values:
- label: 启用
value: 1
- label: 禁用
value: 0
- default: 0
edit: true
envKey: ENABLE_CLAMAV
labelZh: 邮件病毒扫描 (ClamAV支持)
labelEn: Mail virus scanning (ClamAV support)
required: true
type: select
values:
- label: 启用
value: 1
- label: 禁用
value: 0
- default: "manual"
edit: true
envKey: SSL_TYPE
labelZh: SSL 证书类型
labelEn: SSL certificate type
required: true
type: select
values:
- label: Let's Encrypt
value: "letsencrypt"
- label: 本地证书
value: "manual"
- label: 禁用 SSL
value: ""
- default: "public.crt"
edit: true
envKey: CERTS_PUBLIC_CRT
labelZh: SSL Public 证书文件名
labelEn: SSL Public certificate file name
required: false
type: text
- default: "private.key"
edit: true
envKey: CERTS_PRIVATE_KEY
labelZh: SSL Private 证书文件名
labelEn: SSL Private certificate file name
required: false
type: text
+48
View File
@@ -0,0 +1,48 @@
version: "3.8"
networks:
1panel-network:
external: true
services:
mailserver:
image: mailserver/docker-mailserver:14.0.0
container_name: ${CONTAINER_NAME}
labels:
createdBy: "Apps"
restart: always
networks:
- 1panel-network
stop_grace_period: 1m
hostname: ${HOSTNAME_FQDN}
ports:
- ${PANEL_APP_PORT_SMTP}:25
- ${PANEL_APP_PORT_IMAP}:143
- ${PANEL_APP_PORT_SMTPS}:465
- ${PANEL_APP_PORT_ESMTP}:587
- ${PANEL_APP_PORT_IPAPS}:993
- ${PANEL_APP_PORT_POP:-}:110
- ${PANEL_APP_PORT_POPS:-}:995
env_file:
- /etc/1panel/envs/global.env
- /etc/1panel/envs/mailserver/mailserver.env
- ${ENV_FILE:-/etc/1panel/envs/default.env}
volumes:
- /etc/localtime:/etc/localtime:ro
- ${MAILSERVER_ROOT_PATH}/dms/mail-data/:/var/mail/
- ${MAILSERVER_ROOT_PATH}/dms/mail-state/:/var/mail-state/
- ${MAILSERVER_ROOT_PATH}/dms/mail-logs/:/var/log/mail/
- ${MAILSERVER_ROOT_PATH}/dms/config/:/tmp/docker-mailserver/
- ${MAILSERVER_ROOT_PATH}/certs/:/tmp/dms/certs/
- ${MAILSERVER_ROOT_PATH}/dms-backups/:/backup/
environment:
- LOG_LEVEL=info
- SUPERVISOR_LOGLEVEL=info
- ACCOUNT_PROVISIONER=FILE
- SSL_CERT_PATH=/tmp/dms/certs/${CERTS_PUBLIC_CRT:-public.crt}
- SSL_KEY_PATH=/tmp/dms/certs/${CERTS_PRIVATE_KEY:-private.key}
- SPOOF_PROTECTION=1
healthcheck:
test: "ss --listening --tcp | grep -P 'LISTEN.+:smtp' || exit 1"
timeout: 3s
retries: 0
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
if [ -f .env ]; then
source .env
# setup-1 add default values
CURRENT_DIR=$(pwd)
sed -i '/^ENV_FILE=/d' .env
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
echo "Check Finish."
else
echo "Error: .env file not found."
fi
@@ -0,0 +1,10 @@
#!/bin/bash
if [ -f .env ]; then
source .env
echo "Check Finish."
else
echo "Error: .env file not found."
fi
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
if [ -f .env ]; then
source .env
# setup-1 add default values
CURRENT_DIR=$(pwd)
sed -i '/^ENV_FILE=/d' .env
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
echo "Check Finish."
else
echo "Error: .env file not found."
fi