diff options
author | Stefan Frijters <sfrijters@gmail.com> | 2023-02-03 11:11:43 +0100 |
---|---|---|
committer | Stefan Frijters <sfrijters@gmail.com> | 2023-02-03 11:29:24 +0100 |
commit | 11fa179533f0b4328647072092acd838f5313757 (patch) | |
tree | 4328ce53dc9f5e308afc092eab12f3258fdd130a /nixos/modules/services/mail/postfix.nix | |
parent | 24037e18185448b0563db1b89558d8d793ec27f2 (diff) |
nixos/postfix: restrict inet_protocols to ipv4 when ipv6 is disabled
In the previous state, postfix would still try to use IPv6 addresses, even when it is disabled in the global networking config. Cf. https://www.postfix.org/postconf.5.html: With Postfix 2.8 and earlier the default is "ipv4". For backwards compatibility with these releases, the Postfix 2.9 and later upgrade procedure appends an explicit "inet_protocols = ipv4" setting to main.cf when no explicit setting is present. This compatibility workaround will be phased out as IPv6 deployment becomes more common. inet_protocols = ipv4 inet_protocols = all (DEFAULT) inet_protocols = ipv6 inet_protocols = ipv4, ipv6 So setting it to 'all' conditionally does not help, as we are now on version 3.x.
Diffstat (limited to 'nixos/modules/services/mail/postfix.nix')
-rw-r--r-- | nixos/modules/services/mail/postfix.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/services/mail/postfix.nix b/nixos/modules/services/mail/postfix.nix index d01734d61e87e..852340c05aa7a 100644 --- a/nixos/modules/services/mail/postfix.nix +++ b/nixos/modules/services/mail/postfix.nix @@ -809,7 +809,7 @@ in // optionalAttrs (cfg.relayHost != "") { relayhost = if cfg.lookupMX then "${cfg.relayHost}:${toString cfg.relayPort}" else "[${cfg.relayHost}]:${toString cfg.relayPort}"; } - // optionalAttrs config.networking.enableIPv6 { inet_protocols = mkDefault "all"; } + // optionalAttrs (!config.networking.enableIPv6) { inet_protocols = mkDefault "ipv4"; } // optionalAttrs (cfg.networks != null) { mynetworks = cfg.networks; } // optionalAttrs (cfg.networksStyle != "") { mynetworks_style = cfg.networksStyle; } // optionalAttrs (cfg.hostname != "") { myhostname = cfg.hostname; } |