Kaynağa Gözat

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.
Michael Kuron 8 yıl önce
ebeveyn
işleme
646957efee
1 değiştirilmiş dosya ile 16 ekleme ve 0 silme
  1. 16 0
      data/web/autodiscover.php

+ 16 - 0
data/web/autodiscover.php

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