Skip to content

Commit ec013aa

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 c6f24c9 commit ec013aa

File tree

4 files changed

+26
-35
lines changed

4 files changed

+26
-35
lines changed

non-critical-infra/hosts/umbriel/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
@@ -206,11 +206,6 @@ locals {
206206
type = "TXT"
207207
value = "9e10a04a4b"
208208
},
209-
{
210-
hostname = "nixos.org"
211-
type = "TXT"
212-
value = "v=spf1 include:spf.improvmx.com ~all"
213-
},
214209
{
215210
# hetzner ax162-r 2548595
216211
hostname = "elated-minsky.builder.nixos.org"
@@ -410,29 +405,34 @@ locals {
410405
value = "2a01:4f9:c012:8178::"
411406
},
412407

413-
# Mailserver configuration for `mail-test.nixos.org`
408+
# Mailserver configuration for `nixos.org`
409+
# TODO: remove the 2 MX records for improvmx below in favor of this once
410+
# we're ready to switch to the new mailserver:
411+
# https://github.com/NixOS/infra/issues/485
412+
# {
413+
# hostname = "nixos.org"
414+
# type = "MX"
415+
# value = "umbriel.nixos.org"
416+
# },
414417
{
415-
hostname = "mail-test.nixos.org"
416-
type = "MX"
417-
value = "umbriel.nixos.org"
418-
},
419-
{
420-
hostname = "mail-test.nixos.org"
418+
hostname = "nixos.org"
421419
type = "TXT"
422-
value = "v=spf1 mx ~all"
420+
# TODO: simplify to just a `mx` rule once umbriel is our one and only
421+
# mailserver:
422+
# https://github.com/NixOS/infra/issues/485
423+
# value = "v=spf1 mx ~all"
424+
value = "v=spf1 include:spf.improvmx.com a:umbriel.nixos.org ~all"
423425
},
424426
{
425-
hostname = "mail._domainkey.mail-test.nixos.org"
427+
hostname = "mail._domainkey.nixos.org"
426428
type = "TXT"
427-
# From `/var/dkim/mail-test.nixos.org.mail.txt` on `umbriel`.
429+
# >>> From `/var/dkim/nixos.org.mail.txt` on `umbriel`. <<<
428430
value = "v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDG4Tx788TCAW/sv1h6JefVJChqbaot1yhycwEq0Uo5x9ZIyq43Dkxxl7LdsHIW75HMI7aTKQRru+5xQ26vQmwiIRFJlJlRSYzlZZ2xnFZPXQ27dXnFh7MxLGC7YEyQFksiA2xxgqtQSyIvwu1whm2WK0fXkoJf87SgTtVjjKjnkQIDAQAB"
429431
},
430432
{
431-
hostname = "_dmarc.mail-test.nixos.org"
433+
hostname = "_dmarc.nixos.org"
432434
type = "TXT"
433-
# TODO: consider making this strict (`v=DMARC1; p=reject; adkim=s; aspf=s;`),
434-
# but make sure this doesn't break mailing lists: https://dmarcian.com/mailing-lists-dmarc/
435-
value = "v=DMARC1; p=none"
435+
value = "v=DMARC1; p=none"
436436
},
437437
]
438438
}
@@ -450,9 +450,9 @@ resource "netlify_dns_record" "nixos" {
450450
value = each.value.value
451451
}
452452

453+
### TODO: remove, see https://github.com/NixOS/infra/issues/485 ###
453454
# MX records both have the same hostname and type and would clash on the above
454455
# mapping.
455-
456456
resource "netlify_dns_record" "nixos_MX1" {
457457
zone_id = local.zone_id
458458
hostname = "nixos.org"
@@ -467,8 +467,6 @@ resource "netlify_dns_record" "nixos_MX2" {
467467
value = "mx2.improvmx.com"
468468
}
469469

470-
# additional records for improvmx for dkim & dmarc
471-
472470
resource "netlify_dns_record" "nixos_DKIM1" {
473471
zone_id = local.zone_id
474472
hostname = "dkimprovmx1._domainkey.nixos.org"
@@ -482,13 +480,7 @@ resource "netlify_dns_record" "nixos_DKIM2" {
482480
type = "CNAME"
483481
value = "dkimprovmx2.improvmx.com"
484482
}
485-
486-
resource "netlify_dns_record" "nixos_DMARC" {
487-
zone_id = local.zone_id
488-
hostname = "_dmarc.nixos.org"
489-
type = "TXT"
490-
value = "v=DMARC1; p=none;"
491-
}
483+
### END TODO: remove ###
492484

493485
resource "netlify_dns_record" "nixos_google_verification" {
494486
zone_id = local.zone_id

0 commit comments

Comments
 (0)