1 { pkgs, lib, config, ... }:
3 inherit (pkgs.lib) loadFile;
4 domain = "sourcephile.fr";
5 domainSuffix = "dc=sourcephile,dc=fr";
12 root@${domain} julm+root@${domain}
13 equipage@${domain} public-inbox
17 "/var/lib/acme/${domain}/key.pem"
18 "/var/lib/acme/${domain}/fullchain.pem"
20 "smtp.${domain}" = chain;
21 "mail.${domain}" = chain;
24 virtual_mailbox_domains = [ domain ];
25 virtual_mailbox_maps = [
26 # Map the main address and aliases to the main mail address.
27 # This is checked by permit_auth_recipient
28 ("ldap:"+pkgs.writeText "ldap-mail-${domain}.cf" ''
32 server_host = ldapi://
35 search_base = ou=posix,${domainSuffix}
38 query_filter = (&(|(mail=%s)(mailAlias=%s))(mailEnabled=TRUE))
40 result_attribute = mail
43 # Map MAIL FROM addresses to the SASL login names allowed to use it.
44 smtpd_sender_login_maps = [
45 ("ldap:"+pkgs.writeText "ldap-senders-${domain}.cf" ''
49 server_host = ldapi://
52 search_base = ou=posix,${domainSuffix}
55 query_filter = (&(|(mail=%s)(mailAlias=%s))(mailEnabled=TRUE))
56 result_format = %s@${domain}
57 result_attribute = uid
62 security.acme.certs."${domain}" = {
63 postRun = "systemctl reload postfix";
65 systemd.services.postfix = {
66 wants = [ "acme-selfsigned-${domain}.service" "acme-${domain}.service"];
67 after = [ "acme-selfsigned-${domain}.service" ];