From c0391046dc0d4859841c56788d53fb37c7e84e15 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 5 May 2022 23:53:26 +0200 Subject: surtr: ... --- hosts/surtr/email/default.nix | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'hosts/surtr/email/default.nix') diff --git a/hosts/surtr/email/default.nix b/hosts/surtr/email/default.nix index 8889991c..b3306ece 100644 --- a/hosts/surtr/email/default.nix +++ b/hosts/surtr/email/default.nix @@ -146,11 +146,6 @@ in { dbname = email query = SELECT 1 FROM virtual_mailbox_mapping WHERE lookup = '%s' ''}''; - lmtp_generic_maps = ''pgsql:${pkgs.writeText "virtual_mailbox_maps.cf" '' - hosts = postgresql:///email - dbname = email - query = SELECT mailbox FROM virtual_mailbox_mapping WHERE lookup = '%s' - ''}''; virtual_transport = "lmtp:unix:/run/postfix/dovecot-lmtp"; }; masterConfig = { @@ -349,6 +344,21 @@ in { args = ${dovecotSqlConf} } + protocol lmtp { + userdb { + driver = sql + args = ${pkgs.writeText "dovecot-sql.conf" '' + driver = pgsql + connect = dbname=email + user_query = SELECT DISTINCT ON (local IS NULL) "user", quota_rule, 'dovecot2' as uid, 'dovecot2' as gid FROM lmtp_mapping WHERE (local = '%n' AND domain = '%d') OR (local IS NULL AND domain = '%d') ORDER BY (local IS NULL ASC) + ''} + + skip = never + result_failure = return-fail + result_internalfail = return-fail + } + } + mail_plugins = $mail_plugins quota mailbox_list_index = yes postmaster_address = postmaster@yggdrasil.li -- cgit v1.2.3