1 { pkgs, lib, config, ... }:
3 inherit (pkgs.lib) loadFile;
4 domain = "autogeree.net";
5 domainSuffix = "dc=autogeree,dc=net";
8 systemd.services.postfix.after = [
9 "${domain}.key.pem-key.service"
15 root@${domain} julm+root@${domain}
19 "/run/keys/${domain}.key.pem"
20 (loadFile (../../../../sec/openssl + "/${domain}/cert.self-signed.pem"))
22 "smtp.${domain}" = chain;
23 "mail.${domain}" = chain;
26 virtual_mailbox_domains = [ domain ];
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