{ config, pkgs, ... }: let domain = "mail.urbit.men"; in { services.stalwart-mail = { enable = true; settings = { authentication.fallback-admin = { user = "admin"; secret = "xdxdxdxd"; }; server = { hostname = domain; # run-as = { # user = "y"; # group = "users"; # }; http.use-x-forwarded = true; tls = { enable = true; certificate = "default"; implicit = false; }; listener = { "imap" = { bind = ["[::]:143"]; protocol = "imap"; tls.implicit = false; }; "imaps" = { bind = ["[::]:993"]; protocol = "imap"; tls.implicit = true; }; "smtp" = { bind = ["[::]:25"]; protocol = "smtp"; tls.implicit = false; }; "smtp-sub" = { bind = ["[::]:587"]; protocol = "smtp"; tls.implicit = false; }; "smtps-sub" = { bind = ["[::]:465"]; protocol = "smtp"; tls.implicit = true; }; "http" = { bind = ["127.0.0.1:8080"]; protocol = "http"; # tls.implicit = true; }; "sieve" = { bind = ["[::]:4190"]; protocol = "managesieve"; tls.implicit = true; }; }; session = { rcpt.directory = "in-memory"; auth = { mechanisms = ["PLAIN"]; directory = "in-memory"; }; }; jmap.directory = "in-memory"; directory."in-memory" = { type = "memory"; users = [ { name = "alice"; secret = "foobar"; email = ["alice@urbit.men"]; } { name = "bob"; secret = "foobar"; email = ["bob@urbit.men"]; } ]; }; }; }; }; }