docker/caddy/email_autodiscover

86 lines
2.8 KiB
Plaintext

# ------------------------------------------------------------------
# E-Mail Autodiscover Configuration
# Covers: Outlook (XML & JSON), Thunderbird (Mozilla XML), and generic clients
# ------------------------------------------------------------------
# 1. Autodiscover für Outlook & Mobile Clients (Microsoft Standard)
# ------------------------------------------------------------------
autodiscover.bayarea-cc.com, autodiscover.bizmatch.net {
# JSON Route (für moderne Outlook Clients / Mobile)
route /autodiscover/autodiscover.json {
header Content-Type "application/json"
respond `{
"Protocol": "AutodiscoverV1",
"Url": "https://{host}/autodiscover/autodiscover.xml"
}` 200
}
# XML Route (Klassisch Outlook)
route /autodiscover/autodiscover.xml {
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.email-srvr.com</Server>
<Port>993</Port>
<SSL>on</SSL>
<AuthRequired>on</AuthRequired>
<SPA>off</SPA>
</Protocol>
<Protocol>
<Type>SMTP</Type>
<Server>mail.email-srvr.com</Server>
<Port>465</Port>
<SSL>on</SSL>
<AuthRequired>on</AuthRequired>
<SPA>off</SPA>
</Protocol>
</Account>
</Response>
</Autodiscover>` 200
}
# Fallback für Browser-Tests
route / {
respond "Autodiscover Service for Outlook is running." 200
}
}
# 2. Autoconfig für Thunderbird (Mozilla Standard)
# ------------------------------------------------------------------
autoconfig.bayarea-cc.com, autoconfig.bizmatch.net {
route /mail/config-v1.1.xml {
header Content-Type "application/xml"
respond `<?xml version="1.0"?>
<clientConfig version="1.1">
<emailProvider id="email-srvr.com">
<displayName>Rackspace Email</displayName>
<incomingServer type="imap">
<hostname>mail.email-srvr.com</hostname>
<port>993</port>
<socketType>SSL</socketType>
<authentication>password-cleartext</authentication>
<username>%EMAILADDRESS%</username>
</incomingServer>
<outgoingServer type="smtp">
<hostname>mail.email-srvr.com</hostname>
<port>587</port>
<socketType>STARTTLS</socketType>
<authentication>password-cleartext</authentication>
<username>%EMAILADDRESS%</username>
</outgoingServer>
</emailProvider>
</clientConfig>` 200
}
# Fallback
route / {
respond "Autoconfig Service for Thunderbird is running." 200
}
}