aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/tools/mail/mta-sts.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-07-02 13:05:44 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-07-02 13:06:15 +0200
commit8cc7cb6bebeb227c5f9405c05e953f15f949cfff (patch)
treec92ca8b52a523fb97d4d91862d02803a8fc73236 /modules/private/websites/tools/mail/mta-sts.nix
parent36861e9520e7d8beac401dfa222e1fd5f5bd55c5 (diff)
downloadNix-8cc7cb6bebeb227c5f9405c05e953f15f949cfff.tar.gz
Nix-8cc7cb6bebeb227c5f9405c05e953f15f949cfff.tar.zst
Nix-8cc7cb6bebeb227c5f9405c05e953f15f949cfff.zip
Follow recommendations for mta-sts formatting
Diffstat (limited to 'modules/private/websites/tools/mail/mta-sts.nix')
-rw-r--r--modules/private/websites/tools/mail/mta-sts.nix11
1 files changed, 5 insertions, 6 deletions
diff --git a/modules/private/websites/tools/mail/mta-sts.nix b/modules/private/websites/tools/mail/mta-sts.nix
index c5d4306..c5f71f0 100644
--- a/modules/private/websites/tools/mail/mta-sts.nix
+++ b/modules/private/websites/tools/mail/mta-sts.nix
@@ -18,12 +18,11 @@ let
18 (lib.attrsets.filterAttrs (n: v: v.mx.enable) config.myEnv.servers); 18 (lib.attrsets.filterAttrs (n: v: v.mx.enable) config.myEnv.servers);
19 # FIXME: increase the id number in modules/private/dns.nix when this 19 # FIXME: increase the id number in modules/private/dns.nix when this
20 # file change (date -u +'%Y%m%d%H%M%S'Z) 20 # file change (date -u +'%Y%m%d%H%M%S'Z)
21 file = domain: pkgs.writeText "mta-sts-${domain.domain}.txt" '' 21 file = domain: pkgs.writeText "mta-sts-${domain.domain}.txt" (
22 version: STSv1 22 builtins.concatStringsSep "\r\n" ([ "version: STSv1" "mode: testing" ]
23 mode: testing 23 ++ (map (v: "mx: ${v}.${domain.mail}") mxes)
24 ${builtins.concatStringsSep "\n" (map (v: "mx: ${v}.${domain.mail}") mxes)} 24 ++ [ "max_age: 604800" ]
25 max_age: 604800 25 ));
26 '';
27 root = pkgs.runCommand "mta-sts_root" {} '' 26 root = pkgs.runCommand "mta-sts_root" {} ''
28 mkdir -p $out 27 mkdir -p $out
29 ${builtins.concatStringsSep "\n" (map (d: 28 ${builtins.concatStringsSep "\n" (map (d: