public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
Update autoconfig.php
b295bedf
data/web/autoconfig.php | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
Diff
diff --git a/data/web/autoconfig.php b/data/web/autoconfig.php
index 523d6183..59f07907 100644
--- a/data/web/autoconfig.php
+++ b/data/web/autoconfig.php
@@ -1,5 +1,12 @@
<?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)) {
exit();
@@ -25,15 +32,15 @@ header('Content-Type: application/xml');
<displayShortName>mail server</displayShortName>
<incomingServer type="imap">
- <hostname><?= $autodiscover_config['imap']['server']; ?></hostname>
- <port><?= $autodiscover_config['imap']['port']; ?></port>
+ <hostname><?= $configuration['imap']['server']; ?></hostname>
+ <port><?= $configuration['imap']['port']; ?></port>
<socketType>SSL</socketType>
<username>%EMAILADDRESS%</username>
<authentication>password-cleartext</authentication>
</incomingServer>
<incomingServer type="imap">
- <hostname><?= $autodiscover_config['imap']['server']; ?></hostname>
- <port><?= $autodiscover_config['imap']['tlsport']; ?></port>
+ <hostname><?= $configuration['imap']['server']; ?></hostname>
+ <port><?= $configuration['imap']['tlsport']; ?></port>
<socketType>STARTTLS</socketType>
<username>%EMAILADDRESS%</username>
<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
if (count($records) == 0 || $records[0]['target'] != '') { ?>
<incomingServer type="pop3">
- <hostname><?= $autodiscover_config['pop3']['server']; ?></hostname>
- <port><?= $autodiscover_config['pop3']['port']; ?></port>
+ <hostname><?= $configuration['pop3']['server']; ?></hostname>
+ <port><?= $configuration['pop3']['port']; ?></port>
<socketType>SSL</socketType>
<username>%EMAILADDRESS%</username>
<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
if (count($records) == 0 || $records[0]['target'] != '') { ?>
<incomingServer type="pop3">
- <hostname><?= $autodiscover_config['pop3']['server']; ?></hostname>
- <port><?= $autodiscover_config['pop3']['tlsport']; ?></port>
+ <hostname><?= $configuration['pop3']['server']; ?></hostname>
+ <port><?= $configuration['pop3']['tlsport']; ?></port>
<socketType>STARTTLS</socketType>
<username>%EMAILADDRESS%</username>
<authentication>password-cleartext</authentication>
@@ -63,15 +70,15 @@ if (count($records) == 0 || $records[0]['target'] != '') { ?>
<?php } ?>
<outgoingServer type="smtp">
- <hostname><?= $autodiscover_config['smtp']['server']; ?></hostname>
- <port><?= $autodiscover_config['smtp']['port']; ?></port>
+ <hostname><?= $configuration['smtp']['server']; ?></hostname>
+ <port><?= $configuration['smtp']['port']; ?></port>
<socketType>SSL</socketType>
<username>%EMAILADDRESS%</username>
<authentication>password-cleartext</authentication>
</outgoingServer>
<outgoingServer type="smtp">
- <hostname><?= $autodiscover_config['smtp']['server']; ?></hostname>
- <port><?= $autodiscover_config['smtp']['tlsport']; ?></port>
+ <hostname><?= $configuration['smtp']['server']; ?></hostname>
+ <port><?= $configuration['smtp']['tlsport']; ?></port>
<socketType>STARTTLS</socketType>
<username>%EMAILADDRESS%</username>
<authentication>password-cleartext</authentication>