From e7fe31a7951d796654cf03374538a2d2153fd5b1 Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Wed, 8 Sep 2021 08:17:44 +0000 Subject: [PATCH 1/2] Revert unique forward --- install/patches/upd_0094.php | 3 ++- install/sql/incremental/upd_dev_collection.sql | 2 +- install/sql/ispconfig3.sql | 2 +- interface/web/mail/form/mail_alias.tform.php | 2 -- interface/web/mail/form/mail_forward.tform.php | 2 -- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/install/patches/upd_0094.php b/install/patches/upd_0094.php index b9516e232e..bfb363b74f 100644 --- a/install/patches/upd_0094.php +++ b/install/patches/upd_0094.php @@ -2,7 +2,7 @@ if(!defined('INSTALLER_RUN')) die('Patch update file access violation.'); -class upd_0094 extends installer_patch_update { +/*class upd_0094 extends installer_patch_update { public function onBeforeSQL() { global $inst; @@ -12,3 +12,4 @@ class upd_0094 extends installer_patch_update { } } +*/ \ No newline at end of file diff --git a/install/sql/incremental/upd_dev_collection.sql b/install/sql/incremental/upd_dev_collection.sql index 2400ca907a..4cd5f31dfb 100644 --- a/install/sql/incremental/upd_dev_collection.sql +++ b/install/sql/incremental/upd_dev_collection.sql @@ -7,7 +7,7 @@ ALTER TABLE `spamfilter_users` ALTER `policy_id` SET DEFAULT 0; -- mail_forwarding.source must be unique ALTER TABLE `mail_forwarding` DROP KEY `server_id`; -ALTER TABLE `mail_forwarding` ADD UNIQUE KEY `server_id` (`server_id`, `source`); +ALTER TABLE `mail_forwarding` ADD KEY `server_id` (`server_id`, `source`); -- Purge apps & addons installer (#5795) - second time due to syntax error in 0093 DROP TABLE IF EXISTS `software_package`; diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql index e37bef7f28..11ff65ed1b 100644 --- a/install/sql/ispconfig3.sql +++ b/install/sql/ispconfig3.sql @@ -918,7 +918,7 @@ CREATE TABLE `mail_forwarding` ( `allow_send_as` ENUM('n','y') NOT NULL DEFAULT 'n', `greylisting` enum('n','y' ) NOT NULL DEFAULT 'n', PRIMARY KEY (`forwarding_id`), - UNIQUE KEY `server_id` (`server_id`, `source`), + KEY `server_id` (`server_id`, `source`), KEY `type` (`type`) ) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; diff --git a/interface/web/mail/form/mail_alias.tform.php b/interface/web/mail/form/mail_alias.tform.php index 39b485c7a5..9434ba3eec 100644 --- a/interface/web/mail/form/mail_alias.tform.php +++ b/interface/web/mail/form/mail_alias.tform.php @@ -83,8 +83,6 @@ $form["tabs"]['alias'] = array ( ), 'validators' => array ( 0 => array ( 'type' => 'ISEMAIL', 'errmsg'=> 'email_error_isemail'), - 1 => array ( 'type' => 'UNIQUE', - 'errmsg'=> 'email_error_unique'), ), 'default' => '', 'value' => '', diff --git a/interface/web/mail/form/mail_forward.tform.php b/interface/web/mail/form/mail_forward.tform.php index db940f035e..003e678455 100644 --- a/interface/web/mail/form/mail_forward.tform.php +++ b/interface/web/mail/form/mail_forward.tform.php @@ -83,8 +83,6 @@ $form["tabs"]['forward'] = array ( ), 'validators' => array ( 0 => array ( 'type' => 'ISEMAIL', 'errmsg'=> 'email_error_isemail'), - 1 => array ( 'type' => 'UNIQUE', - 'errmsg'=> 'email_error_unique'), ), 'default' => '', 'value' => '', -- GitLab From a0cf4fae5acb124ab45aae7bb9fe58ae6dc899cd Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Wed, 8 Sep 2021 08:20:18 +0000 Subject: [PATCH 2/2] Update upd_0094.php --- install/patches/upd_0094.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/install/patches/upd_0094.php b/install/patches/upd_0094.php index bfb363b74f..e05f85b7bc 100644 --- a/install/patches/upd_0094.php +++ b/install/patches/upd_0094.php @@ -2,14 +2,13 @@ if(!defined('INSTALLER_RUN')) die('Patch update file access violation.'); -/*class upd_0094 extends installer_patch_update { +class upd_0094 extends installer_patch_update { public function onBeforeSQL() { global $inst; // Remove any duplicate mail_forwardings prior to adding unique key - $inst->db->query("DELETE FROM mail_forwarding WHERE forwarding_id IN (SELECT forwarding_id FROM (SELECT forwarding_id, COUNT(source) AS source_count FROM mail_forwarding GROUP BY source HAVING source_count > 1) as t1)"); + //$inst->db->query("DELETE FROM mail_forwarding WHERE forwarding_id IN (SELECT forwarding_id FROM (SELECT forwarding_id, COUNT(source) AS source_count FROM mail_forwarding GROUP BY source HAVING source_count > 1) as t1)"); } } -*/ \ No newline at end of file -- GitLab