nixos/postfix: separate list option elements with commas

This commit is contained in:
Franz Pletz 2018-01-26 14:01:15 +01:00
parent 9bd7798d9c
commit cb7fe51ee6
No known key found for this signature in database
GPG Key ID: 846FDED7792617B4

View File

@ -15,20 +15,18 @@ let
haveVirtual = cfg.virtual != ""; haveVirtual = cfg.virtual != "";
clientAccess = clientAccess =
if (cfg.dnsBlacklistOverrides != "") optional (cfg.dnsBlacklistOverrides != "")
then [ "check_client_access hash:/etc/postfix/client_access" ] "check_client_access hash:/etc/postfix/client_access";
else [];
dnsBl = dnsBl =
if (cfg.dnsBlacklists != []) optionals (cfg.dnsBlacklists != [])
then [ (concatStringsSep ", " (map (s: "reject_rbl_client " + s) cfg.dnsBlacklists)) ] (map (s: "reject_rbl_client " + s) cfg.dnsBlacklists);
else [];
clientRestrictions = concatStringsSep ", " (clientAccess ++ dnsBl); clientRestrictions = concatStringsSep ", " (clientAccess ++ dnsBl);
mainCf = let mainCf = let
escape = replaceStrings ["$"] ["$$"]; escape = replaceStrings ["$"] ["$$"];
mkList = items: "\n " + concatStringsSep "\n " items; mkList = items: "\n " + concatStringsSep ",\n " items;
mkVal = value: mkVal = value:
if isList value then mkList value if isList value then mkList value
else " " + (if value == true then "yes" else " " + (if value == true then "yes"