(email_settings) { # 1. Autodiscover für Outlook route /autodiscover/autodiscover.xml { header Content-Type "application/xml" # Wir nutzen {header.X-Anchormailbox} um die Email dynamisch einzufügen respond ` email settings IMAP mail.email-srvr.com 993 on {header.X-Anchormailbox} off on on POP3 mail.email-srvr.com 995 on {header.X-Anchormailbox} off on on SMTP mail.email-srvr.com 465 on {header.X-Anchormailbox} off on on ` 200 } # 2. JSON Autodiscover (Modern Outlook) - bleibt gleich route /autodiscover/autodiscover.json { header Content-Type "application/json" respond `{ "Protocol": "AutodiscoverV1", "Url": "https://autodiscover.bayarea-cc.com/autodiscover/autodiscover.xml" }` 200 } # 3. Thunderbird Autoconfig - bleibt gleich (dort funktioniert %EMAILADDRESS% ja nativ) route /mail/config-v1.1.xml { header Content-Type "application/xml" respond ` Rackspace Email mail.email-srvr.com 993 SSL password-cleartext %EMAILADDRESS% mail.email-srvr.com 465 SSL password-cleartext %EMAILADDRESS% ` 200 } # NEU: Apple MobileConfig Route # Aufrufbar über: /apple?email=kunde@domain.de route /apple { # Wichtig: Templates aktivieren, damit Caddy die Platzhalter ersetzt templates # Den richtigen MIME-Type setzen, damit das iPhone es als Profil erkennt header Content-Type "application/x-apple-aspen-config; charset=utf-8" # Die Datei ausgeben (Pfad ggf. anpassen!) # Wenn die .tpl Datei im selben Ordner wie das Caddyfile liegt: rewrite * /email.mobileconfig.tpl file_server } }