Update autoconfig.php

master
André Peters 2017-07-24 12:28:48 +02:00 committed by GitHub
parent 53d44ed18d
commit b295bedf53
1 changed files with 19 additions and 12 deletions

View File

@ -1,5 +1,12 @@
<?php <?php
require_once 'inc/vars.inc.php'; require_once 'inc/vars.inc.php';
$default_autodiscover_config = $autodiscover_config;
if(file_exists('inc/vars.local.inc.php')) {
include_once 'inc/vars.local.inc.php';
}
$configuration = array_merge($default_autodiscover_config, $autodiscover_config);
error_reporting(0);
if (empty($mailcow_hostname)) { if (empty($mailcow_hostname)) {
exit(); exit();
@ -25,15 +32,15 @@ header('Content-Type: application/xml');
<displayShortName>mail server</displayShortName> <displayShortName>mail server</displayShortName>
<incomingServer type="imap"> <incomingServer type="imap">
<hostname><?= $autodiscover_config['imap']['server']; ?></hostname> <hostname><?= $configuration['imap']['server']; ?></hostname>
<port><?= $autodiscover_config['imap']['port']; ?></port> <port><?= $configuration['imap']['port']; ?></port>
<socketType>SSL</socketType> <socketType>SSL</socketType>
<username>%EMAILADDRESS%</username> <username>%EMAILADDRESS%</username>
<authentication>password-cleartext</authentication> <authentication>password-cleartext</authentication>
</incomingServer> </incomingServer>
<incomingServer type="imap"> <incomingServer type="imap">
<hostname><?= $autodiscover_config['imap']['server']; ?></hostname> <hostname><?= $configuration['imap']['server']; ?></hostname>
<port><?= $autodiscover_config['imap']['tlsport']; ?></port> <port><?= $configuration['imap']['tlsport']; ?></port>
<socketType>STARTTLS</socketType> <socketType>STARTTLS</socketType>
<username>%EMAILADDRESS%</username> <username>%EMAILADDRESS%</username>
<authentication>password-cleartext</authentication> <authentication>password-cleartext</authentication>
@ -43,8 +50,8 @@ header('Content-Type: application/xml');
$records = dns_get_record('_pop3s._tcp.' . $domain, DNS_SRV); // check if POP3 is announced as "not provided" via SRV record $records = dns_get_record('_pop3s._tcp.' . $domain, DNS_SRV); // check if POP3 is announced as "not provided" via SRV record
if (count($records) == 0 || $records[0]['target'] != '') { ?> if (count($records) == 0 || $records[0]['target'] != '') { ?>
<incomingServer type="pop3"> <incomingServer type="pop3">
<hostname><?= $autodiscover_config['pop3']['server']; ?></hostname> <hostname><?= $configuration['pop3']['server']; ?></hostname>
<port><?= $autodiscover_config['pop3']['port']; ?></port> <port><?= $configuration['pop3']['port']; ?></port>
<socketType>SSL</socketType> <socketType>SSL</socketType>
<username>%EMAILADDRESS%</username> <username>%EMAILADDRESS%</username>
<authentication>password-cleartext</authentication> <authentication>password-cleartext</authentication>
@ -54,8 +61,8 @@ if (count($records) == 0 || $records[0]['target'] != '') { ?>
$records = dns_get_record('_pop3._tcp.' . $domain, DNS_SRV); // check if POP3 is announced as "not provided" via SRV record $records = dns_get_record('_pop3._tcp.' . $domain, DNS_SRV); // check if POP3 is announced as "not provided" via SRV record
if (count($records) == 0 || $records[0]['target'] != '') { ?> if (count($records) == 0 || $records[0]['target'] != '') { ?>
<incomingServer type="pop3"> <incomingServer type="pop3">
<hostname><?= $autodiscover_config['pop3']['server']; ?></hostname> <hostname><?= $configuration['pop3']['server']; ?></hostname>
<port><?= $autodiscover_config['pop3']['tlsport']; ?></port> <port><?= $configuration['pop3']['tlsport']; ?></port>
<socketType>STARTTLS</socketType> <socketType>STARTTLS</socketType>
<username>%EMAILADDRESS%</username> <username>%EMAILADDRESS%</username>
<authentication>password-cleartext</authentication> <authentication>password-cleartext</authentication>
@ -63,15 +70,15 @@ if (count($records) == 0 || $records[0]['target'] != '') { ?>
<?php } ?> <?php } ?>
<outgoingServer type="smtp"> <outgoingServer type="smtp">
<hostname><?= $autodiscover_config['smtp']['server']; ?></hostname> <hostname><?= $configuration['smtp']['server']; ?></hostname>
<port><?= $autodiscover_config['smtp']['port']; ?></port> <port><?= $configuration['smtp']['port']; ?></port>
<socketType>SSL</socketType> <socketType>SSL</socketType>
<username>%EMAILADDRESS%</username> <username>%EMAILADDRESS%</username>
<authentication>password-cleartext</authentication> <authentication>password-cleartext</authentication>
</outgoingServer> </outgoingServer>
<outgoingServer type="smtp"> <outgoingServer type="smtp">
<hostname><?= $autodiscover_config['smtp']['server']; ?></hostname> <hostname><?= $configuration['smtp']['server']; ?></hostname>
<port><?= $autodiscover_config['smtp']['tlsport']; ?></port> <port><?= $configuration['smtp']['tlsport']; ?></port>
<socketType>STARTTLS</socketType> <socketType>STARTTLS</socketType>
<username>%EMAILADDRESS%</username> <username>%EMAILADDRESS%</username>
<authentication>password-cleartext</authentication> <authentication>password-cleartext</authentication>