{ users.users.stalwart = { isSystemUser = true; group = "stalwart"; home = "/var/lib/stalwart"; }; users.groups.stalwart = {}; services.stalwart-mail = { enable = true; settings = { server = { hostname = "mail.jacekpoz.pl"; run-as = { user = "stalwart"; group = "stalwart"; }; #listener = { # lmtp = { # protocol = "lmtp"; # bind = [ "0.0.0.0:9900" ]; # }; # smtp = { # protocol = "smtp"; # bind = [ "0.0.0.0:9901" ]; # }; # jmap = { # protocol = "jmap"; # bind = [ "0.0.0.0:9902" ]; # url = "https://mail.jacekpoz.pl/jmap"; # }; #}; }; global = { thread-pool = 4; shared-map = { shard = 32; capacity = 10; }; tracing = { method = "journal"; level = "warn"; }; }; }; }; services.caddy = { enable = true; virtualHosts."mail.jacekpoz.pl".extraConfig = '' handle_path /jmap* { reverse_proxy * localhost:9902 } ''; }; }