From fd1a70edc92c3ff431af1c7854fa23114373d94c Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Wed, 11 Oct 2023 10:49:25 +0100 Subject: [PATCH] feat: improve the email --- applications/email.nix | 88 ++++++++---------------------------------- 1 file changed, 17 insertions(+), 71 deletions(-) diff --git a/applications/email.nix b/applications/email.nix index 39e9731..27e7308 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -16,10 +16,10 @@ with lib; let # thought you could escape racket? create_filter = groups: create_filter_join (create_filter_array groups); - create_skynet_email = accounts: (map (account: "${account}@skynet.ie") accounts); + create_skynet_email = accounts: mailbox: (map (account: "${account}+${mailbox}@skynet.ie") accounts); - create_skynet_email_admin = create_skynet_email config.skynet.users.admin; - create_skynet_email_committee = create_skynet_email config.skynet.users.committee; + create_skynet_email_admin = mailbox: (create_skynet_email config.skynet.users.admin mailbox) ++ ["${mailbox}_int@skynet.ie"]; + create_skynet_email_committee = mailbox: (create_skynet_email config.skynet.users.committee mailbox) ++ ["${mailbox}_int@skynet.ie"]; in { imports = [ ./dns.nix @@ -234,75 +234,21 @@ in { cfg.domain ]; + lmtpSaveToDetailMailbox = "yes"; + extraVirtualAliases = { - "abuse@skynet.ie" = - [ - "abuse_int@skynet.ie" - ] - ++ create_skynet_email_admin; - - "accounts@skynet.ie" = - [ - "accounts_int@skynet.ie" - ] - ++ create_skynet_email_committee; - - "compsoc@skynet.ie" = - [ - "compsoc_int@skynet.ie" - ] - ++ create_skynet_email_committee; - "contact@skynet.ie" = - [ - "contact_int@skynet.ie" - ] - ++ create_skynet_email_committee; - - "dbadmin@skynet.ie" = - [ - "dbadmin_int@skynet.ie" - ] - ++ create_skynet_email_admin; - - "dnsadm@skynet.ie" = - [ - "dnsadm_int@skynet.ie" - ] - ++ create_skynet_email_admin; - - "hostmaster@skynet.ie" = - [ - "hostmaster_int@skynet.ie" - ] - ++ create_skynet_email_admin; - - "intersocsrep@skynet.ie" = - [ - "intersocsrep_int@skynet.ie" - ] - ++ create_skynet_email_committee; - - "mailman@skynet.ie" = - [ - "mailman_int@skynet.ie" - ] - ++ create_skynet_email_admin; - - "security@skynet.ie" = - [ - "security_int@skynet.ie" - ] - ++ create_skynet_email_admin; - "sysadm@skynet.ie" = - [ - "sysadm_int@skynet.ie" - ] - ++ create_skynet_email_admin; - "webadmin@skynet.ie" = - [ - "webadmin_int@skynet.ie" - ] - ++ create_skynet_email_admin; + "abuse@skynet.ie" = create_skynet_email_admin "abuse"; + "accounts@skynet.ie" = create_skynet_email_committee "accounts"; + "compsoc@skynet.ie" = create_skynet_email_committee "compsoc"; + "contact@skynet.ie" = create_skynet_email_committee "contact"; + "dbadmin@skynet.ie" = create_skynet_email_admin "dbadmin"; + "dnsadm@skynet.ie" = create_skynet_email_admin "dnsadm"; + "hostmaster@skynet.ie" = create_skynet_email_admin "hostmaster"; + "intersocsrep@skynet.ie" = create_skynet_email_committee "intersocsrep"; + "mailman@skynet.ie" = create_skynet_email_admin "mailman"; + "security@skynet.ie" = create_skynet_email_admin "security"; + "sysadm@skynet.ie" = create_skynet_email_admin "sysadm"; + "webadmin@skynet.ie" = create_skynet_email_admin "webadmin"; }; # use the letsencrypt certs