From 306e45b42c14322b14f57f624585666e7bac6035 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 5 Jan 2023 16:16:19 +0100 Subject: ... --- hosts/surtr/email/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosts/surtr/email/default.nix b/hosts/surtr/email/default.nix index 0ee68599..fa939252 100644 --- a/hosts/surtr/email/default.nix +++ b/hosts/surtr/email/default.nix @@ -200,7 +200,7 @@ in { virtual_mailbox_maps = ''pgsql:${pkgs.writeText "virtual_mailbox_maps.cf" '' hosts = postgresql:///email dbname = email - query = SELECT 1 FROM virtual_mailbox_mapping WHERE lookup = '%s' + query = SELECT 1 FROM virtual_mailbox_mapping WHERE lookup = '%s' OR (lookup = regexp_replace('%s', '\+[^@]*@', '@') AND NOT EXISTS (SELECT 1 FROM virtual_mailbox_mapping WHERE lookup = '%s')) ''}''; dvlmtp_destination_recipient_limit = "1"; virtual_transport = "dvlmtp:unix:/run/postfix/dovecot-lmtp"; @@ -239,7 +239,7 @@ in { "-o" ''{smtpd_recipient_restrictions=reject_unauth_pipelining,reject_non_fqdn_recipient,reject_unknown_recipient_domain,check_recipient_access pgsql:${pkgs.writeText "check_recipient_access.cf" '' hosts = postgresql:///email dbname = email - query = SELECT action FROM virtual_mailbox_access WHERE lookup = '%s' + query = SELECT action FROM virtual_mailbox_access WHERE lookup = '%s' OR (lookup = regexp_replace('%s', '\+[^@]*@', '@') AND NOT EXISTS (SELECT 1 FROM virtual_mailbox_access WHERE lookup = '%s')) ''},permit_tls_all_clientcerts,reject}'' "-o" "milter_macro_daemon_name=surtr.yggdrasil.li" "-o" ''smtpd_milters=${config.services.opendkim.socket}'' -- cgit v1.2.3