stalwart: fix domain issues

This commit is contained in:
Bloxx12 2025-05-22 18:08:22 +02:00
commit c0aeed8ea4
Signed by: faukah
SSH key fingerprint: SHA256:Uj2AXqvtdCA4hn5Hq0ZonhIAyUqI1q4w2sMG3Z1TH7E

View file

@ -7,8 +7,8 @@
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
domain = "charlieroot.dev";
acmeRoot = "/var/lib/acme/challenges-stalwart";
domain = "mail.charlieroot.dev";
cfg = config.modules.system.services.stalwart;
in {
options.modules.system.services.stalwart.enable = mkEnableOption "stalwart";
@ -27,7 +27,7 @@ in {
server = {
# The default server hostname is utilized in SMTP EHLO commands,
# as well as included in message headers and reports.
hostname = "mail.${domain}";
hostname = domain;
tls = {
# Specifies whether the TLS encryption is available for the listener.
enable = true;
@ -66,7 +66,7 @@ in {
};
jmap = {
bind = ["localhost::8080" "[::]:8080"];
url = "https://mail.${domain}";
url = "https://${domain}";
protocol = "jmap";
tls.implicit = true;
};
@ -77,7 +77,7 @@ in {
};
};
lookup.default = {
hostname = "mail.${domain}";
hostname = domain;
inherit domain;
};
};
@ -130,19 +130,5 @@ in {
};
};
};
security.acme = let
email = "charlie@charlieroot.dev";
in {
# testing server, do not use in production, but DO use it for setting things up.
# it has much higher rate limits.
# defaults.server = "https://acme-staging-v02.api.letsencrypt.org/directory";
certs = {
"mail.${domain}" = {
webroot = acmeRoot;
inherit email;
group = "nginx";
};
};
};
};
}