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