From 2d91915d18a22f3ad24b98ef21a0a91562a35d29 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Sun, 11 Sep 2022 13:16:25 +0200 Subject: [PATCH] add wildcard sending --- README.md | 3 ++- rootfs/etc/confd/templates/pgsql-login-maps.cf.tmpl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 37a6de2..bdc8ebc 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,8 @@ create table if not exists virtual_domains ( create table if not exists virtual_users ( 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 ( diff --git a/rootfs/etc/confd/templates/pgsql-login-maps.cf.tmpl b/rootfs/etc/confd/templates/pgsql-login-maps.cf.tmpl index ee0c956..73cfeba 100644 --- a/rootfs/etc/confd/templates/pgsql-login-maps.cf.tmpl +++ b/rootfs/etc/confd/templates/pgsql-login-maps.cf.tmpl @@ -2,4 +2,4 @@ hosts = {{ getenv "DB_HOST" }} user = {{ getenv "DB_USER" "email" }} password = {{ getenv "DB_PASSWORD" }} 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