From 27f907ee99cde3dc4e11a2f7ae1f5ec09e08675d Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Tue, 23 Oct 2018 19:27:54 +0200 Subject: [PATCH] [fix] (for 3.5) delete ALSO autoconf / autodiscover in cascade when del_mx_domain --- bureau/class/m_mail.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bureau/class/m_mail.php b/bureau/class/m_mail.php index ed1c08bc..7ba99632 100644 --- a/bureau/class/m_mail.php +++ b/bureau/class/m_mail.php @@ -474,6 +474,7 @@ ORDER BY $this->del_dns_dmarc($domain); $this->del_dns_spf($domain); + $this->del_dns_autoconf($domain); $this->dkim_del($domain); $db->query("UPDATE domaines SET dns_action='UPDATE' WHERE id= ? ;", array($dom_id)); @@ -1026,6 +1027,16 @@ ORDER BY return $changed; } + + // ------------------------------------------------------------ + /** + * delete the autoconf / autodiscover vhosts when removing a domain as MX + */ + function del_dns_autoconf($domain) { + global $db, $L_FQDN, $cuid; + $db->query("UPDATE sub_domaines SET web_action='DELETE' WHERE domaine= ? AND type='autodiscover' AND sub='autoconfig';", array($domain)); + $db->query("UPDATE sub_domaines SET web_action='DELETE' WHERE domaine= ? AND type='autodiscover' AND sub='autodiscover';", array($domain)); + } // ------------------------------------------------------------ /**