nixos/postfix: add services.postfix.canonical opt

This mirrors the services.postfix.transport and
services.postfix.virtual options we already have.
This commit is contained in:
Alyssa Ross 2021-04-04 11:56:31 +00:00
parent afca74b711
commit d45fc07bc2

View file

@ -11,6 +11,7 @@ let
haveAliases = cfg.postmasterAlias != "" || cfg.rootAlias != ""
|| cfg.extraAliases != "";
haveCanonical = cfg.canonical != "";
haveTransport = cfg.transport != "";
haveVirtual = cfg.virtual != "";
haveLocalRecipients = cfg.localRecipients != null;
@ -244,6 +245,7 @@ let
;
aliasesFile = pkgs.writeText "postfix-aliases" aliases;
canonicalFile = pkgs.writeText "postfix-canonical" cfg.canonical;
virtualFile = pkgs.writeText "postfix-virtual" cfg.virtual;
localRecipientMapFile = pkgs.writeText "postfix-local-recipient-map" (concatMapStrings (x: x + " ACCEPT\n") cfg.localRecipients);
checkClientAccessFile = pkgs.writeText "postfix-check-client-access" cfg.dnsBlacklistOverrides;
@ -529,6 +531,15 @@ in
";
};
canonical = mkOption {
type = types.lines;
default = "";
description = ''
Entries for the <citerefentry><refentrytitle>canonical</refentrytitle>
<manvolnum>5</manvolnum></citerefentry> table.
'';
};
virtual = mkOption {
type = types.lines;
default = "";
@ -941,6 +952,9 @@ in
(mkIf haveAliases {
services.postfix.aliasFiles.aliases = aliasesFile;
})
(mkIf haveCanonical {
services.postfix.mapFiles.canonical = canonicalFile;
})
(mkIf haveTransport {
services.postfix.mapFiles.transport = transportFile;
})