diff options
author | tv <tv@krebsco.de> | 2020-12-27 15:47:34 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2020-12-27 15:47:34 +0100 |
commit | f78ceaffa2c35cf6b665ed827018ad080cf51aa9 (patch) | |
tree | 922126984d5d45d81537f0f4e9a9319010e7fe6b /krebs/3modules | |
parent | 20d546e8b6755577f79e2df71281ca2b93ef405c (diff) | |
parent | 2cbed4cab9bf40fa6d712375b740bfcd41503470 (diff) |
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'krebs/3modules')
-rw-r--r-- | krebs/3modules/exim-retiolum.nix | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/krebs/3modules/exim-retiolum.nix b/krebs/3modules/exim-retiolum.nix index 118a8b2d5..a16661c9f 100644 --- a/krebs/3modules/exim-retiolum.nix +++ b/krebs/3modules/exim-retiolum.nix @@ -10,6 +10,11 @@ with import <stockholm/lib>; (s: substring 1 (stringLength s - 2) s) (toJSON value); + to-lsearch = concatMapStrings ({ from, to, ... }: "${from}: ${to}\n"); + lsearch = mapAttrs (name: set: toFile name (to-lsearch set)) ({ + inherit (cfg) system-aliases; + }); + in { options.krebs.exim-retiolum = { enable = mkEnableOption "krebs.exim-retiolum"; @@ -59,6 +64,19 @@ in { }; }; }; + system-aliases = mkOption { + type = types.listOf (types.submodule ({ + options = { + from = mkOption { + type = types.str; # TODO e-mail address + }; + to = mkOption { + type = types.str; # TODO e-mail address / TODO listOf + }; + }; + })); + default = []; + }; }; imports = [ { @@ -145,6 +163,11 @@ in { begin routers + system_aliases: + debug_print = "R: system_aliases for $local_part@$domain" + driver = redirect + data = ''${lookup{$local_part}lsearch{${lsearch.system-aliases}}} + local: driver = accept domains = +local_domains |