1 { pkgs, lib, config, ... }:
3 domain = "sourcephile.fr";
4 domainSuffix = "dc=sourcephile,dc=fr";
11 root@${domain} julm+root@${domain}
12 atelier@${domain} public-inbox@localhost
13 bar@${domain} public-inbox@localhost
14 contact@${domain} public-inbox@localhost
15 ecole@${domain} public-inbox@localhost
16 environnement@${domain} public-inbox@localhost
17 labo@${domain} public-inbox@localhost
18 hosts@${domain} public-inbox@localhost
19 pont@${domain} public-inbox@localhost
20 test@${domain} public-inbox@localhost
24 "/var/lib/acme/${domain}/key.pem"
25 "/var/lib/acme/${domain}/fullchain.pem"
27 "smtp.${domain}" = chain;
28 "mail.${domain}" = chain;
31 virtual_mailbox_domains = [
34 virtual_mailbox_maps = [
35 # Map the main address and aliases to the main mail address.
36 # This is checked by permit_auth_recipient
37 ("ldap:"+pkgs.writeText "ldap-mail-${domain}.cf" ''
41 server_host = ldapi://
44 search_base = ou=posix,${domainSuffix}
47 query_filter = (&(|(mail=%s)(mailAlias=%s))(mailEnabled=TRUE))
49 result_attribute = mail
52 # Map MAIL FROM addresses to the SASL login names allowed to use it.
53 smtpd_sender_login_maps = [
54 ("ldap:"+pkgs.writeText "ldap-senders-${domain}.cf" ''
58 server_host = ldapi://
61 search_base = ou=posix,${domainSuffix}
64 query_filter = (&(|(mail=%s)(mailAlias=%s))(mailEnabled=TRUE))
65 result_format = %s@${domain}
66 result_attribute = uid
71 security.acme.certs."${domain}" = {
72 postRun = "systemctl reload postfix";
74 systemd.services.postfix = {
75 wants = [ "openldap.service" "acme-selfsigned-${domain}.service" "acme-${domain}.service"];
76 after = [ "openldap.service" "acme-selfsigned-${domain}.service" ];