readd wildcard sending functionality
This commit is contained in:
parent
17449cfdb4
commit
fba756d7ac
@ -5,7 +5,8 @@ RUN apk add --no-cache \
|
|||||||
postfix-pgsql \
|
postfix-pgsql \
|
||||||
openssl \
|
openssl \
|
||||||
libstdc++ \
|
libstdc++ \
|
||||||
libmilter
|
libmilter \
|
||||||
|
icu-data-full
|
||||||
|
|
||||||
RUN addgroup -g 2222 access
|
RUN addgroup -g 2222 access
|
||||||
RUN addgroup postfix access
|
RUN addgroup postfix access
|
||||||
|
@ -9,7 +9,7 @@ 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
|
wildcard_sender bool default false
|
||||||
);
|
);
|
||||||
|
|
||||||
create table if not exists virtual_aliases (
|
create table if not exists virtual_aliases (
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
compatibility_level = 2
|
compatibility_level = 3.7
|
||||||
|
|
||||||
mail_owner = postfix
|
mail_owner = postfix
|
||||||
myhostname = {{getenv "MYHOSTNAME"}}
|
myhostname = {{getenv "MYHOSTNAME"}}
|
||||||
mydomain = {{getenv "MYDOMAIN"}}
|
mydomain = {{getenv "MYDOMAIN"}}
|
||||||
myorigin = $mydomain
|
myorigin = $mydomain
|
||||||
mydestination = $myhostname, localhost
|
|
||||||
|
|
||||||
proxy_interfaces = {{getenv "EXTERNAL_IP"}}
|
|
||||||
|
|
||||||
unknown_local_recipient_reject_code = 550
|
unknown_local_recipient_reject_code = 550
|
||||||
mynetworks_style = host
|
|
||||||
relay_domains = $mydestination
|
relay_domains = $mydestination
|
||||||
recipient_delimiter = +
|
recipient_delimiter = +
|
||||||
|
|
||||||
@ -59,8 +55,11 @@ smtpd_sasl_auth_enable = yes
|
|||||||
smtpd_tls_auth_only = yes
|
smtpd_tls_auth_only = yes
|
||||||
smtpd_sasl_tls_security_options = noanonymous
|
smtpd_sasl_tls_security_options = noanonymous
|
||||||
|
|
||||||
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination
|
smtpd_relay_restrictions =
|
||||||
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination, reject_unverified_recipient
|
permit_mynetworks
|
||||||
|
permit_sasl_authenticated
|
||||||
|
defer_unauth_destination
|
||||||
|
reject_sender_login_mismatch
|
||||||
|
|
||||||
smtpd_sender_restrictions = reject_sender_login_mismatch
|
smtpd_sender_restrictions = reject_sender_login_mismatch
|
||||||
smtpd_sender_login_maps = pgsql:/etc/postfix/pgsql-login-maps.cf
|
smtpd_sender_login_maps = pgsql:/etc/postfix/pgsql-login-maps.cf
|
||||||
|
@ -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 AND domain_name = '%d'
|
||||||
|
Loading…
Reference in New Issue
Block a user