forked from Billionmail/BillionMail
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sql
More file actions
51 lines (47 loc) · 1.68 KB
/
init.sql
File metadata and controls
51 lines (47 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
-- domain
CREATE TABLE IF NOT EXISTS domain (
domain varchar(255) NOT NULL,
a_record varchar(255) NOT NULL DEFAULT '',
mailboxes int NOT NULL DEFAULT 50, -- Number of emails created
mailbox_quota BIGINT NOT NULL DEFAULT 5368709120, -- Default space size of mailbox
quota BIGINT NOT NULL DEFAULT 10737418240, -- Domain name quota
rate_limit INT DEFAULT 12, -- How many emails per second
create_time INT NOT NULL default 0,
active SMALLINT NOT NULL DEFAULT 1,
PRIMARY KEY (domain)
);
-- mailbox
CREATE TABLE IF NOT EXISTS mailbox (
username varchar(255) NOT NULL,
password varchar(255) NOT NULL,
password_encode varchar(255) NOT NULL,
full_name varchar(255) NOT NULL,
is_admin smallint NOT NULL DEFAULT 0,
maildir varchar(255) NOT NULL,
quota bigint NOT NULL DEFAULT 0,
local_part varchar(255) NOT NULL,
domain varchar(255) NOT NULL,
create_time int NOT NULL default 0,
update_time int NOT NULL default 0,
active SMALLINT NOT NULL DEFAULT 1,
PRIMARY KEY (username)
);
-- alias
CREATE TABLE IF NOT EXISTS alias (
address varchar(255) NOT NULL,
goto text NOT NULL,
domain varchar(255) NOT NULL,
create_time int NOT NULL default 0,
update_time int NOT NULL default 0,
active smallint NOT NULL DEFAULT 1,
PRIMARY KEY (address)
);
-- alias_domain
CREATE TABLE IF NOT EXISTS alias_domain (
alias_domain varchar(255) NOT NULL,
target_domain varchar(255) NOT NULL,
create_time int NOT NULL default 0,
update_time int NOT NULL default 0,
active smallint NOT NULL DEFAULT 1,
PRIMARY KEY (alias_domain)
);