]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Add some e-mail related records to DNS
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 6 Apr 2019 23:51:58 +0000 (01:51 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 6 Apr 2019 23:51:58 +0000 (01:51 +0200)
nixops/modules/dns/default.nix

index b5187a886975cd8c00c53ac04627fe1daee7c665..53d0ecef7ea4a715fc693ed5697a725442eabf35 100644 (file)
 
               ; Mail sender authentications
               ${n}                   IN TXT  "v=spf1 mx ~all"
-              _dmarc${suffix}              IN TXT  "v=DMARC1; p=none; adkim=r; aspf=r; fo=1; rua=mailto:postmaster@immae.eu; ruf=mailto:postmaster@immae.eu;"
+              _dmarc${suffix}              IN TXT  "v=DMARC1; p=quarantine; adkim=r; aspf=r; fo=1; rua=mailto:postmaster@immae.eu; ruf=mailto:postmaster@immae.eu;"
               ${if e.send then ''
               immae_eu._domainkey${suffix} IN TXT  ( "v=DKIM1; k=rsa; s=email; "
                         "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzl3vLd8W5YAuumC5+ZT9OV7/14Pmh5JYtwyqKI3cfe9NnAqInt3xO4bZ7oqIxRKWN4SD39vm7O/QOvFdBt00ENOOzdP90s5gKw6eIP/4+vPTh0IWltAsmu9B2agzdtWUE7t2xFKIzEn8l9niRE2QYbVaqZv4sub98vY55fIgFoHtjkmNC7325S8fjDJGp6OPbyhAs6Xl5/adjF"
                         "0ko4Y2p6RaxLQfjlS0bxmK4Qg6C14pIXHtzVeqOuWrwApqt5+AULSn97iUtqV/IJlEEjC6DUR44t3C/G0G/k46iFclCqRRi0hdPrOHCtZDbtMubnTN9eaUiNpkXh1WnCflHwtjQwIDAQAB" )
               '' else ""}
               '') conf.withEmail)}
-              '' else ""}
+              '' + (if conf.name == "immae.eu" then ''
+              ; ----------------- Accept DMARC reports -------------------
+              ${lib.concatStringsSep "\n" (
+                lib.flatten (
+                  map (z: map (e: "${e.domain}${if builtins.stringLength e.domain > 0 then "." else ""}${z.name}._report._dmarc IN TXT \"v=DMARC1;\"") (z.withEmail or [])) masterZones
+                )
+              )}
+              '' else "") else ""}
             '';
           }) masterZones);
     };