Check if domain is being deleted before adding DKIM key entry
Fixes #338
This commit is contained in:
parent
72d0a8e47e
commit
a00f4b0d5f
|
@ -1140,11 +1140,11 @@ ORDER BY
|
||||||
global $db;
|
global $db;
|
||||||
// for each domain where we don't have the MX or the DNS, remove the DKIM setup
|
// for each domain where we don't have the MX or the DNS, remove the DKIM setup
|
||||||
$this->shouldreloaddkim=false;
|
$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();
|
$add=array();
|
||||||
$del=array();
|
$del=array();
|
||||||
while ($db->next_record()) {
|
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;
|
$del[]=$db->Record;
|
||||||
} else {
|
} else {
|
||||||
$add[]=$db->Record;
|
$add[]=$db->Record;
|
||||||
|
@ -1178,7 +1178,6 @@ ORDER BY
|
||||||
function dkim_add($domain,$uid) {
|
function dkim_add($domain,$uid) {
|
||||||
global $db;
|
global $db;
|
||||||
$target_dir = "/etc/opendkim/keys/$domain";
|
$target_dir = "/etc/opendkim/keys/$domain";
|
||||||
|
|
||||||
// Create a dkim key when it's not already there :
|
// Create a dkim key when it's not already there :
|
||||||
if (!file_exists($target_dir.'/alternc.txt')) {
|
if (!file_exists($target_dir.'/alternc.txt')) {
|
||||||
$this->shouldreloaddkim=true;
|
$this->shouldreloaddkim=true;
|
||||||
|
|
Loading…
Reference in New Issue