From 33a0697d609a5b978f6a13232db4eb9e75212fd7 Mon Sep 17 00:00:00 2001 From: Cassie Cheung Date: Mon, 22 Jul 2024 21:37:47 +0800 Subject: [PATCH] host(kita): initial postfix configuration --- systems/kita/services/mail/default.nix | 3 +++ systems/kita/services/mail/postfix.nix | 30 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 systems/kita/services/mail/postfix.nix diff --git a/systems/kita/services/mail/default.nix b/systems/kita/services/mail/default.nix index c626c33..b017811 100644 --- a/systems/kita/services/mail/default.nix +++ b/systems/kita/services/mail/default.nix @@ -1,5 +1,8 @@ {...}: { imports = [ ./roundcube.nix + + # HELL + ./postfix.nix ]; } diff --git a/systems/kita/services/mail/postfix.nix b/systems/kita/services/mail/postfix.nix new file mode 100644 index 0000000..ea1313a --- /dev/null +++ b/systems/kita/services/mail/postfix.nix @@ -0,0 +1,30 @@ +{config, ...}: let + cfg = config.services.postfix; +in { + services.postfix = { + enable = true; + domain = "soopy.moe"; + hostname = "mx2.soopy.moe"; + origin = "mx2.soopy.moe"; + destination = [ + "localhost" + "localhost.localdomain" + cfg.hostname + "staging.soopy.moe" # TODO: remove after testing + # don't put soopy.moe here, that goes into virtual stuff. + ]; + + # leave relayHost to be "". + relayDomains = []; + networksStyle = "host"; + + postmasterAlias = "cassie"; + rootAlias = "cassie"; + }; + + networking.firewall.allowedTCPPorts = [ + 25 # smtp + 465 # submissions (secure) + # 587 # submission (starttls) + ]; +}