Skip to content

Commit 24bc5d9

Browse files
committed
Allow umbriel to send emails as nixos.org
Once this change is deployed, we should be able to start sending test emails from `@nixos.org` email addresses using umbriel. I updated our SPF record in a way such that it should allow umbriel without breaking our existing email sending capabilities (ImprovMX and gandi.net). This does *not* change our MX (yet): ImprovMX will still be receiving emails send to `nixos.org`. To verify that we can receive emails sent to `nixos.org` addresses, I plan to edit `/etc/hosts` on my personal mailserver and send some test emails. Do folks have better ideas for testing this out?
1 parent 4c8902e commit 24bc5d9

File tree

5 files changed

+27
-36
lines changed

5 files changed

+27
-36
lines changed

build/pluto/prometheus/exporters/blackbox.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ in
110110
])
111111
(mkDnsSdProbe "smtp_starttls" {
112112
names = [
113-
"mail-test.nixos.org"
113+
"nixos.org"
114114
];
115115
type = "MX";
116116
port = 25;

non-critical-infra/hosts/umbriel.nixos.org/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
If you recreate `umbriel`, it will generate a new `DKIM` signature. That's ok to
66
do, but you'll need to update the corresponding `mail._domainkey.*` `TXT` DNS
77
record in `terraform/dns.tf` with the generated key in
8-
`/var/dkim/mail-test.nixos.org.mail.txt`.
8+
`/var/dkim/nixos.org.mail.txt`.
99

1010
TODO: declaratively manage the `DKIM` key once
1111
<https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/merge_requests/344>

non-critical-infra/modules/mailserver/default.nix

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
fqdn = config.networking.fqdn;
1111

12-
# TODO: change to `nixos.org` when ready
13-
domains = [ "mail-test.nixos.org" ];
12+
domains = [ "nixos.org" ];
1413
};
1514

1615
### Mailing lists go here ###
@@ -22,14 +21,14 @@
2221
# follow the instructions.
2322
mailing-lists = {
2423
# TODO: replace with the real `nixos.org` mailing lists.
25-
"test-list@mail-test.nixos.org" = {
24+
2625
forwardTo = [
2726
2827
../../secrets/jfly-email-address.umbriel
2928
3029
];
3130
};
32-
"test-sender@mail-test.nixos.org" = {
31+
3332
forwardTo = [ "[email protected]" ];
3433
loginAccount.encryptedHashedPassword = ../../secrets/test-sender-email-login.umbriel;
3534
};

non-critical-infra/packages/encrypt-email/encrypt-email.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def login(address_id: str, force: bool) -> None:
149149

150150
nix_code = dedent(
151151
f"""\
152-
"{address_id}@mail-test.nixos.org" = {{
152+
"{address_id}@nixos.org" = {{
153153
forwardTo = [
154154
# Add emails here
155155
];

terraform/dns.tf

+21-29
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,6 @@ locals {
201201
type = "TXT"
202202
value = "9e10a04a4b"
203203
},
204-
{
205-
hostname = "nixos.org"
206-
type = "TXT"
207-
value = "v=spf1 include:spf.improvmx.com ~all"
208-
},
209204
{
210205
# hetzner ax162-r 2548595
211206
hostname = "elated-minsky.builder.nixos.org"
@@ -405,29 +400,34 @@ locals {
405400
value = "2a01:4f9:c012:8178::"
406401
},
407402

408-
# Mailserver configuration for `mail-test.nixos.org`
403+
# Mailserver configuration for `nixos.org`
404+
# TODO: remove the 2 MX records for improvmx below in favor of this once
405+
# we're ready to switch to the new mailserver:
406+
# https://github.com/NixOS/infra/issues/485
407+
# {
408+
# hostname = "nixos.org"
409+
# type = "MX"
410+
# value = "umbriel.nixos.org"
411+
# },
409412
{
410-
hostname = "mail-test.nixos.org"
411-
type = "MX"
412-
value = "umbriel.nixos.org"
413-
},
414-
{
415-
hostname = "mail-test.nixos.org"
413+
hostname = "nixos.org"
416414
type = "TXT"
417-
value = "v=spf1 mx ~all"
415+
# TODO: simplify to just a `mx` rule once umbriel is our one and only
416+
# mailserver:
417+
# https://github.com/NixOS/infra/issues/485
418+
# value = "v=spf1 mx ~all"
419+
value = "v=spf1 include:spf.improvmx.com a:umbriel.nixos.org ~all"
418420
},
419421
{
420-
hostname = "mail._domainkey.mail-test.nixos.org"
422+
hostname = "mail._domainkey.nixos.org"
421423
type = "TXT"
422-
# From `/var/dkim/mail-test.nixos.org.mail.txt` on `umbriel`.
424+
# >>> From `/var/dkim/nixos.org.mail.txt` on `umbriel`. <<<
423425
value = "v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDG4Tx788TCAW/sv1h6JefVJChqbaot1yhycwEq0Uo5x9ZIyq43Dkxxl7LdsHIW75HMI7aTKQRru+5xQ26vQmwiIRFJlJlRSYzlZZ2xnFZPXQ27dXnFh7MxLGC7YEyQFksiA2xxgqtQSyIvwu1whm2WK0fXkoJf87SgTtVjjKjnkQIDAQAB"
424426
},
425427
{
426-
hostname = "_dmarc.mail-test.nixos.org"
428+
hostname = "_dmarc.nixos.org"
427429
type = "TXT"
428-
# TODO: consider making this strict (`v=DMARC1; p=reject; adkim=s; aspf=s;`),
429-
# but make sure this doesn't break mailing lists: https://dmarcian.com/mailing-lists-dmarc/
430-
value = "v=DMARC1; p=none"
430+
value = "v=DMARC1; p=none"
431431
},
432432
]
433433
}
@@ -445,9 +445,9 @@ resource "netlify_dns_record" "nixos" {
445445
value = each.value.value
446446
}
447447

448+
### TODO: remove, see https://github.com/NixOS/infra/issues/485 ###
448449
# MX records both have the same hostname and type and would clash on the above
449450
# mapping.
450-
451451
resource "netlify_dns_record" "nixos_MX1" {
452452
zone_id = local.zone_id
453453
hostname = "nixos.org"
@@ -462,8 +462,6 @@ resource "netlify_dns_record" "nixos_MX2" {
462462
value = "mx2.improvmx.com"
463463
}
464464

465-
# additional records for improvmx for dkim & dmarc
466-
467465
resource "netlify_dns_record" "nixos_DKIM1" {
468466
zone_id = local.zone_id
469467
hostname = "dkimprovmx1._domainkey.nixos.org"
@@ -477,13 +475,7 @@ resource "netlify_dns_record" "nixos_DKIM2" {
477475
type = "CNAME"
478476
value = "dkimprovmx2.improvmx.com"
479477
}
480-
481-
resource "netlify_dns_record" "nixos_DMARC" {
482-
zone_id = local.zone_id
483-
hostname = "_dmarc.nixos.org"
484-
type = "TXT"
485-
value = "v=DMARC1; p=none;"
486-
}
478+
### END TODO: remove ###
487479

488480
resource "netlify_dns_record" "nixos_google_verification" {
489481
zone_id = local.zone_id

0 commit comments

Comments
 (0)