Merge branch 'postfix-config' into 'master'

postfix: migrate more options to services.postfix.config

See merge request simple-nixos-mailserver/nixos-mailserver!418
This commit is contained in:
Martin Weinelt 2025-06-16 05:34:22 +00:00
commit 7405122dde

View file

@ -248,8 +248,6 @@ in
services.postfix = { services.postfix = {
enable = true; enable = true;
hostname = "${cfg.sendingFqdn}";
networksStyle = "host";
mapFiles."valias" = valiases_file; mapFiles."valias" = valiases_file;
mapFiles."regex_valias" = regex_valiases_file; mapFiles."regex_valias" = regex_valiases_file;
mapFiles."vaccounts" = vaccounts_file; mapFiles."vaccounts" = vaccounts_file;
@ -266,13 +264,8 @@ in
]); ]);
config = { config = {
smtpd_tls_chain_files = [ myhostname = cfg.sendingFqdn;
"${keyPath}" mydestination = ""; # disable local mail delivery
"${certificatePath}"
];
# Extra Config
mydestination = "";
recipient_delimiter = cfg.recipientDelimiter; recipient_delimiter = cfg.recipientDelimiter;
smtpd_banner = "${cfg.fqdn} ESMTP NO UCE"; smtpd_banner = "${cfg.fqdn} ESMTP NO UCE";
disable_vrfy_command = true; disable_vrfy_command = true;
@ -299,6 +292,7 @@ in
] ]
); );
virtual_transport = "lmtp:unix:/run/dovecot2/dovecot-lmtp"; virtual_transport = "lmtp:unix:/run/dovecot2/dovecot-lmtp";
# Avoid leakage of X-Original-To, X-Delivered-To headers between recipients # Avoid leakage of X-Original-To, X-Delivered-To headers between recipients
lmtp_destination_recipient_limit = "1"; lmtp_destination_recipient_limit = "1";
@ -325,6 +319,12 @@ in
"check_policy_service unix:/run/dovecot2/quota-status" "check_policy_service unix:/run/dovecot2/quota-status"
]; ];
# The X509 private key followed by the corresponding certificate
smtpd_tls_chain_files = [
"${keyPath}"
"${certificatePath}"
];
# TLS for incoming mail is optional # TLS for incoming mail is optional
smtpd_tls_security_level = "may"; smtpd_tls_security_level = "may";