prefer custom zone entries over automatically created ones when system.dns_createmailentry is enabled, fixes #944
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -53,7 +53,7 @@ class Dns
|
|||||||
$domain = $domain_id;
|
$domain = $domain_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($domain['isbinddomain'] != '1') {
|
if (!isset($domain['isbinddomain']) || $domain['isbinddomain'] != '1') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,12 +190,26 @@ class Dns
|
|||||||
'@',
|
'@',
|
||||||
'www',
|
'www',
|
||||||
'*'
|
'*'
|
||||||
] as $crceord) {
|
] as $crecord) {
|
||||||
if ($entry['type'] == 'CNAME' && $entry['record'] == '@' && (array_key_exists(md5($crceord), $required_entries['A']) || array_key_exists(md5($crceord), $required_entries['AAAA']))) {
|
if ($entry['type'] == 'CNAME' && $entry['record'] == '@' && (array_key_exists(md5($crecord), $required_entries['A']) || array_key_exists(md5($crecord), $required_entries['AAAA']))) {
|
||||||
unset($required_entries['A'][md5($crceord)]);
|
unset($required_entries['A'][md5($crecord)]);
|
||||||
unset($required_entries['AAAA'][md5($crceord)]);
|
unset($required_entries['AAAA'][md5($crecord)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// also allow overriding of auto-generated values (imap,pop3,mail,smtp) if enabled in the settings
|
||||||
|
if (Settings::Get('system.dns_createmailentry')) {
|
||||||
|
foreach (array(
|
||||||
|
'imap',
|
||||||
|
'pop3',
|
||||||
|
'mail',
|
||||||
|
'smtp'
|
||||||
|
) as $crecord) {
|
||||||
|
if ($entry['type'] == 'CNAME' && $entry['record'] == $crecord && (array_key_exists(md5($crecord), $required_entries['A']) || array_key_exists(md5($crecord), $required_entries['AAAA']))) {
|
||||||
|
unset($required_entries['A'][md5($crecord)]);
|
||||||
|
unset($required_entries['AAAA'][md5($crecord)]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$zonerecords[] = new DnsEntry($entry['record'], $entry['type'], $entry['content'], $entry['prio'], $entry['ttl']);
|
$zonerecords[] = new DnsEntry($entry['record'], $entry['type'], $entry['content'], $entry['prio'], $entry['ttl']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user