email: add listeners

This commit is contained in:
twoneis 2025-04-10 12:30:27 +02:00
parent dc34a72853
commit 1447f86c3a
2 changed files with 22 additions and 13 deletions

View file

@ -18,9 +18,6 @@ in {
enable = true; enable = true;
domain = email-domain; domain = email-domain;
ports = { ports = {
smtp = 25;
imaps = 993;
smtps = 465;
local = 9000; local = 9000;
}; };
}; };

View file

@ -26,12 +26,6 @@ in
users.users."stalwart-mail".extraGroups = ["nginx"]; users.users."stalwart-mail".extraGroups = ["nginx"];
networking.firewall.allowedTCPPorts = [
cfg.ports.imaps
cfg.ports.smtps
cfg.ports.smtp
];
services.stalwart-mail = { services.stalwart-mail = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
@ -44,20 +38,38 @@ in
hostname = cfg.domain; hostname = cfg.domain;
tls = { tls = {
enable = true; enable = true;
implicit = true;
}; };
listener = { listener = {
smtp = { smtp = {
protocol = "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 = { imaps = {
protocol = "imap"; protocol = "imap";
bind = ["[::]:${toString cfg.ports.imaps}"]; bind = ["[::]:993"];
tls.implicit = true;
};
submission = {
protocol = "smtp";
bind = ["[::]:587"];
}; };
submissions = { submissions = {
protocol = "smtp"; protocol = "smtp";
bind = ["[::]:${toString cfg.ports.smtps}"]; bind = ["[::]:465"];
tls.implicit = true;
}; };
management = { management = {
protocol = "http"; protocol = "http";