blob: 40a557482d43c6e7596afdc1eb96530a88f4907f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
{ config, lib, ... }:
with lib; let
inherit (config.local) domains;
in
{
options.local.ns.zones = mkOption {
type = with lib.types; attrsOf (submodule ({ config, name, ... }: {
options.localMX = {
enable = mkEnableOption "local MX settings";
};
config = mkIf config.localMX.enable {
mx = [
{ name = "@"; priority = 10; host = "${domains.smtp.gated}."; }
{ name = "@"; priority = 20; host = "${domains.smtp-backup.main}."; }
# Many thanks to junkemailfilter.com for all their years of service. RIP.
#{ name = "@"; priority = 30; host = "mxbackup1.junkemailfilter.com."; }
#{ name = "@"; priority = 40; host = "mxbackup2.junkemailfilter.com."; }
];
txt = [
{ name = "@"; text = "v=spf1 mx a -all"; }
{ name = "_dmarc"; text = "v=DMARC1;p=reject;sp=reject;adkim=r;aspf=r;fo=1;rf=afrf;rua=mailto:postmaster@${name}"; }
{ name = "_adsp._domainkey"; text = "dkim=all"; }
] ++ map
(selector: {
name = "${toString selector}._domainkey";
text = readFile (./dkim + "/${toString selector}.txt");
}) [ 202001 202102 202402 202408 ];
};
}));
};
}
|