From 509fd1e8fd6a27bfd8e666ff41c0d553cfa24acd Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Wed, 19 Apr 2023 19:17:57 +0900 Subject: [PATCH] add mox --- compose.yml | 26 +++++++++++++++++++++++++ etc/caddy/Caddyfile | 1 + etc/mox/config/domains.conf | 38 +++++++++++++++++++++++++++++++++++++ etc/mox/config/mox.conf | 36 +++++++++++++++++++++++++++++++++++ 4 files changed, 101 insertions(+) create mode 100644 etc/mox/config/domains.conf create mode 100644 etc/mox/config/mox.conf diff --git a/compose.yml b/compose.yml index d69fa36..f1fb1c1 100644 --- a/compose.yml +++ b/compose.yml @@ -14,6 +14,8 @@ services: - caddy_config:/config networks: - fogtype + extra_hosts: + - "host.docker.internal:host-gateway" dns: image: coredns/coredns:1.10.1@sha256:a0ead06651cf580044aeb0a0feba63591858fb2e43ade8c9dea45a6a89ae7e5e restart: unless-stopped @@ -62,11 +64,35 @@ services: restart: unless-stopped networks: - fogtype + mox: + image: r.xmox.nl/mox:latest + restart: on-failure + network_mode: host + user: "1000:1000" + environment: + MOX_DOCKER: "yes" + volumes: + - caddy_data:/var/lib/caddy/data:ro + - mox_data:/mox/data + - mox_config:/mox/config + - type: bind + source: ./etc/mox/config/mox.conf + target: /mox/config/mox.conf + - type: bind + source: ./etc/mox/config/domains.conf + target: /mox/config/domains.conf + healthcheck: + test: "netstat -nlt | grep ':25 '" + interval: "1s" + timeout: "1s" + retries: 10 volumes: caddy_data: caddy_config: gotosocial_data: vikunja_data: + mox_data: + mox_config: networks: fogtype: ipam: diff --git a/etc/caddy/Caddyfile b/etc/caddy/Caddyfile index 5aa121d..a37abfe 100644 --- a/etc/caddy/Caddyfile +++ b/etc/caddy/Caddyfile @@ -9,6 +9,7 @@ fogtype.com { header access-control-allow-origin * file_server } + reverse_proxy /.well-known/mta-sts.txt host.docker.internal:8081 reverse_proxy http://gts:8080 } www.fogtype.com { diff --git a/etc/mox/config/domains.conf b/etc/mox/config/domains.conf new file mode 100644 index 0000000..9edc15b --- /dev/null +++ b/etc/mox/config/domains.conf @@ -0,0 +1,38 @@ +Domains: + fogtype.com: + LocalpartCatchallSeparator: "+" + DKIM: + Selectors: + Sign: [] + DMARC: + Localpart: dmarc-reports + Account: nebel + Mailbox: DMARC + MTASTS: + PolicyID: "20230420T000000" + Mode: enforce + MaxAge: "24h" + TLSRPT: + Localpart: tls-reports + Account: nebel + Mailbox: TLSRPT +Accounts: + nebel: + Domain: fogtype.com + Destinations: + nebel: + SubjectPass: + Period: "12h" + RejectsMailbox: Rejects + AutomaticJunkFlags: + Enabled: true + JunkMailboxRegexp: "^(junk|spam)" + NeutralMailboxRegexp: "^(inbox|neutral|postmaster|dmarc|tlsrpt|rejects)" + JunkFilter: + Threshold: "0.95" + Params: + Onegrams: true + MaxPower: "0.01" + TopWords: 10 + IgnoreWords: "0.1" + RareWords: 2 diff --git a/etc/mox/config/mox.conf b/etc/mox/config/mox.conf new file mode 100644 index 0000000..535774f --- /dev/null +++ b/etc/mox/config/mox.conf @@ -0,0 +1,36 @@ +DataDir: ../data +LogLevel: info +User: 1000 +Hostname: fogtype.com +CheckUpdates: true +AdminPasswordFile: adminpasswd +Listeners: + internal: + IPs: + - "127.0.0.1" + AccountHTTP: + Enabled: true + AdminHTTP: + Enabled: true + MetricsHTTP: + Enabled: true + MTASTSHTTPS: + Enabled: true + Port: 8081 + NonTLS: true + public: + IPs: + - "::" + TLS: + KeyCerts: + - CertFile: /var/lib/caddy/data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/fogtype.com/fogtype.com.crt + KeyFile: /var/lib/caddy/data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/fogtype.com/fogtype.com.key + SMTP: + Enabled: true + Submissions: + Enabled: true + IMAPS: + Enabled: true +Postmaster: + Account: nebel + Mailbox: Postmaster