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 atelier@${domain} public-inbox@localhost
14 bar@${domain} public-inbox@localhost
15 contact@${domain} public-inbox@localhost
16 ecole@${domain} public-inbox@localhost
17 environnement@${domain} public-inbox@localhost
18 labo@${domain} public-inbox@localhost
19 machines@${domain} public-inbox@localhost
20 pont@${domain} public-inbox@localhost
21 test@${domain} public-inbox@localhost
25 "/var/lib/acme/${domain}/key.pem"
26 "/var/lib/acme/${domain}/fullchain.pem"
28 "smtp.${domain}" = chain;
29 "mail.${domain}" = chain;
32 virtual_mailbox_domains = [
35 virtual_mailbox_maps = [
36 # Map the main address and aliases to the main mail address.
37 # This is checked by permit_auth_recipient
38 ("ldap:"+pkgs.writeText "ldap-mail-${domain}.cf" ''
42 server_host = ldapi://
45 search_base = ou=posix,${domainSuffix}
48 query_filter = (&(|(mail=%s)(mailAlias=%s))(mailEnabled=TRUE))
50 result_attribute = mail
53 # Map MAIL FROM addresses to the SASL login names allowed to use it.
54 smtpd_sender_login_maps = [
55 ("ldap:"+pkgs.writeText "ldap-senders-${domain}.cf" ''
59 server_host = ldapi://
62 search_base = ou=posix,${domainSuffix}
65 query_filter = (&(|(mail=%s)(mailAlias=%s))(mailEnabled=TRUE))
66 result_format = %s@${domain}
67 result_attribute = uid
72 security.acme.certs."${domain}" = {
73 postRun = "systemctl reload postfix";
75 systemd.services.postfix = {
76 wants = [ "acme-selfsigned-${domain}.service" "acme-${domain}.service"];
77 after = [ "acme-selfsigned-${domain}.service" ];