add wildcard sending

This commit is contained in:
Sebastian Hugentobler 2022-09-11 13:16:25 +02:00
parent 438c4e3035
commit 2d91915d18
Signed by: shu
GPG Key ID: BB32CF3CA052C2F0
2 changed files with 3 additions and 2 deletions

View File

@ -8,7 +8,8 @@ create table if not exists virtual_domains (
create table if not exists virtual_users ( create table if not exists virtual_users (
email text primary key, email text primary key,
domain_name text not null references virtual_domains(name) domain_name text not null references virtual_domains(name),
wildcard_sender bool default false
); );
create table if not exists virtual_aliases ( create table if not exists virtual_aliases (

View File

@ -2,4 +2,4 @@ hosts = {{ getenv "DB_HOST" }}
user = {{ getenv "DB_USER" "email" }} user = {{ getenv "DB_USER" "email" }}
password = {{ getenv "DB_PASSWORD" }} password = {{ getenv "DB_PASSWORD" }}
dbname = {{ getenv "DB_NAME" "email" }} dbname = {{ getenv "DB_NAME" "email" }}
query = SELECT email FROM virtual_users WHERE email='%u' UNION SELECT destination FROM virtual_aliases WHERE source='%u' query = SELECT email FROM virtual_users WHERE email='%u' UNION SELECT destination FROM virtual_aliases WHERE source='%u' UNION SELECT email FROM virtual_users WHERE wildcard_sender=true