readd wildcard sending functionality

This commit is contained in:
Sebastian Hugentobler 2022-10-31 13:38:08 +01:00
parent 17449cfdb4
commit fba756d7ac
Signed by: shu
GPG Key ID: BB32CF3CA052C2F0
4 changed files with 10 additions and 10 deletions

View File

@ -5,7 +5,8 @@ RUN apk add --no-cache \
postfix-pgsql \
openssl \
libstdc++ \
libmilter
libmilter \
icu-data-full
RUN addgroup -g 2222 access
RUN addgroup postfix access

View File

@ -9,7 +9,7 @@ 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),
wildcard_sender bool default false
wildcard_sender bool default false
);
create table if not exists virtual_aliases (

View File

@ -1,15 +1,11 @@
compatibility_level = 2
compatibility_level = 3.7
mail_owner = postfix
myhostname = {{getenv "MYHOSTNAME"}}
mydomain = {{getenv "MYDOMAIN"}}
myorigin = $mydomain
mydestination = $myhostname, localhost
proxy_interfaces = {{getenv "EXTERNAL_IP"}}
unknown_local_recipient_reject_code = 550
mynetworks_style = host
relay_domains = $mydestination
recipient_delimiter = +
@ -59,8 +55,11 @@ smtpd_sasl_auth_enable = yes
smtpd_tls_auth_only = yes
smtpd_sasl_tls_security_options = noanonymous
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination, reject_unverified_recipient
smtpd_relay_restrictions =
permit_mynetworks
permit_sasl_authenticated
defer_unauth_destination
reject_sender_login_mismatch
smtpd_sender_restrictions = reject_sender_login_mismatch
smtpd_sender_login_maps = pgsql:/etc/postfix/pgsql-login-maps.cf

View File

@ -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 AND domain_name = '%d'