switch back
This commit is contained in:
parent
27f929dfbc
commit
4d3ca7bb14
|
|
@ -1,39 +1,59 @@
|
||||||
(email_settings) {
|
(email_settings) {
|
||||||
# ---------------------------------------------------------
|
# 1. Autodiscover für Outlook
|
||||||
# 1. Autodiscover für Outlook & Android (Samsung)
|
|
||||||
# ---------------------------------------------------------
|
|
||||||
# Ersetzt den alten "respond"-Block durch die Datei-Lösung
|
|
||||||
route /autodiscover/autodiscover.xml {
|
route /autodiscover/autodiscover.xml {
|
||||||
# Wir setzen das Root auf deinen Setup-Ordner
|
|
||||||
root * /var/www/email-setup
|
|
||||||
|
|
||||||
# Da die URL "/autodiscover/autodiscover.xml" ist, die Datei aber
|
|
||||||
# direkt im Ordner liegt, schreiben wir den Pfad intern um:
|
|
||||||
rewrite * /autodiscover.xml
|
|
||||||
|
|
||||||
# Wichtig: Header setzen, damit Clients es als XML erkennen
|
|
||||||
header Content-Type "application/xml"
|
header Content-Type "application/xml"
|
||||||
|
# Wir nutzen {header.X-Anchormailbox} um die Email dynamisch einzufügen
|
||||||
# Datei ausliefern
|
respond `<?xml version="1.0" encoding="utf-8"?>
|
||||||
file_server
|
<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.email-srvr.com</Server>
|
||||||
|
<Port>993</Port>
|
||||||
|
<DomainRequired>on</DomainRequired>
|
||||||
|
<LoginName>{header.X-Anchormailbox}</LoginName>
|
||||||
|
<SPA>off</SPA>
|
||||||
|
<SSL>on</SSL>
|
||||||
|
<AuthRequired>on</AuthRequired>
|
||||||
|
</Protocol>
|
||||||
|
<Protocol>
|
||||||
|
<Type>POP3</Type>
|
||||||
|
<Server>mail.email-srvr.com</Server>
|
||||||
|
<Port>995</Port>
|
||||||
|
<DomainRequired>on</DomainRequired>
|
||||||
|
<LoginName>{header.X-Anchormailbox}</LoginName>
|
||||||
|
<SPA>off</SPA>
|
||||||
|
<SSL>on</SSL>
|
||||||
|
<AuthRequired>on</AuthRequired>
|
||||||
|
</Protocol>
|
||||||
|
<Protocol>
|
||||||
|
<Type>SMTP</Type>
|
||||||
|
<Server>mail.email-srvr.com</Server>
|
||||||
|
<Port>465</Port>
|
||||||
|
<DomainRequired>on</DomainRequired>
|
||||||
|
<LoginName>{header.X-Anchormailbox}</LoginName>
|
||||||
|
<SPA>off</SPA>
|
||||||
|
<SSL>on</SSL>
|
||||||
|
<AuthRequired>on</AuthRequired>
|
||||||
|
</Protocol>
|
||||||
|
</Account>
|
||||||
|
</Response>
|
||||||
|
</Autodiscover>` 200
|
||||||
}
|
}
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# 2. JSON Autodiscover (Modern Outlook) - bleibt gleich
|
||||||
# 2. JSON Autodiscover (Modern Outlook)
|
|
||||||
# ---------------------------------------------------------
|
|
||||||
route /autodiscover/autodiscover.json {
|
route /autodiscover/autodiscover.json {
|
||||||
header Content-Type "application/json"
|
header Content-Type "application/json"
|
||||||
# Hinweis: Hier hardcoden wir eine Domain, das ist okay,
|
|
||||||
# solange das Zertifikat für autodiscover.bayarea-cc.com gilt.
|
|
||||||
respond `{
|
respond `{
|
||||||
"Protocol": "AutodiscoverV1",
|
"Protocol": "AutodiscoverV1",
|
||||||
"Url": "https://autodiscover.bayarea-cc.com/autodiscover/autodiscover.xml"
|
"Url": "https://autodiscover.bayarea-cc.com/autodiscover/autodiscover.xml"
|
||||||
}` 200
|
}` 200
|
||||||
}
|
}
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# 3. Thunderbird Autoconfig - bleibt gleich (dort funktioniert %EMAILADDRESS% ja nativ)
|
||||||
# 3. Thunderbird Autoconfig
|
|
||||||
# ---------------------------------------------------------
|
|
||||||
route /mail/config-v1.1.xml {
|
route /mail/config-v1.1.xml {
|
||||||
header Content-Type "application/xml"
|
header Content-Type "application/xml"
|
||||||
respond `<?xml version="1.0"?>
|
respond `<?xml version="1.0"?>
|
||||||
|
|
@ -58,16 +78,18 @@
|
||||||
</clientConfig>` 200
|
</clientConfig>` 200
|
||||||
}
|
}
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# NEU: Apple MobileConfig Route
|
||||||
# 4. Apple MobileConfig
|
# Aufrufbar über: /apple?email=kunde@domain.de
|
||||||
# ---------------------------------------------------------
|
|
||||||
route /apple {
|
route /apple {
|
||||||
|
# KORREKTUR: Wir müssen Caddy sagen, dass er diesen MIME-Type bearbeiten soll!
|
||||||
templates {
|
templates {
|
||||||
mime "application/x-apple-aspen-config"
|
mime "application/x-apple-aspen-config"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Den richtigen MIME-Type setzen
|
||||||
header Content-Type "application/x-apple-aspen-config; charset=utf-8"
|
header Content-Type "application/x-apple-aspen-config; charset=utf-8"
|
||||||
|
|
||||||
# Hier zeigen wir auf den Config-Ordner für das Template
|
# Pfad zur Datei im Container
|
||||||
root * /etc/caddy
|
root * /etc/caddy
|
||||||
rewrite * /email.mobileconfig.tpl
|
rewrite * /email.mobileconfig.tpl
|
||||||
file_server
|
file_server
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue