add explicit catchAlls #49
This commit is contained in:
parent
03bdc59c06
commit
fc9b63f0e6
2 changed files with 20 additions and 2 deletions
11
default.nix
11
default.nix
|
@ -69,6 +69,15 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
catchAll = mkOption {
|
||||||
|
type = with types; listOf (enum cfg.domains);
|
||||||
|
example = ["example.com" "example2.com"];
|
||||||
|
default = [];
|
||||||
|
description = ''
|
||||||
|
For which domains should this account act as a catch all?
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
sieveScript = mkOption {
|
sieveScript = mkOption {
|
||||||
type = with types; nullOr lines;
|
type = with types; nullOr lines;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -141,7 +150,7 @@ in
|
||||||
"abuse@example.com" = "user1@example.com";
|
"abuse@example.com" = "user1@example.com";
|
||||||
};
|
};
|
||||||
description = ''
|
description = ''
|
||||||
Alias for extraVirtualAliases.
|
Alias for extraVirtualAliases. Deprecated.
|
||||||
'';
|
'';
|
||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
|
|
|
@ -29,6 +29,13 @@ let
|
||||||
in map (from: "${from} ${to}") value.aliases)
|
in map (from: "${from} ${to}") value.aliases)
|
||||||
cfg.loginAccounts);
|
cfg.loginAccounts);
|
||||||
|
|
||||||
|
# catchAllPostfix :: [ String ]
|
||||||
|
catchAllPostfix = lib.flatten (lib.mapAttrsToList
|
||||||
|
(name: value:
|
||||||
|
let to = name;
|
||||||
|
in map (from: "@${from} ${to}") value.catchAll)
|
||||||
|
cfg.loginAccounts);
|
||||||
|
|
||||||
# extra_valiases_postfix :: [ String ]
|
# extra_valiases_postfix :: [ String ]
|
||||||
# TODO: Remove virtualAliases when deprecated -> removed
|
# TODO: Remove virtualAliases when deprecated -> removed
|
||||||
extra_valiases_postfix = (map
|
extra_valiases_postfix = (map
|
||||||
|
@ -53,7 +60,9 @@ let
|
||||||
vaccounts_identity = map accountToIdentity (lib.attrValues cfg.loginAccounts);
|
vaccounts_identity = map accountToIdentity (lib.attrValues cfg.loginAccounts);
|
||||||
|
|
||||||
# valiases_file :: Path
|
# valiases_file :: Path
|
||||||
valiases_file = builtins.toFile "valias" (lib.concatStringsSep "\n" all_valiases_postfix);
|
valiases_file = builtins.toFile "valias"
|
||||||
|
(lib.concatStringsSep "\n" (all_valiases_postfix ++
|
||||||
|
catchAllPostfix));
|
||||||
|
|
||||||
# vhosts_file :: Path
|
# vhosts_file :: Path
|
||||||
vhosts_file = builtins.toFile "vhosts" (concatStringsSep "\n" cfg.domains);
|
vhosts_file = builtins.toFile "vhosts" (concatStringsSep "\n" cfg.domains);
|
||||||
|
|
Loading…
Reference in a new issue