blob: 892b684d82e36197c548f41ffeffa00fd29342f9 (
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
{
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];
};
}));
};
}
|