From d3e7e2697fc87bea158f37027c56e1f1a81ed68c Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 14:19:00 +0000 Subject: [PATCH 01/17] [email][dns] srv record for email --- applications/email.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/applications/email.nix b/applications/email.nix index 0789f4d..72727fc 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -111,7 +111,14 @@ # DMARC {record="_dmarc.${cfg.domain}."; r_type="TXT"; value=''"v=DMARC1; p=none"'';} - {record=cfg.host.ip; r_type="PTR"; value="${cfg.sub}.${cfg.domain}.";} + # SRV records to help gmail on android etc find the correct mail.skynet.ie domain for config rather than just defaulting to skynet.ie + # https://serverfault.com/questions/935192/how-to-setup-auto-configure-email-for-android-mail-app-on-your-server/1018406#1018406 + # response should be: + # _imap._tcp SRV 0 1 143 imap.example.com. + {record="_imap._tcp"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} + {record="_pop3._tcp"; r_type="SRV"; value="10 1 995 ${cfg.sub}.${cfg.domain}";} + {record="_submission._tcp" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} + ]; # to provide the certs From 26bd8d83cc293dd90eccdc18990128031c345ba5 Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 14:23:46 +0000 Subject: [PATCH 02/17] [email] added remaining records --- applications/email.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/applications/email.nix b/applications/email.nix index 72727fc..e80c466 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -115,9 +115,12 @@ # https://serverfault.com/questions/935192/how-to-setup-auto-configure-email-for-android-mail-app-on-your-server/1018406#1018406 # response should be: # _imap._tcp SRV 0 1 143 imap.example.com. - {record="_imap._tcp"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} - {record="_pop3._tcp"; r_type="SRV"; value="10 1 995 ${cfg.sub}.${cfg.domain}";} - {record="_submission._tcp" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} + {record="_imaps._tcp"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} + {record="_imaps._tcp"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} + {record="_pop3._tcp"; r_type="SRV"; value="20 1 995 ${cfg.sub}.${cfg.domain}";} + {record="_submissions._tcp" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} + {record="_submission._tcp" ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} + ]; From c5c967db43d18e43e22288b5d1a545ae2bf5ad8a Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 14:45:38 +0000 Subject: [PATCH 03/17] accidentally removed a line --- applications/email.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/applications/email.nix b/applications/email.nix index e80c466..4018ec6 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -110,16 +110,19 @@ {record="mail._domainkey.ulcompsoc.ie."; r_type="TXT"; value=''"v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDl8ptSASx37t5sfmU2d2Y6yi9AVrsNFBZDmJ2uaLa4NuvAjxGQCw4wx+1Jui/HOuKYLpntLsjN851wgPR+3i51g4OblqBDvcHn9NYgWRZfHj9AASANQjdsaAbkXuyKuO46hZqeWlpESAcD6a4Evam4fkm+kiZC0+rccb4cWgsuLwIDAQAB"'';} # DMARC {record="_dmarc.${cfg.domain}."; r_type="TXT"; value=''"v=DMARC1; p=none"'';} + + # reverse pointer + {record=cfg.host.ip; r_type="PTR"; value="${cfg.sub}.${cfg.domain}.";} # SRV records to help gmail on android etc find the correct mail.skynet.ie domain for config rather than just defaulting to skynet.ie # https://serverfault.com/questions/935192/how-to-setup-auto-configure-email-for-android-mail-app-on-your-server/1018406#1018406 # response should be: # _imap._tcp SRV 0 1 143 imap.example.com. - {record="_imaps._tcp"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} - {record="_imaps._tcp"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} - {record="_pop3._tcp"; r_type="SRV"; value="20 1 995 ${cfg.sub}.${cfg.domain}";} - {record="_submissions._tcp" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} - {record="_submission._tcp" ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} + {record="_imaps._tcp"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} + {record="_imaps._tcp"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} + {record="_pop3s._tcp"; r_type="SRV"; value="20 1 995 ${cfg.sub}.${cfg.domain}";} + {record="_submissions._tcp" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} + {record="_submission._tcp" ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} ]; From 4217361e011b0a8ef872f3fb6a0532e94b1d753f Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 14:52:05 +0000 Subject: [PATCH 04/17] added SRV to enum and part at the top, not sure about number at the end of the format_records --- applications/dns.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/applications/dns.nix b/applications/dns.nix index 05528f9..4a5e9ff 100644 --- a/applications/dns.nix +++ b/applications/dns.nix @@ -80,6 +80,12 @@ ${format_records sort_records_cname 31} ; ------------------------------------------ ${format_records (filter_records_type "TXT") 29} +; ------------------------------------------ +; SRV +; ------------------------------------------ +${format_records (filter_records_type "SRV") 29} + + '' ); @@ -283,7 +289,7 @@ in { type = str; }; r_type = lib.mkOption { - type = enum ["A" "CNAME" "TXT" "PTR"]; + type = enum ["A" "CNAME" "TXT" "PTR" "SRV"]; }; value = lib.mkOption { type = str; From b60b85ddd0a20e8570ded56f7c9f9e8f2bc7173e Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 15:01:05 +0000 Subject: [PATCH 05/17] added correct length for format record --- applications/dns.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/dns.nix b/applications/dns.nix index 4a5e9ff..b22492e 100644 --- a/applications/dns.nix +++ b/applications/dns.nix @@ -83,7 +83,7 @@ ${format_records (filter_records_type "TXT") 29} ; ------------------------------------------ ; SRV ; ------------------------------------------ -${format_records (filter_records_type "SRV") 29} +${format_records (filter_records_type "SRV") 16} '' From 584eb8eb533d88475de58ca70af6974c6b962c3f Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 15:08:09 +0000 Subject: [PATCH 06/17] Update file dns.nix --- applications/dns.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/dns.nix b/applications/dns.nix index b22492e..4a5e9ff 100644 --- a/applications/dns.nix +++ b/applications/dns.nix @@ -83,7 +83,7 @@ ${format_records (filter_records_type "TXT") 29} ; ------------------------------------------ ; SRV ; ------------------------------------------ -${format_records (filter_records_type "SRV") 16} +${format_records (filter_records_type "SRV") 29} '' From 39ed923a4eafcafa3120d4e398a70501d8da6299 Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 15:09:30 +0000 Subject: [PATCH 07/17] added both just in case --- applications/email.nix | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/applications/email.nix b/applications/email.nix index 4018ec6..c0fe088 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -118,11 +118,16 @@ # https://serverfault.com/questions/935192/how-to-setup-auto-configure-email-for-android-mail-app-on-your-server/1018406#1018406 # response should be: # _imap._tcp SRV 0 1 143 imap.example.com. - {record="_imaps._tcp"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} - {record="_imaps._tcp"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} - {record="_pop3s._tcp"; r_type="SRV"; value="20 1 995 ${cfg.sub}.${cfg.domain}";} - {record="_submissions._tcp" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} - {record="_submission._tcp" ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} + {record="_imaps._tcp.${cfg.domain}"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} + {record="_imaps._tcp.${cfg.domain}"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} + {record="_pop3s._tcp.${cfg.domain}"; r_type="SRV"; value="20 1 995 ${cfg.sub}.${cfg.domain}";} + {record="_submissions._tcp.${cfg.domain}" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} + {record="_submission._tcp.${cfg.domain}" ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} + {record="_imaps._tcp"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} + {record="_imaps._tcp"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} + {record="_pop3s._tcp"; r_type="SRV"; value="20 1 995 ${cfg.sub}.${cfg.domain}";} + {record="_submissions._tcp" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} + {record="_submission._tcp" ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} ]; From 206aa2d42f25f354fcfee5476e17a68dc7bb7a5b Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 15:13:01 +0000 Subject: [PATCH 08/17] had two imaps rather than 1 imaps and 1 imap --- applications/email.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/email.nix b/applications/email.nix index c0fe088..3d56b82 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -119,12 +119,12 @@ # response should be: # _imap._tcp SRV 0 1 143 imap.example.com. {record="_imaps._tcp.${cfg.domain}"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} - {record="_imaps._tcp.${cfg.domain}"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} + {record="_imap._tcp.${cfg.domain}"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} {record="_pop3s._tcp.${cfg.domain}"; r_type="SRV"; value="20 1 995 ${cfg.sub}.${cfg.domain}";} {record="_submissions._tcp.${cfg.domain}" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} {record="_submission._tcp.${cfg.domain}" ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} {record="_imaps._tcp"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} - {record="_imaps._tcp"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} + {record="_imap._tcp"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} {record="_pop3s._tcp"; r_type="SRV"; value="20 1 995 ${cfg.sub}.${cfg.domain}";} {record="_submissions._tcp" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} {record="_submission._tcp" ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} From b5d7fd292d88e4b847cfc7a26269c9c06ecced22 Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 15:15:21 +0000 Subject: [PATCH 09/17] remove pop3 --- applications/email.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/applications/email.nix b/applications/email.nix index 3d56b82..9a2e605 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -120,12 +120,10 @@ # _imap._tcp SRV 0 1 143 imap.example.com. {record="_imaps._tcp.${cfg.domain}"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} {record="_imap._tcp.${cfg.domain}"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} - {record="_pop3s._tcp.${cfg.domain}"; r_type="SRV"; value="20 1 995 ${cfg.sub}.${cfg.domain}";} {record="_submissions._tcp.${cfg.domain}" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} {record="_submission._tcp.${cfg.domain}" ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} {record="_imaps._tcp"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} {record="_imap._tcp"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} - {record="_pop3s._tcp"; r_type="SRV"; value="20 1 995 ${cfg.sub}.${cfg.domain}";} {record="_submissions._tcp" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} {record="_submission._tcp" ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} From 905dd7264e1527fb55129611ba74ebfdab509d84 Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 15:25:18 +0000 Subject: [PATCH 10/17] [fmt] spacing --- applications/email.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/email.nix b/applications/email.nix index 9a2e605..03f52c8 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -119,11 +119,11 @@ # response should be: # _imap._tcp SRV 0 1 143 imap.example.com. {record="_imaps._tcp.${cfg.domain}"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} - {record="_imap._tcp.${cfg.domain}"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} + {record="_imap._tcp.${cfg.domain}"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} {record="_submissions._tcp.${cfg.domain}" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} {record="_submission._tcp.${cfg.domain}" ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} {record="_imaps._tcp"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} - {record="_imap._tcp"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} + {record="_imap._tcp"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} {record="_submissions._tcp" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} {record="_submission._tcp" ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} From e6380cf034e0cfa941ccb95e54fb5cd1b49d459c Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 15:27:05 +0000 Subject: [PATCH 11/17] [dns] added new sort for SRV --- applications/dns.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/dns.nix b/applications/dns.nix index 4a5e9ff..98f7ca9 100644 --- a/applications/dns.nix +++ b/applications/dns.nix @@ -18,6 +18,7 @@ let sort_records_a = builtins.sort (a: b: (ip_ptr_to_int a.value) < (ip_ptr_to_int b.value)) filter_records_a; sort_records_cname = builtins.sort (a: b: a.value < b.value) (filter_records_type "CNAME"); sort_records_ptr = builtins.sort (a: b: (lib.strings.toInt a.record) < (lib.strings.toInt b.record)) (process_ptr (filter_records_type "PTR")); + sort_records_srv = builtins.sort (a: b: a.record < b.record) (filter_records_type "SRV"); format_records = records: offset: lib.strings.concatMapStrings (x: "${padString x.record offset} IN ${padString x.r_type 5} ${x.value}\n") records; @@ -83,7 +84,7 @@ ${format_records (filter_records_type "TXT") 29} ; ------------------------------------------ ; SRV ; ------------------------------------------ -${format_records (filter_records_type "SRV") 29} +${format_records sort_records_srv 29} '' From 8a5ebf6d379d458ce2ba2f4cf0cb8c3715b73dbf Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 15:28:19 +0000 Subject: [PATCH 12/17] [email][fmt] added dot to the end of record to make it correct --- applications/email.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/applications/email.nix b/applications/email.nix index 03f52c8..ee9c82c 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -118,14 +118,14 @@ # https://serverfault.com/questions/935192/how-to-setup-auto-configure-email-for-android-mail-app-on-your-server/1018406#1018406 # response should be: # _imap._tcp SRV 0 1 143 imap.example.com. - {record="_imaps._tcp.${cfg.domain}"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} - {record="_imap._tcp.${cfg.domain}"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} - {record="_submissions._tcp.${cfg.domain}" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} - {record="_submission._tcp.${cfg.domain}" ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} - {record="_imaps._tcp"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} - {record="_imap._tcp"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} - {record="_submissions._tcp" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} - {record="_submission._tcp" ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} + {record="_imaps._tcp.${cfg.domain}."; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} + {record="_imap._tcp.${cfg.domain}."; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} + {record="_submissions._tcp.${cfg.domain}." ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} + {record="_submission._tcp.${cfg.domain}." ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} + {record="_imaps._tcp."; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} + {record="_imap._tcp."; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} + {record="_submissions._tcp." ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} + {record="_submission._tcp." ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} ]; From 5f4444927b1c0a8fe4b8299aae805f264f5bbb57 Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 15:37:14 +0000 Subject: [PATCH 13/17] nvm --- applications/email.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/applications/email.nix b/applications/email.nix index ee9c82c..57900aa 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -118,14 +118,10 @@ # https://serverfault.com/questions/935192/how-to-setup-auto-configure-email-for-android-mail-app-on-your-server/1018406#1018406 # response should be: # _imap._tcp SRV 0 1 143 imap.example.com. - {record="_imaps._tcp.${cfg.domain}."; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} - {record="_imap._tcp.${cfg.domain}."; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} - {record="_submissions._tcp.${cfg.domain}." ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} - {record="_submission._tcp.${cfg.domain}." ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} - {record="_imaps._tcp."; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} - {record="_imap._tcp."; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} - {record="_submissions._tcp." ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} - {record="_submission._tcp." ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} + {record="_imaps._tcp"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} + {record="_imap._tcp"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} + {record="_submissions._tcp" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} + {record="_submission._tcp" ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} ]; From e9581aad3980d624e2eb103b6a7c54294dffa4fe Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 15:41:11 +0000 Subject: [PATCH 14/17] weight doesn't seem to matter --- applications/email.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/email.nix b/applications/email.nix index 57900aa..b5c4d88 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -119,9 +119,9 @@ # response should be: # _imap._tcp SRV 0 1 143 imap.example.com. {record="_imaps._tcp"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} - {record="_imap._tcp"; r_type="SRV"; value="10 1 143 ${cfg.sub}.${cfg.domain}";} - {record="_submissions._tcp" ; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} - {record="_submission._tcp" ; r_type="SRV"; value="10 1 587 ${cfg.sub}.${cfg.domain}";} + {record="_imap._tcp"; r_type="SRV"; value="0 1 143 ${cfg.sub}.${cfg.domain}";} + {record="_submissions._tcp"; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} + {record="_submission._tcp"; r_type="SRV"; value="0 1 587 ${cfg.sub}.${cfg.domain}";} ]; From 177bd781846a8dcad44cad6d54a100556a5ba844 Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 16:06:42 +0000 Subject: [PATCH 15/17] [fmt] dns --- applications/dns.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/dns.nix b/applications/dns.nix index 98f7ca9..b88ec89 100644 --- a/applications/dns.nix +++ b/applications/dns.nix @@ -18,7 +18,7 @@ let sort_records_a = builtins.sort (a: b: (ip_ptr_to_int a.value) < (ip_ptr_to_int b.value)) filter_records_a; sort_records_cname = builtins.sort (a: b: a.value < b.value) (filter_records_type "CNAME"); sort_records_ptr = builtins.sort (a: b: (lib.strings.toInt a.record) < (lib.strings.toInt b.record)) (process_ptr (filter_records_type "PTR")); - sort_records_srv = builtins.sort (a: b: a.record < b.record) (filter_records_type "SRV"); + sort_records_srv = builtins.sort (a: b: a.record < b.record) (filter_records_type "SRV"); format_records = records: offset: lib.strings.concatMapStrings (x: "${padString x.record offset} IN ${padString x.r_type 5} ${x.value}\n") records; From b893b62b0a079f976ab3b8b938c3d61248c8ed7e Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 16:07:33 +0000 Subject: [PATCH 16/17] [fmt] email --- applications/email.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/applications/email.nix b/applications/email.nix index b5c4d88..3d3129a 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -118,10 +118,10 @@ # https://serverfault.com/questions/935192/how-to-setup-auto-configure-email-for-android-mail-app-on-your-server/1018406#1018406 # response should be: # _imap._tcp SRV 0 1 143 imap.example.com. - {record="_imaps._tcp"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} - {record="_imap._tcp"; r_type="SRV"; value="0 1 143 ${cfg.sub}.${cfg.domain}";} - {record="_submissions._tcp"; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} - {record="_submission._tcp"; r_type="SRV"; value="0 1 587 ${cfg.sub}.${cfg.domain}";} + {record="_imaps._tcp"; r_type="SRV"; value="0 1 993 ${cfg.sub}.${cfg.domain}";} + {record="_imap._tcp"; r_type="SRV"; value="0 1 143 ${cfg.sub}.${cfg.domain}";} + {record="_submissions._tcp"; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} + {record="_submission._tcp"; r_type="SRV"; value="0 1 587 ${cfg.sub}.${cfg.domain}";} ]; From 8159883f83ddc9f019bf2ae8735261ea33b195a5 Mon Sep 17 00:00:00 2001 From: Evan Cassidy Date: Mon, 24 Jul 2023 17:49:43 +0000 Subject: [PATCH 17/17] [fmt] --- applications/email.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/email.nix b/applications/email.nix index 3d3129a..d3388ab 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -105,12 +105,14 @@ # TXT records, all tehse are inside escaped strings to allow using "" # SPF record {record="${cfg.domain}."; r_type="TXT"; value=''"v=spf1 a:${cfg.sub}.${cfg.domain} -all"'';} + # DKIM keys {record="mail._domainkey.skynet.ie."; r_type="TXT"; value=''"v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCxju1Ie60BdHwyFVPNQKovL/cX9IFPzBKgjnHZf+WBzDCFKSBpf7NvnfXajtFDQN0poaN/Qfifid+V55ZCNDBn8Y3qZa4Y69iNiLw2DdvYf0HdnxX6+pLpbmj7tikGGLJ62xnhkJhoELnz5gCOhpyoiv0tSQVaJpaGZmoll861/QIDAQAB"'';} {record="mail._domainkey.ulcompsoc.ie."; r_type="TXT"; value=''"v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDl8ptSASx37t5sfmU2d2Y6yi9AVrsNFBZDmJ2uaLa4NuvAjxGQCw4wx+1Jui/HOuKYLpntLsjN851wgPR+3i51g4OblqBDvcHn9NYgWRZfHj9AASANQjdsaAbkXuyKuO46hZqeWlpESAcD6a4Evam4fkm+kiZC0+rccb4cWgsuLwIDAQAB"'';} + # DMARC {record="_dmarc.${cfg.domain}."; r_type="TXT"; value=''"v=DMARC1; p=none"'';} - + # reverse pointer {record=cfg.host.ip; r_type="PTR"; value="${cfg.sub}.${cfg.domain}.";} @@ -122,8 +124,6 @@ {record="_imap._tcp"; r_type="SRV"; value="0 1 143 ${cfg.sub}.${cfg.domain}";} {record="_submissions._tcp"; r_type="SRV"; value="0 1 465 ${cfg.sub}.${cfg.domain}";} {record="_submission._tcp"; r_type="SRV"; value="0 1 587 ${cfg.sub}.${cfg.domain}";} - - ]; # to provide the certs