From 659deeedd4bb82d2c16006e76ee78da2c59091bd Mon Sep 17 00:00:00 2001 From: Steven Mondji-Lerider Date: Thu, 2 May 2013 08:12:24 +0000 Subject: [PATCH] Bugfixing alias_view on upgrades ( cf Ticket #1489 ) --- .gitattributes | 1 + install/upgrades/3.0.3~a.sql | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 install/upgrades/3.0.3~a.sql diff --git a/.gitattributes b/.gitattributes index 55a444c5..9ea9afb4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -500,6 +500,7 @@ install/upgrades/3.0.0~2.sh -text install/upgrades/3.0.0~3.php -text install/upgrades/3.0.0~4.sh -text install/upgrades/3.0.1.php -text +install/upgrades/3.0.3~a.sql -text install/upgrades/3.1.0~a.sql -text install/upgrades/3.1.0~b.php -text install/upgrades/README -text diff --git a/install/upgrades/3.0.3~a.sql b/install/upgrades/3.0.3~a.sql new file mode 100644 index 00000000..e8d1e59d --- /dev/null +++ b/install/upgrades/3.0.3~a.sql @@ -0,0 +1,18 @@ +CREATE OR REPLACE VIEW `alias_view` AS +select concat(`address`.`address`,'@',`domaines`.`domaine`) AS `mail`, +concat(if(isnull(`mailbox`.`id`),'',concat(concat(`address`.`address`,'@',`domaines`.`domaine`),'\n')),`recipient`.`recipients`) AS `alias` +from (((`recipient` join `address` on((`address`.`id` = `recipient`.`address_id`))) +left join `mailbox` on((`mailbox`.`address_id` = `address`.`id`))) +join `domaines` on((`domaines`.`id` = `address`.`domain_id`))) +where `address`.`enabled` = 1 +union +select distinct concat(`m`.`login`,'@',`v`.`value`) AS `mail`, +`m`.`mail` AS `alias` +from ((`membres` `m` join `variable` `v`) join `domaines` `d`) +where (`v`.`name` = 'mailname_bounce') +union +select distinct concat('alterncpanel','@',`v`.`value`) AS `mail`, +`m`.`mail` AS `alias` +from ((`membres` `m` join `variable` `v`) join `domaines` `d`) +where (`v`.`name` = 'mailname_bounce' AND `m`.`uid`=2000); +