Autodiscovery for eM Client

It can be identified by its lack of user agent header. Through additional Protocol tags, it can also have CalDAV and CardDAV configured.
This commit is contained in:
Michael Kuron authored and Michael Kuron committed 2017-06-18 12:11:02 +02:00
1 parent 7b1eb71216
commit 646957efee
1 file changed
+16
+16
View File
@@ -33,6 +33,10 @@ if ($config['useEASforOutlook'] == 'no') {
}
}
if (!isset($_SERVER['HTTP_USER_AGENT']) || empty($_SERVER['HTTP_USER_AGENT'])) { // eM Client sends no user agent
$config['autodiscoverType'] = 'imap';
}
$dsn = "$database_type:host=$database_host;dbname=$database_name";
$opt = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
@@ -94,6 +98,18 @@ if (!isset($_SERVER['PHP_AUTH_USER']) OR $as !== "user") {
<UsePOPAuth>on</UsePOPAuth>
<SMTPLast>off</SMTPLast>
</Protocol>
<Protocol>
<Type>CalDAV</Type>
<Server>https://<?php echo $mailcow_hostname; ?>/SOGo/dav/<?php echo $email; ?>/Calendar</Server>
<DomainRequired>off</DomainRequired>
<LoginName><?php echo $email; ?></LoginName>
</Protocol>
<Protocol>
<Type>CardDAV</Type>
<Server>https://<?php echo $mailcow_hostname; ?>/SOGo/dav/<?php echo $email; ?>/Contacts</Server>
<DomainRequired>off</DomainRequired>
<LoginName><?php echo $email; ?></LoginName>
</Protocol>
</Account>
</Response>
<?php