From 8f0f89014537a4a915f8a4e830287392d4aefe51 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Mon, 27 Dec 2021 15:38:59 +0100 Subject: [PATCH] fix too strict comparison for isemaildomain check in Dns-Zone generation; fixes #1003 Signed-off-by: Michael Kaufmann --- lib/Froxlor/Dns/Dns.php | 2 +- tests/DomainZones/DomainZonesTest.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Froxlor/Dns/Dns.php b/lib/Froxlor/Dns/Dns.php index 1ff28999..c870e3cc 100644 --- a/lib/Froxlor/Dns/Dns.php +++ b/lib/Froxlor/Dns/Dns.php @@ -75,7 +75,7 @@ class Dns if (! $isMainButSubTo) { self::addRequiredEntry('@', 'NS', $required_entries); } - if ($domain['isemaildomain'] === '1') { + if ($domain['isemaildomain'] == '1') { self::addRequiredEntry('@', 'MX', $required_entries); if (Settings::Get('system.dns_createmailentry')) { foreach (array( diff --git a/tests/DomainZones/DomainZonesTest.php b/tests/DomainZones/DomainZonesTest.php index 73b21da8..69e25147 100644 --- a/tests/DomainZones/DomainZonesTest.php +++ b/tests/DomainZones/DomainZonesTest.php @@ -21,6 +21,7 @@ class DomainZonesTest extends TestCase global $admin_userdata; Settings::Set('system.dnsenabled', 1, true); + Settings::Set('system.mxservers', 'mx.hostname.tld', true); // get customer $json_result = Customers::getLocal($admin_userdata, array( @@ -35,6 +36,7 @@ class DomainZonesTest extends TestCase $result = json_decode($json_result, true)['data']; $this->assertTrue(count($result) > 1); $this->assertEquals('$ORIGIN test2.local.', $result[1]); + $this->assertEquals('@ 604800 IN MX 10 mx.hostname.tld.', $result[count($result)-2]); } /**