Created
June 9, 2018 08:11
-
-
Save ThomasLeister/a69b4ca184684344064d20c9e348df55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Create queries for https://thomas-leister.de/mailserver-debian-stretch/ */ | |
create table domains ( | |
id serial not null, | |
domain char (255) unique not null, | |
PRIMARY KEY (id) | |
); | |
create table accounts ( | |
id serial not null, | |
username char(64) not null, | |
domain char(255) not null, | |
password char(255) not null, | |
quota integer default 0, | |
enabled boolean default false, | |
sendonly boolean default false, | |
PRIMARY KEY (id), | |
UNIQUE (username, domain), | |
FOREIGN KEY (domain) references domains (domain) | |
); | |
CREATE TABLE aliases ( | |
id serial not null, | |
source_username char(64) not null, | |
source_domain char(255) not null, | |
destination_username char(64) not null, | |
destination_domain char(255) not null, | |
enabled boolean default false, | |
PRIMARY KEY (id), | |
UNIQUE (source_username, source_domain, destination_username, destination_domain), | |
FOREIGN KEY (source_domain) REFERENCES domains (domain) | |
); | |
CREATE TYPE policy AS ENUM('none', 'may', 'encrypt', 'dane', 'dane-only', 'fingerprint', 'verify', 'secure'); | |
CREATE TABLE tlspolicies ( | |
id serial not null, | |
domain char(255) not null, | |
policy policy not null, | |
params varchar(255), | |
PRIMARY KEY (id), | |
UNIQUE (domain) | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment