From 1ca1168d7a82ed79186efb8c2305f52f80df7695 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 27 May 2024 17:51:02 +0200 Subject: [PATCH] mail: switch to mail.pub.solar --- hosts/metronom/mail.nix | 5 ++--- hosts/metronom/networking.nix | 4 ++++ terraform/dns.tf | 35 ++++++++++++----------------------- 3 files changed, 18 insertions(+), 26 deletions(-) diff --git a/hosts/metronom/mail.nix b/hosts/metronom/mail.nix index db3a3b79..d1379e95 100644 --- a/hosts/metronom/mail.nix +++ b/hosts/metronom/mail.nix @@ -11,10 +11,9 @@ mailserver = { enable = true; - fqdn = "metronom.pub.solar"; + fqdn = "mail.pub.solar"; domains = [ "pub.solar" - "metronom.pub.solar" ]; # A list of all login accounts. To create the password hashes, use @@ -24,7 +23,7 @@ hashedPasswordFile = config.age.secrets.mail-hensoko.path; quota = "2G"; }; - "teutat3s@metronom.pub.solar" = { + "teutat3s@pub.solar" = { hashedPasswordFile = config.age.secrets.mail-teutat3s.path; quota = "2G"; }; diff --git a/hosts/metronom/networking.nix b/hosts/metronom/networking.nix index 8d57a051..0aedad54 100644 --- a/hosts/metronom/networking.nix +++ b/hosts/metronom/networking.nix @@ -7,6 +7,10 @@ { networking.hostName = "metronom"; + networking.extraHosts = '' + 127.0.0.2 mail.pub.solar mail + ::1 mail.pub.solar mail + ''; networking.domain = "pub.solar"; networking.hostId = "00000002"; diff --git a/terraform/dns.tf b/terraform/dns.tf index 72e65f9f..cf8adf8f 100644 --- a/terraform/dns.tf +++ b/terraform/dns.tf @@ -14,6 +14,11 @@ resource "namecheap_domain_records" "pub-solar" { type = "A" address = "49.13.236.167" } + record { + hostname = "mail" + type = "A" + address = "49.13.236.167" + } record { hostname = "auth" type = "CNAME" @@ -148,7 +153,7 @@ resource "namecheap_domain_records" "pub-solar" { record { hostname = "@" type = "TXT" - address = "v=spf1 include:spf.greenbaum.zone a:list.pub.solar ~all" + address = "v=spf1 a:mail.pub.solar a:list.pub.solar ~all" } record { hostname = "list" @@ -165,6 +170,11 @@ resource "namecheap_domain_records" "pub-solar" { type = "TXT" address = "v=DMARC1; p=reject;" } + record { + hostname = "mail._domainkey" + type = "TXT" + address = "v=DKIM1;k=rsa;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDI333HhjmVmDYc5hYTtmB6o9KYb782xw+ewH1eQlpFcCMyJ1giYFeGKviNki9uSm52tk34zUIthsqJMRlz2WsKGgk4oq3MRtgPtogxbh1ipJlynXejPU5WVetjjMnwr6AtV1DP1Sv4n5Vz0EV8cTi3tRZdgYpG6hlriiHXbrvlIwIDAQAB" + } record { hostname = "modoboa._domainkey" type = "TXT" @@ -173,7 +183,7 @@ resource "namecheap_domain_records" "pub-solar" { record { hostname = "@" type = "MX" - address = "mail.greenbaum.zone." + address = "mail.pub.solar." mx_pref = "0" } record { @@ -182,27 +192,6 @@ resource "namecheap_domain_records" "pub-solar" { address = "list.pub.solar." mx_pref = "0" } - record { - hostname = "metronom" - type = "TXT" - address = "v=spf1 a:metronom.pub.solar ?all" - } - record { - hostname = "mail._domainkey.metronom" - type = "TXT" - address = "p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCpFkI+IqTwyUIo5LqYVPMXlkTJe7trcE+ln6vjLFcoXBZaXfFVRJThMtfEZLkJ84ndEHadszFdSZs8eLRVCt/h7x9+GaOPIdKI9lbOn+AepwxhE3z/VrKKfO0CFyLsA6+XY7ebiF1aYctalY+r8Jtt8LuXh0Fj6+4YAFkvNxJEnQIDAQAB" - } - record { - hostname = "_dmarc.metronom" - type = "TXT" - address = "v=DMARC1; p=reject;" - } - record { - hostname = "metronom" - type = "MX" - address = "metronom.pub.solar." - mx_pref = "0" - } record { hostname = "nachtigall" type = "A"