diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-05-05 22:02:25 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-05-05 22:02:25 +0200 |
commit | bb9860c49f37d8e0b08275e2ad6762f36219e918 (patch) | |
tree | 6dca736eaa70e24749ec9c064c101c89845190cc /hosts/surtr/email/default.nix | |
parent | b52c1d4f8e5501728f52903cf05cc32d8a8f8bfa (diff) | |
download | nixos-bb9860c49f37d8e0b08275e2ad6762f36219e918.tar nixos-bb9860c49f37d8e0b08275e2ad6762f36219e918.tar.gz nixos-bb9860c49f37d8e0b08275e2ad6762f36219e918.tar.bz2 nixos-bb9860c49f37d8e0b08275e2ad6762f36219e918.tar.xz nixos-bb9860c49f37d8e0b08275e2ad6762f36219e918.zip |
surtr: ...
Diffstat (limited to 'hosts/surtr/email/default.nix')
-rw-r--r-- | hosts/surtr/email/default.nix | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/hosts/surtr/email/default.nix b/hosts/surtr/email/default.nix index a6fbcaf3..f4543bf4 100644 --- a/hosts/surtr/email/default.nix +++ b/hosts/surtr/email/default.nix | |||
@@ -137,11 +137,13 @@ in { | |||
137 | recipient_canonical_classes = ["envelope_recipient" "header_recipient"]; | 137 | recipient_canonical_classes = ["envelope_recipient" "header_recipient"]; |
138 | 138 | ||
139 | virtual_mailbox_domains = ''pgsql:${pkgs.writeText "virtual_mailbox_domains.cf" '' | 139 | virtual_mailbox_domains = ''pgsql:${pkgs.writeText "virtual_mailbox_domains.cf" '' |
140 | hosts = postgresql://localhost/emails | 140 | hosts = postgresql://localhost |
141 | dbname = emails | ||
141 | query = SELECT domain FROM virtual_mailbox_domain WHERE domain = '%s' | 142 | query = SELECT domain FROM virtual_mailbox_domain WHERE domain = '%s' |
142 | ''}''; | 143 | ''}''; |
143 | virtual_mailbox_maps = ''pgsql:${pkgs.writeText "virtual_mailbox_maps.cf" '' | 144 | virtual_mailbox_maps = ''pgsql:${pkgs.writeText "virtual_mailbox_maps.cf" '' |
144 | hosts = postgresql://localhost/emails | 145 | hosts = postgresql://localhost |
146 | dbname = emails | ||
145 | query = SELECT mailbox FROM virtual_mailbox_mapping WHERE mailbox = '%s' | 147 | query = SELECT mailbox FROM virtual_mailbox_mapping WHERE mailbox = '%s' |
146 | ''}''; | 148 | ''}''; |
147 | virtual_transport = "lmtp:unix:/run/postfix/dovecot-lmtp"; | 149 | virtual_transport = "lmtp:unix:/run/postfix/dovecot-lmtp"; |
@@ -280,7 +282,14 @@ in { | |||
280 | mailLocation = "maildir:/var/lib/mail/%u/maildir:UTF-8"; | 282 | mailLocation = "maildir:/var/lib/mail/%u/maildir:UTF-8"; |
281 | modules = with pkgs; [ dovecot_pigeonhole ]; | 283 | modules = with pkgs; [ dovecot_pigeonhole ]; |
282 | protocols = [ "lmtp" "sieve" ]; | 284 | protocols = [ "lmtp" "sieve" ]; |
283 | extraConfig = '' | 285 | extraConfig = let |
286 | dovecotSqlConf = pkgs.writeText "dovecot-sql.conf" '' | ||
287 | driver = pgsql | ||
288 | connect = dbname=email | ||
289 | password_query = SELECT user, quota_rule FROM imap_user WHERE user = '%u' | ||
290 | user_query = SELECT user, quota_rule FROM imap_user WHERE user = '%u' | ||
291 | ''; | ||
292 | in '' | ||
284 | mail_home = /var/lib/mail/%u | 293 | mail_home = /var/lib/mail/%u |
285 | 294 | ||
286 | local_name imap.bouncy.email { | 295 | local_name imap.bouncy.email { |
@@ -306,11 +315,12 @@ in { | |||
306 | 315 | ||
307 | userdb { | 316 | userdb { |
308 | driver = sql | 317 | driver = sql |
309 | args = ${pkgs.writeText "dovecot-sql.conf" '' | 318 | args = ${dovecotSqlConf} |
310 | driver = pgsql | 319 | default_fields = uid=dovecot2 gid=dovecot2 nopassword |
311 | connect = dbname=email | 320 | } |
312 | user_query = SELECT user, quota_rule FROM imap_user WHERE user = '%u' | 321 | passdb { |
313 | ''} | 322 | driver = sql |
323 | args = ${dovecotSqlConf} | ||
314 | default_fields = uid=dovecot2 gid=dovecot2 nopassword | 324 | default_fields = uid=dovecot2 gid=dovecot2 nopassword |
315 | } | 325 | } |
316 | 326 | ||