feat(email): 初始化自建邮箱 MVP
- 新增 Go + SQLite 后端,支持登录、域名、邮箱、别名、联系人、规则、统计与邮件收发。 - 新增 Webmail 前端,支持多邮箱切换、邮件列表/阅读/写信、附件、搜索、主题切换与个人中心。 - 新增 Docker Compose 部署骨架,补充 Postfix、Dovecot、OpenDKIM、Nginx 配置与部署说明。
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
FROM debian:bookworm-slim
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends opendkim opendkim-tools sqlite3 ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||
COPY opendkim.conf /etc/opendkim.conf
|
||||
COPY TrustedHosts /etc/opendkim/TrustedHosts
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
EXPOSE 8891
|
||||
CMD ["/entrypoint.sh"]
|
||||
@@ -0,0 +1,5 @@
|
||||
127.0.0.1
|
||||
localhost
|
||||
10.0.0.0/8
|
||||
172.16.0.0/12
|
||||
192.168.0.0/16
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
mkdir -p /etc/opendkim/keys
|
||||
: > /etc/opendkim/KeyTable
|
||||
: > /etc/opendkim/SigningTable
|
||||
if [ -f /data/lanqin.db ]; then
|
||||
sqlite3 -separator '|' /data/lanqin.db "SELECT name, dkim_selector, dkim_private_key FROM domains WHERE status='active';" | while IFS='|' read -r domain selector private_key; do
|
||||
[ -n "$domain" ] || continue
|
||||
dir="/etc/opendkim/keys/$domain"
|
||||
mkdir -p "$dir"
|
||||
keyfile="$dir/$selector.private"
|
||||
printf '%s' "$private_key" | base64 -d > "$keyfile"
|
||||
chmod 600 "$keyfile"
|
||||
echo "$selector._domainkey.$domain $domain:$selector:$keyfile" >> /etc/opendkim/KeyTable
|
||||
echo "*@${domain} ${selector}._domainkey.${domain}" >> /etc/opendkim/SigningTable
|
||||
done
|
||||
fi
|
||||
chown -R opendkim:opendkim /etc/opendkim
|
||||
exec opendkim -f -x /etc/opendkim.conf
|
||||
@@ -0,0 +1,12 @@
|
||||
Syslog yes
|
||||
UMask 002
|
||||
Mode sv
|
||||
Canonicalization relaxed/simple
|
||||
SubDomains no
|
||||
OversignHeaders From
|
||||
Socket inet:8891@0.0.0.0
|
||||
UserID opendkim:opendkim
|
||||
KeyTable /etc/opendkim/KeyTable
|
||||
SigningTable refile:/etc/opendkim/SigningTable
|
||||
ExternalIgnoreList /etc/opendkim/TrustedHosts
|
||||
InternalHosts /etc/opendkim/TrustedHosts
|
||||
Reference in New Issue
Block a user