Check if domain is being deleted before adding DKIM key entry

Fixes #338
This commit is contained in:
Kienan Stewart 2019-05-13 17:52:13 -04:00 committed by Camille Lafitte
parent 72d0a8e47e
commit a00f4b0d5f
1 changed files with 2 additions and 3 deletions

View File

@ -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;