Use mailing lists instead of aliases for stalwart

This commit is contained in:
traxys 2023-10-08 13:06:12 +02:00
parent 56b71230e9
commit f09444d832
6 changed files with 78 additions and 52 deletions

View file

@ -0,0 +1,12 @@
-- Add migration script here
ALTER TABLE emails
ADD CONSTRAINT email_type_unique UNIQUE (mail, type);
CREATE TABLE list_recipients (
list TEXT NOT NULL,
type mail_type NOT NULL CHECK (type = 'list'),
recipient TEXT NOT NULL,
PRIMARY KEY (list, recipient),
FOREIGN KEY (list, type) REFERENCES emails (mail, type)
);