This commit is contained in:
temasky
2020-07-31 12:45:56 +00:00
commit 5d419635ed
306 changed files with 26949 additions and 0 deletions
@@ -0,0 +1,16 @@
#
# IMAP shared folders. User 'from_user' shares folders to user 'to_user'.
# WARNING: Works only with Dovecot 1.2+.
#
CREATE TABLE IF NOT EXISTS share_folder (
from_user VARCHAR(150) NOT NULL,
to_user VARCHAR(150) NOT NULL,
dummy CHAR(1),
PRIMARY KEY (from_user, to_user)
);
CREATE TABLE IF NOT EXISTS anyone_shares (
from_user VARCHAR(255) NOT NULL,
dummy CHAR(1) DEFAULT '1',
PRIMARY KEY (from_user)
);
@@ -0,0 +1,12 @@
CREATE TABLE IF NOT EXISTS `last_login` (
`username` VARCHAR(255) NOT NULL DEFAULT '',
`domain` VARCHAR(255) NOT NULL DEFAULT '',
`imap` INT(11) DEFAULT NULL,
`pop3` INT(11) DEFAULT NULL,
`lda` INT(11) DEFAULT NULL,
PRIMARY KEY (`username`),
INDEX (`domain`),
INDEX (`imap`),
INDEX (`pop3`),
INDEX (`lda`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -0,0 +1,26 @@
-- used_quota
-- Used to store realtime mailbox quota in Dovecot.
-- WARNING: Works only with Dovecot 1.2+.
--
-- Note: Don't touch this table, it will be updated by Dovecot automatically.
CREATE TABLE IF NOT EXISTS `used_quota` (
`username` VARCHAR(255) NOT NULL,
`bytes` BIGINT NOT NULL DEFAULT 0,
`messages` BIGINT NOT NULL DEFAULT 0,
`domain` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (`username`),
INDEX (domain)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Trigger `used_quota_before_insert` is used to set `used_quota.domain`.
-- NOTE: `used_quota.domain` is not used by Dovecot, but used in iRedAdmin to
-- get better SQL query performance while calculating per-domain used
-- quota.
DELIMITER //
CREATE TRIGGER `used_quota_before_insert`
BEFORE INSERT ON `used_quota` FOR EACH ROW
BEGIN
SET NEW.domain = SUBSTRING_INDEX(NEW.username, '@', -1);
END;
//
DELIMITER ;