diff --git a/caddy/Caddyfile b/caddy/Caddyfile index 6574deb..e115e78 100644 --- a/caddy/Caddyfile +++ b/caddy/Caddyfile @@ -85,4 +85,105 @@ mailsync.bizmatch.net { header_up X-Forwarded-Proto {http.request.header.X-Forwarded-Proto} header_up CF-IPCountry {http.request.header.CF-IPCountry} } +} + +# Ergänzung für Ihre bestehende Caddyfile +# Diese Blöcke zu Ihrer bestehenden Konfiguration hinzufügen: + +# Webmail Interface +mail.andreasknuth.de { + reverse_proxy wildduck-webmail:3000 + + header { + Strict-Transport-Security "max-age=31536000; includeSubDomains" + X-Content-Type-Options "nosniff" + X-Frame-Options "DENY" + X-XSS-Protection "1; mode=block" + Referrer-Policy "strict-origin-when-cross-origin" + -Server + } + + log { + output file /var/log/caddy/mail.andreasknuth.de.log + format json + } +} + +# API Endpoint (für Management) +api-mail.andreasknuth.de { + reverse_proxy wildduck-server:8080 + + header { + Strict-Transport-Security "max-age=31536000; includeSubDomains" + X-Content-Type-Options "nosniff" + X-Frame-Options "DENY" + } + + log { + output file /var/log/caddy/api-mail.andreasknuth.de.log + format json + } +} + +# Autodiscover für E-Mail-Clients +autodiscover.andreasknuth.de { + header Content-Type "application/xml" + respond ` + + + + email + settings + + IMAP + mail.andreasknuth.de + 993 + off + {email} + off + on + on + + + SMTP + mail.andreasknuth.de + 587 + off + {email} + off + TLS + on + off + off + + + +` +} + +# Autoconfig für Mozilla Thunderbird +autoconfig.andreasknuth.de { + header Content-Type "application/xml" + respond ` + + + andreasknuth.de + Andreas Knuth Mail + AK Mail + + mail.andreasknuth.de + 993 + SSL + password-cleartext + %EMAILADDRESS% + + + mail.andreasknuth.de + 587 + STARTTLS + password-cleartext + %EMAILADDRESS% + + +` } \ No newline at end of file diff --git a/wildduck/docker-compose.yml b/wildduck/docker-compose.yml new file mode 100644 index 0000000..1b5d31f --- /dev/null +++ b/wildduck/docker-compose.yml @@ -0,0 +1,77 @@ +services: + # MongoDB für WildDuck + mongo: + image: mongo:7.0 + container_name: wildduck-mongo + restart: unless-stopped + environment: + MONGO_INITDB_ROOT_USERNAME: wildduck + MONGO_INITDB_ROOT_PASSWORD: wildduck123 + volumes: + - mongodb_data:/data/db + - mongodb_config:/data/configdb + ports: + - "127.0.0.1:27017:27017" + networks: + - mail_network + + # Redis für WildDuck + redis: + image: redis:7.2-alpine + container_name: wildduck-redis + restart: unless-stopped + command: redis-server --appendonly yes + volumes: + - redis_data:/data + ports: + - "127.0.0.1:6379:6379" + networks: + - mail_network + + # WildDuck Mail Server + wildduck: + image: nodemailer/wildduck:latest + container_name: wildduck-server + restart: unless-stopped + depends_on: + - mongo + - redis + volumes: + - ./wildduck.toml:/wildduck/config/default.toml + - wildduck_mail:/wildduck/mail + - wildduck_attachments:/wildduck/attachments + ports: + - "127.0.0.1:8080:8080" # API + - "25:25" # SMTP + - "587:587" # SMTP Submission + - "993:993" # IMAPS + - "995:995" # POP3S + - "143:143" # IMAP + - "110:110" # POP3 + networks: + - mail_network + + # WildDuck Webmail Interface + wildduck-webmail: + image: nodemailer/wildduck-webmail:latest + container_name: wildduck-webmail + restart: unless-stopped + depends_on: + - wildduck + environment: + - WEBMAIL_HOST=mail.andreasknuth.de + - WILDDUCK_API=http://wildduck:8080 + ports: + - "127.0.0.1:4000:3000" + networks: + - mail_network + +networks: + mail_network: + external: true + +volumes: + mongodb_data: + redis_data: + wildduck_mail: + wildduck_attachments: \ No newline at end of file diff --git a/wildduck/wildduck.toml b/wildduck/wildduck.toml new file mode 100644 index 0000000..05f1887 --- /dev/null +++ b/wildduck/wildduck.toml @@ -0,0 +1,105 @@ +name = "WildDuck Mail Server" + +[api] +port = 8080 +host = "0.0.0.0" +secure = false + +[dbs] +# MongoDB Verbindung +mongodb = "mongodb://wildduck:wildduck123@mongo:27017/wildduck" +# Redis Verbindung +redis = "redis://redis:6379/2" +# Attachments in GridFS +gridfs = "mongodb://wildduck:wildduck123@mongo:27017/wildduck" + +[imap] +port = 143 +host = "0.0.0.0" +secure = false +# STARTTLS aktivieren +starttls = true + +[imaps] +port = 993 +host = "0.0.0.0" +secure = true + +[pop3] +port = 110 +host = "0.0.0.0" +secure = false +starttls = true + +[pop3s] +port = 995 +host = "0.0.0.0" +secure = true + +[smtp] +port = 25 +host = "0.0.0.0" +secure = false +starttls = true +# Authentifikation für ausgehende Mails +authMethods = ["PLAIN", "LOGIN"] + +[submission] +port = 587 +host = "0.0.0.0" +secure = false +starttls = true +# Submission Port erfordert immer Authentifikation +authRequired = true + +[attachments] +type = "gridstore" +bucket = "attachments" + +[log] +level = "info" +# Logausgabe in JSON Format für bessere Verarbeitung +json = true + +[emailDomain] +# Hauptdomain +default = "andreasknuth.de" + +[sender] +# Hostname für SMTP HELO/EHLO +name = "mail.andreasknuth.de" +# Bounce-Adresse +address = "mailer-daemon@andreasknuth.de" + +# Amazon SES Integration wird später hinzugefügt +[relay] +enabled = false + +[tls] +# TLS-Konfiguration für SMTP +ciphers = "ECDHE+AESGCM:ECDHE+CHACHA20:DHE+AESGCM:DHE+CHACHA20:!aNULL:!MD5:!DSS" +minVersion = "TLSv1.2" + +[limits] +# Maximale Anzahl gleichzeitiger Verbindungen +windowSize = 1000 +# Maximale Nachrichten pro Verbindung +rcptTo = 100 +# Maximale Größe einer Nachricht (25MB) +maxSize = 26214400 + +[tasks] +# Automatische Bereinigungsaufgaben +enabled = true +# Gelöschte Nachrichten nach 30 Tagen endgültig löschen +deleteAfter = 30 + +[webhooks] +# Webhook-URLs für Events (für Auto-Reply und Forwarding) +enabled = true + +[auditLog] +# Audit-Log für Compliance +enabled = true +# Aufbewahrungszeit für Audit-Logs (365 Tage) +retention = 365 \ No newline at end of file