From 1447f86c3a79de68fc0916a80cbc2010b09647cb Mon Sep 17 00:00:00 2001 From: twoneis Date: Thu, 10 Apr 2025 12:30:27 +0200 Subject: [PATCH] email: add listeners --- devices/ellaca/options.nix | 3 --- modules/email/default.nix | 32 ++++++++++++++++++++++---------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/devices/ellaca/options.nix b/devices/ellaca/options.nix index 2ce5b77..1da3760 100644 --- a/devices/ellaca/options.nix +++ b/devices/ellaca/options.nix @@ -18,9 +18,6 @@ in { enable = true; domain = email-domain; ports = { - smtp = 25; - imaps = 993; - smtps = 465; local = 9000; }; }; diff --git a/modules/email/default.nix b/modules/email/default.nix index c8f3c57..d334d60 100644 --- a/modules/email/default.nix +++ b/modules/email/default.nix @@ -26,12 +26,6 @@ in users.users."stalwart-mail".extraGroups = ["nginx"]; - networking.firewall.allowedTCPPorts = [ - cfg.ports.imaps - cfg.ports.smtps - cfg.ports.smtp - ]; - services.stalwart-mail = { enable = true; openFirewall = true; @@ -44,20 +38,38 @@ in hostname = cfg.domain; tls = { enable = true; - implicit = true; }; listener = { smtp = { protocol = "smtp"; - bind = ["[::]:${toString cfg.ports.smtp}"]; + bind = ["[::]:25"]; + }; + lmtp = { + protocol = "lmtp"; + bind = ["[::]:24"]; + }; + jmap = { + protocol = "http"; + bind = ["[::]:8080"]; + tls.implicit = true; + }; + imap = { + protocol = "imap"; + bind = ["[::]:143"]; }; imaps = { protocol = "imap"; - bind = ["[::]:${toString cfg.ports.imaps}"]; + bind = ["[::]:993"]; + tls.implicit = true; + }; + submission = { + protocol = "smtp"; + bind = ["[::]:587"]; }; submissions = { protocol = "smtp"; - bind = ["[::]:${toString cfg.ports.smtps}"]; + bind = ["[::]:465"]; + tls.implicit = true; }; management = { protocol = "http";