summaryrefslogtreecommitdiff
path: root/hosts/surtr/email/default.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-05-05 23:53:26 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2022-05-05 23:53:26 +0200
commitc0391046dc0d4859841c56788d53fb37c7e84e15 (patch)
tree0652e6296f3c3f4ec93df6b8edae6ce953dd9d9e /hosts/surtr/email/default.nix
parentfbe1b755f3cfc0eda924c0810a938c8ab157933c (diff)
downloadnixos-c0391046dc0d4859841c56788d53fb37c7e84e15.tar
nixos-c0391046dc0d4859841c56788d53fb37c7e84e15.tar.gz
nixos-c0391046dc0d4859841c56788d53fb37c7e84e15.tar.bz2
nixos-c0391046dc0d4859841c56788d53fb37c7e84e15.tar.xz
nixos-c0391046dc0d4859841c56788d53fb37c7e84e15.zip
surtr: ...
Diffstat (limited to 'hosts/surtr/email/default.nix')
-rw-r--r--hosts/surtr/email/default.nix20
1 files changed, 15 insertions, 5 deletions
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 {
146 dbname = email 146 dbname = email
147 query = SELECT 1 FROM virtual_mailbox_mapping WHERE lookup = '%s' 147 query = SELECT 1 FROM virtual_mailbox_mapping WHERE lookup = '%s'
148 ''}''; 148 ''}'';
149 lmtp_generic_maps = ''pgsql:${pkgs.writeText "virtual_mailbox_maps.cf" ''
150 hosts = postgresql:///email
151 dbname = email
152 query = SELECT mailbox FROM virtual_mailbox_mapping WHERE lookup = '%s'
153 ''}'';
154 virtual_transport = "lmtp:unix:/run/postfix/dovecot-lmtp"; 149 virtual_transport = "lmtp:unix:/run/postfix/dovecot-lmtp";
155 }; 150 };
156 masterConfig = { 151 masterConfig = {
@@ -349,6 +344,21 @@ in {
349 args = ${dovecotSqlConf} 344 args = ${dovecotSqlConf}
350 } 345 }
351 346
347 protocol lmtp {
348 userdb {
349 driver = sql
350 args = ${pkgs.writeText "dovecot-sql.conf" ''
351 driver = pgsql
352 connect = dbname=email
353 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)
354 ''}
355
356 skip = never
357 result_failure = return-fail
358 result_internalfail = return-fail
359 }
360 }
361
352 mail_plugins = $mail_plugins quota 362 mail_plugins = $mail_plugins quota
353 mailbox_list_index = yes 363 mailbox_list_index = yes
354 postmaster_address = postmaster@yggdrasil.li 364 postmaster_address = postmaster@yggdrasil.li