wildduck 1.version

This commit is contained in:
Andreas Knuth 2025-06-05 17:21:51 -05:00
parent 991047d286
commit be85896404
3 changed files with 283 additions and 0 deletions

View File

@ -86,3 +86,104 @@ mailsync.bizmatch.net {
header_up CF-IPCountry {http.request.header.CF-IPCountry} 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 `<?xml version="1.0" encoding="utf-8"?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
<Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a">
<Account>
<AccountType>email</AccountType>
<Action>settings</Action>
<Protocol>
<Type>IMAP</Type>
<Server>mail.andreasknuth.de</Server>
<Port>993</Port>
<DomainRequired>off</DomainRequired>
<LoginName>{email}</LoginName>
<SPA>off</SPA>
<SSL>on</SSL>
<AuthRequired>on</AuthRequired>
</Protocol>
<Protocol>
<Type>SMTP</Type>
<Server>mail.andreasknuth.de</Server>
<Port>587</Port>
<DomainRequired>off</DomainRequired>
<LoginName>{email}</LoginName>
<SPA>off</SPA>
<Encryption>TLS</Encryption>
<AuthRequired>on</AuthRequired>
<UsePOPAuth>off</UsePOPAuth>
<SMTPLast>off</SMTPLast>
</Protocol>
</Account>
</Response>
</Autodiscover>`
}
# Autoconfig für Mozilla Thunderbird
autoconfig.andreasknuth.de {
header Content-Type "application/xml"
respond `<?xml version="1.0" encoding="UTF-8"?>
<clientConfig version="1.1">
<emailProvider id="andreasknuth.de">
<domain>andreasknuth.de</domain>
<displayName>Andreas Knuth Mail</displayName>
<displayShortName>AK Mail</displayShortName>
<incomingServer type="imap">
<hostname>mail.andreasknuth.de</hostname>
<port>993</port>
<socketType>SSL</socketType>
<authentication>password-cleartext</authentication>
<username>%EMAILADDRESS%</username>
</incomingServer>
<outgoingServer type="smtp">
<hostname>mail.andreasknuth.de</hostname>
<port>587</port>
<socketType>STARTTLS</socketType>
<authentication>password-cleartext</authentication>
<username>%EMAILADDRESS%</username>
</outgoingServer>
</emailProvider>
</clientConfig>`
}

View File

@ -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:

105
wildduck/wildduck.toml Normal file
View File

@ -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