bugfixing alias_view on upgrades

This commit is contained in:
Steven Mondji-Lerider 2013-05-02 08:11:28 +00:00
parent 3128c6bd45
commit b445604d44
2 changed files with 19 additions and 0 deletions

1
.gitattributes vendored
View File

@ -547,6 +547,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/README -text
lang/.svnignore -text
lang/README -text

View File

@ -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);