diff options
Diffstat (limited to 'hosts/surtr/email/default.nix')
-rw-r--r-- | hosts/surtr/email/default.nix | 20 |
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 |