postfix: deprecated `sslCACert` in favour of `tlsTrustedAuthorities`
`sslCACert` was used for trust store of client and server certificates. Since `smtpd_tls_ask_ccert` defaults to no the setup of `smtpd_tls_CApath` was removed. >By default (see smtpd_tls_ask_ccert), client certificates are not requested, and smtpd_tls_CApath should remain empty. see http://www.postfix.org/postconf.5.html#smtpd_tls_CAfile
This commit is contained in:
parent
9d697837f0
commit
632104e5a4
|
@ -119,6 +119,11 @@ systemd.services.mysql.serviceConfig.ReadWritePaths = [ "/var/data" ];
|
||||||
feature is disabled by default.
|
feature is disabled by default.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<varname>services.postfix.sslCACert</varname> was replaced by <varname>services.postfix.tlsTrustedAuthorities</varname> which now defaults to system certifcate authorities.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
|
@ -466,18 +466,20 @@ in
|
||||||
";
|
";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tlsTrustedAuthorities = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
|
||||||
|
description = ''
|
||||||
|
File containing trusted certification authorities (CA) to verify certificates of mailservers contacted for mail delivery. This basically sets smtp_tls_CAfile and enables opportunistic tls. Defaults to NixOS trusted certification authorities.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
sslCert = mkOption {
|
sslCert = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "";
|
default = "";
|
||||||
description = "SSL certificate to use.";
|
description = "SSL certificate to use.";
|
||||||
};
|
};
|
||||||
|
|
||||||
sslCACert = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "";
|
|
||||||
description = "SSL certificate of CA.";
|
|
||||||
};
|
|
||||||
|
|
||||||
sslKey = mkOption {
|
sslKey = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "";
|
default = "";
|
||||||
|
@ -771,14 +773,16 @@ in
|
||||||
recipient_canonical_classes = [ "envelope_recipient" ];
|
recipient_canonical_classes = [ "envelope_recipient" ];
|
||||||
}
|
}
|
||||||
// optionalAttrs cfg.enableHeaderChecks { header_checks = [ "regexp:/etc/postfix/header_checks" ]; }
|
// optionalAttrs cfg.enableHeaderChecks { header_checks = [ "regexp:/etc/postfix/header_checks" ]; }
|
||||||
|
// optionalAttrs (cfg.tlsTrustedAuthorities != "") {
|
||||||
|
smtp_tls_CAfile = cfg.tlsTrustedAuthorities;
|
||||||
|
smtp_tls_security_level = "may";
|
||||||
|
}
|
||||||
// optionalAttrs (cfg.sslCert != "") {
|
// optionalAttrs (cfg.sslCert != "") {
|
||||||
smtp_tls_CAfile = cfg.sslCACert;
|
|
||||||
smtp_tls_cert_file = cfg.sslCert;
|
smtp_tls_cert_file = cfg.sslCert;
|
||||||
smtp_tls_key_file = cfg.sslKey;
|
smtp_tls_key_file = cfg.sslKey;
|
||||||
|
|
||||||
smtp_tls_security_level = "may";
|
smtp_tls_security_level = "may";
|
||||||
|
|
||||||
smtpd_tls_CAfile = cfg.sslCACert;
|
|
||||||
smtpd_tls_cert_file = cfg.sslCert;
|
smtpd_tls_cert_file = cfg.sslCert;
|
||||||
smtpd_tls_key_file = cfg.sslKey;
|
smtpd_tls_key_file = cfg.sslKey;
|
||||||
|
|
||||||
|
@ -900,4 +904,9 @@ in
|
||||||
services.postfix.mapFiles.client_access = checkClientAccessFile;
|
services.postfix.mapFiles.client_access = checkClientAccessFile;
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
(mkRemovedOptionModule [ "services" "postfix" "sslCACert" ]
|
||||||
|
"services.postfix.sslCACert was replaced by services.postfix.tlsTrustedAuthorities. In case you intend that your server should validate requested client certificates use services.postfix.extraConfig.")
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue