Adieu table size_mail, deprecated grace à dovecot
This commit is contained in:
parent
265a9a3f5e
commit
18898953ae
|
@ -365,27 +365,27 @@ class m_quota {
|
|||
|
||||
/* sum of mailbox sizes from all domains */
|
||||
function get_size_mail_sum_all() {
|
||||
return $this->_get_sum_sql("SELECT SUM(size) AS sum FROM size_mail;");
|
||||
return $this->_get_sum_sql("SELECT SUM(bytes) AS sum FROM mailbox;");
|
||||
}
|
||||
|
||||
/* sum of mailbox sizes for one domain */
|
||||
function get_size_mail_sum_domain($dom) {
|
||||
return $this->_get_sum_sql("SELECT SUM(size) AS sum FROM size_mail WHERE alias LIKE '%\_{$dom}'");
|
||||
return $this->_get_sum_sql("SELECT SUM(size) AS sum FROM dovecot_view WHERE user LIKE '%@{$dom}'");
|
||||
}
|
||||
|
||||
/* count of mailbox sizes from all domains */
|
||||
function get_size_mail_count_all() {
|
||||
return $this->_get_count_sql("SELECT COUNT(*) AS count FROM size_mail;");
|
||||
return $this->_get_count_sql("SELECT COUNT(*) AS count FROM mailbox;");
|
||||
}
|
||||
|
||||
/* count of mailbox for one domain */
|
||||
function get_size_mail_count_domain($dom) {
|
||||
return $this->_get_count_sql("SELECT COUNT(*) AS count FROM size_mail FROM size_mail WHERE alias LIKE '%\_{$dom}'");
|
||||
return $this->_get_count_sql("SELECT COUNT(*) AS count FROM dovecot_view WHERE user LIKE '%@{$dom}'");
|
||||
}
|
||||
|
||||
/* get list of mailbox alias and size for one domain */
|
||||
function get_size_mail_details_domain($dom) {
|
||||
return $this->_get_size_and_record_sql("SELECT alias,size FROM size_mail WHERE alias LIKE '%\_{$dom}' ORDER BY alias;");
|
||||
return $this->_get_size_and_record_sql("SELECT user as alias,quota_dovecot as size FROM dovecot_view WHERE alias LIKE '%@{$dom}' ORDER BY alias;");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -430,15 +430,6 @@ PRIMARY KEY ( `login` )
|
|||
) COMMENT = 'Allowed account for secondary mx managment';
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `size_mail` (
|
||||
`alias` varchar(255) NOT NULL default '',
|
||||
`size` int(10) unsigned NOT NULL default '0',
|
||||
`ts` timestamp(14) NOT NULL,
|
||||
PRIMARY KEY (`alias`),
|
||||
KEY `ts` (`ts`)
|
||||
) TYPE=MyISAM COMMENT='Mail space used by pop accounts.';
|
||||
|
||||
-- --------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `size_web` (
|
||||
`uid` int(10) unsigned NOT NULL default '0',
|
||||
|
|
|
@ -221,5 +221,7 @@ DELETE FROM quotas WHERE name = 'mysql_users';
|
|||
-- Raw web statistics are deprecated since vlogger
|
||||
DELETE FROM quotas WHERE name = 'sta2';
|
||||
DELETE FROM defquotas WHERE quota = 'sta2';
|
||||
|
||||
DROP TABLE stats2;
|
||||
|
||||
-- With Dovecot, no more use of size_mail
|
||||
DROP TABLE size_mail;
|
||||
|
|
|
@ -5,15 +5,6 @@ require_once("/var/alternc/bureau/class/config_nochk.php");
|
|||
// On déverrouile le bureau AlternC :)
|
||||
@alternc_shutdown();
|
||||
|
||||
echo "---------------------------\n Generating size-cache for mail accounts\n\n";
|
||||
$r=mysql_query("SELECT * FROM dovecot_view ;");
|
||||
while ($c=mysql_fetch_array($r)) {
|
||||
echo $c["user"]; flush();
|
||||
$size=exec("/usr/lib/alternc/du.pl ".$c["userdb_home"]);
|
||||
mysql_query("REPLACE INTO size_mail SET alias='".addslashes($c["user"])."',size='$size';");
|
||||
echo " done ($size KB)\n"; flush();
|
||||
}
|
||||
|
||||
echo "---------------------------\n Generating size-cache for web accounts\n\n";
|
||||
$r=mysql_query("SELECT uid,login FROM membres;");
|
||||
while ($c=mysql_fetch_array($r)) {
|
||||
|
|
Loading…
Reference in New Issue