From 1a58df6d5465130d1ce2a092d03060fe744042ed Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 28 Nov 2012 13:21:44 -0500
Subject: [PATCH] Fixed: FS#2555 - Mail domain delete function deletes forwards while it shall delete aliases only

---
 interface/web/mail/mail_domain_del.php |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/interface/web/mail/mail_domain_del.php b/interface/web/mail/mail_domain_del.php
index 550fa92..0f00dd9 100644
--- a/interface/web/mail/mail_domain_del.php
+++ b/interface/web/mail/mail_domain_del.php
@@ -60,7 +60,7 @@
 		// we will delete all depending records.
 		
 		// Delete all forwardings where the osurce or destination belongs to this domain
-		$records = $app->db->queryAllRecords("SELECT forwarding_id as id FROM mail_forwarding WHERE source like '%@".$app->db->quote($domain)."' OR destination like '%@".$app->db->quote($domain)."'");
+		$records = $app->db->queryAllRecords("SELECT forwarding_id as id FROM mail_forwarding WHERE source like '%@".$app->db->quote($domain)."' OR (destination like '%@".$app->db->quote($domain)."' AND type != 'forward'");
 		foreach($records as $rec) {
 			$app->db->datalogDelete('mail_forwarding','forwarding_id',$rec['id']);
 		}

--
Gitblit v1.9.1