From 7023c328d9dc0a8da4a93ed605549c6883bf8544 Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Thu, 14 Mar 2024 00:09:06 +0100 Subject: [PATCH] mail: move mailman options to mailman.nix --- modules/mail/mailman.nix | 9 +++++++++ modules/mail/postfix.nix | 8 +------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/mail/mailman.nix b/modules/mail/mailman.nix index 9b691f0..c8dba9b 100644 --- a/modules/mail/mailman.nix +++ b/modules/mail/mailman.nix @@ -40,6 +40,15 @@ superUserGroup = "cn=admins,ou=groups,dc=ifsr,dc=de"; }; }; + services.postfix = { + relayDomains = [ "hash:/var/lib/mailman/data/postfix_domains" ]; + config = { + mailbox_transport = "lmtp:unix:/run/dovecot2/dovecot-lmtp"; + transport_maps = [ "hash:/var/lib/mailman/data/postfix_lmtp" ]; + virtual_alias_maps = [ "hash:/var/lib/mailman/data/postfix_vmap" ]; + local_recipient_maps = [ "hash:/var/lib/mailman/data/postfix_lmtp" ]; + }; + }; services.postgresql = { enable = true; ensureUsers = [ diff --git a/modules/mail/postfix.nix b/modules/mail/postfix.nix index 4a79e04..fb5887a 100644 --- a/modules/mail/postfix.nix +++ b/modules/mail/postfix.nix @@ -37,7 +37,6 @@ in networksStyle = "host"; # localhost and own public IP sslCert = "/var/lib/acme/${hostname}/fullchain.pem"; sslKey = "/var/lib/acme/${hostname}/key.pem"; - relayDomains = [ "hash:/var/lib/mailman/data/postfix_domains" ]; config = { home_mailbox = "Maildir/"; # 25 MiB @@ -94,12 +93,7 @@ in smtpd_sasl_auth_enable = true; smtpd_sasl_path = "/var/lib/postfix/auth"; smtpd_sasl_type = "dovecot"; - #mailman stuff - mailbox_transport = "lmtp:unix:/run/dovecot2/dovecot-lmtp"; - - transport_maps = [ "hash:/var/lib/mailman/data/postfix_lmtp" ]; - virtual_alias_maps = [ "hash:/var/lib/mailman/data/postfix_vmap" ]; - local_recipient_maps = [ "hash:/var/lib/mailman/data/postfix_lmtp" "ldap:${config.sops.secrets."postfix_ldap_aliases".path}" "$alias_maps" ]; + local_recipient_maps = [ "ldap:${config.sops.secrets."postfix_ldap_aliases".path}" "$alias_maps" ]; }; }; };