summary refs log tree commit diff
path: root/nixos/modules/services/mail
diff options
context:
space:
mode:
authorDrew Hess <web-github@drewhess.com>2017-10-25 10:11:55 -0700
committerJoachim Schiele <js@lastlog.de>2017-10-25 19:11:55 +0200
commitad933bb09650311127f139a6d231d7943ee8a1e8 (patch)
treeb9a7672f7b4f86887f5f57c192a87e4fcba40799 /nixos/modules/services/mail
parent2351947c574bd05e5d1e4b480b95b71c742767d3 (diff)
downloadnixlib-ad933bb09650311127f139a6d231d7943ee8a1e8.tar
nixlib-ad933bb09650311127f139a6d231d7943ee8a1e8.tar.gz
nixlib-ad933bb09650311127f139a6d231d7943ee8a1e8.tar.bz2
nixlib-ad933bb09650311127f139a6d231d7943ee8a1e8.tar.lz
nixlib-ad933bb09650311127f139a6d231d7943ee8a1e8.tar.xz
nixlib-ad933bb09650311127f139a6d231d7943ee8a1e8.tar.zst
nixlib-ad933bb09650311127f139a6d231d7943ee8a1e8.zip
postfix: add relayPort option. (#30520)
Diffstat (limited to 'nixos/modules/services/mail')
-rw-r--r--nixos/modules/services/mail/postfix.nix15
1 files changed, 14 insertions, 1 deletions
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 <option>relayHost</option> is
+          defined.)
+        ";
+      };
+
       lookupMX = mkOption {
         type = types.bool;
         default = false;