From ad933bb09650311127f139a6d231d7943ee8a1e8 Mon Sep 17 00:00:00 2001 From: Drew Hess Date: Wed, 25 Oct 2017 10:11:55 -0700 Subject: postfix: add relayPort option. (#30520) --- nixos/modules/services/mail/postfix.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'nixos/modules/services/mail') diff --git a/nixos/modules/services/mail/postfix.nix b/nixos/modules/services/mail/postfix.nix index 2185484827de..1fef9ac6ec90 100644 --- a/nixos/modules/services/mail/postfix.nix +++ b/nixos/modules/services/mail/postfix.nix @@ -62,7 +62,9 @@ let shlib_directory = false; relayhost = if cfg.lookupMX || cfg.relayHost == "" then cfg.relayHost - else "[${cfg.relayHost}]"; + else + "[${cfg.relayHost}]" + + optionalString (cfg.relayPort != null) ":${toString cfg.relayPort}"; mail_spool_directory = "/var/spool/mail/"; setgid_group = setgidGroup; } @@ -458,6 +460,17 @@ in "; }; + relayPort = mkOption { + type = types.nullOr types.int; + default = null; + example = 587; + description = " + Specify an optional port for outbound mail relay. (Note: + only used if an explicit is + defined.) + "; + }; + lookupMX = mkOption { type = types.bool; default = false; -- cgit 1.4.1