1 { pkgs, lib, config, ... }:
3 domain = "sourcephile.fr";
4 domainSuffix = "dc=sourcephile,dc=fr";
11 root@${domain} julm+root@${domain}
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 = [
27 virtual_mailbox_maps = [
28 # Map the main address and aliases to the main mail address.
29 # This is checked by permit_auth_recipient
30 ("ldap:"+pkgs.writeText "ldap-mail-${domain}.cf" ''
34 server_host = ldapi://
37 search_base = ou=posix,${domainSuffix}
40 query_filter = (&(|(mail=%s)(mailAlias=%s))(mailEnabled=TRUE))
42 result_attribute = mail
45 # Map MAIL FROM addresses to the SASL login names allowed to use it.
46 smtpd_sender_login_maps = [
47 ("ldap:"+pkgs.writeText "ldap-senders-${domain}.cf" ''
51 server_host = ldapi://
54 search_base = ou=posix,${domainSuffix}
57 query_filter = (&(|(mail=%s)(mailAlias=%s))(mailEnabled=TRUE))
58 result_format = %s@${domain}
59 result_attribute = uid
64 security.acme.certs."${domain}" = {
65 postRun = "systemctl reload postfix";
67 systemd.services.postfix = {
68 wants = [ "openldap.service" "acme-selfsigned-${domain}.service" "acme-${domain}.service"];
69 after = [ "openldap.service" "acme-selfsigned-${domain}.service" ];