From aee9d677f5cf1c2c9dfa73b72e48bb95fba7264a Mon Sep 17 00:00:00 2001
From: Sergio Cambra <sergio@programatica.es>
Date: Fri, 04 Jul 2014 12:00:11 -0400
Subject: [PATCH] fix changing domain name on mail_get records

---
 interface/web/tools/resync.php |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/interface/web/tools/resync.php b/interface/web/tools/resync.php
index 1191585..4e5f206 100644
--- a/interface/web/tools/resync.php
+++ b/interface/web/tools/resync.php
@@ -166,6 +166,20 @@
 	}
 }
 
+//* Resyncing DKIM-Keys
+if(isset($_POST['resync_dkim']) && $_POST['resync_dkim'] == 1) {
+	$db_table = 'mail_domain';
+	$index_field = 'domain_id';
+	$sql = "SELECT * FROM ".$db_table." WHERE active = 'y' AND dkim = 'y'";
+	$records = $app->db->queryAllRecords($sql);
+	if(is_array($records)) {
+		foreach($records as $rec) {
+			$app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true);
+			$msg .= "Resynced DKIM-Key: ".$rec['domain'].'<br />';
+		}
+	}
+}
+
 //* Resyncing dns zones
 if(isset($_POST['resync_dns']) && $_POST['resync_dns'] == 1) {
 	$zones = $app->db->queryAllRecords("SELECT id,origin,serial FROM dns_soa WHERE active = 'Y'");

--
Gitblit v1.9.1