diff --git a/install/mysql.sql b/install/mysql.sql index 93830d4e..6f4b4389 100644 --- a/install/mysql.sql +++ b/install/mysql.sql @@ -663,7 +663,9 @@ concat('*:storage=',cast(`mailbox`.`quota` as char charset latin1),'M') AS `user `mailbox`.`messages` AS `nb_messages` from ((`mailbox` join `address` on((`address`.`id` = `mailbox`.`address_id`))) -join `domaines` on((`domaines`.`id` = `address`.`domain_id`))); +join `domaines` on((`domaines`.`id` = `address`.`domain_id`))) +where `address`.`enabled` = 1 +; -- -- Structure de la vue `alias_view` @@ -675,13 +677,13 @@ concat(if(isnull(`mailbox`.`id`),'',concat(concat(`address`.`address`,'@',`domai 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'); - -- -- Structure de la table `piwik_users` -- diff --git a/install/upgrades/1.1.sql b/install/upgrades/1.1.sql index 79b34098..bd6557b2 100644 --- a/install/upgrades/1.1.sql +++ b/install/upgrades/1.1.sql @@ -165,6 +165,43 @@ CREATE TABLE IF NOT EXISTS `cron` ( KEY `uid` (`uid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; +-- +-- Structure de la vue `dovecot_view` +-- + +CREATE OR REPLACE VIEW `dovecot_view` AS +SELECT concat(`address`.`address`,'@',`domaines`.`domaine`) AS `user`, +concat('*:storage=',cast(`mailbox`.`quota` as char charset latin1),'M') AS `userdb_quota_rule`, +`address`.`password` AS `password`, +`mailbox`.`path` AS `userdb_home`, +`domaines`.`compte` AS `userdb_uid`, +`domaines`.`compte` AS `userdb_gid`, +`mailbox`.`bytes` AS `quota_dovecot`, +`mailbox`.`messages` AS `nb_messages` +from ((`mailbox` +join `address` on((`address`.`id` = `mailbox`.`address_id`))) +join `domaines` on((`domaines`.`id` = `address`.`domain_id`))) +where `address`.`enabled` = 1 +; + +-- +-- Structure de la vue `alias_view` +-- + +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'); + + -- -- Structure de la table `piwik_users` --