From a00f4b0d5fc7009d59a7ef854fb0199bc097be35 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Mon, 13 May 2019 17:52:13 -0400 Subject: [PATCH] Check if domain is being deleted before adding DKIM key entry Fixes #338 --- bureau/class/m_mail.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bureau/class/m_mail.php b/bureau/class/m_mail.php index f10bde0f..a4444179 100644 --- a/bureau/class/m_mail.php +++ b/bureau/class/m_mail.php @@ -1140,11 +1140,11 @@ ORDER BY global $db; // for each domain where we don't have the MX or the DNS, remove the DKIM setup $this->shouldreloaddkim=false; - $db->query("SELECT domaine,compte,gesdns,gesmx FROM domaines WHERE dns_action!='OK';"); + $db->query("SELECT domaine,compte,gesdns,gesmx,dns_action FROM domaines WHERE dns_action!='OK';"); $add=array(); $del=array(); while ($db->next_record()) { - if ($db->Record["gesdns"]==0 || $db->Record["gesmx"]==0) { + if ($db->Record["gesdns"]==0 || $db->Record["gesmx"]==0 || $db->Record['dns_action'] == 'DELETE') { $del[]=$db->Record; } else { $add[]=$db->Record; @@ -1178,7 +1178,6 @@ ORDER BY function dkim_add($domain,$uid) { global $db; $target_dir = "/etc/opendkim/keys/$domain"; - // Create a dkim key when it's not already there : if (!file_exists($target_dir.'/alternc.txt')) { $this->shouldreloaddkim=true;