summaryrefslogtreecommitdiff
path: root/hosts/cloud/hetzner
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-06-23 06:54:50 +0700
committerpolwex <polwex@sortug.com>2025-06-23 06:54:50 +0700
commit34fae224e8460419ae8ef0fe32a12e3d362142b8 (patch)
treeff96ac666a2af6b13f6df7480da685fa0bff0e64 /hosts/cloud/hetzner
parent773726a27a2651152c476d4f8fefd5be30a4e786 (diff)
m
Diffstat (limited to 'hosts/cloud/hetzner')
-rw-r--r--hosts/cloud/hetzner/configuration.nix1
-rw-r--r--hosts/cloud/hetzner/mail.nix82
2 files changed, 83 insertions, 0 deletions
diff --git a/hosts/cloud/hetzner/configuration.nix b/hosts/cloud/hetzner/configuration.nix
index 73ca07e..a432391 100644
--- a/hosts/cloud/hetzner/configuration.nix
+++ b/hosts/cloud/hetzner/configuration.nix
@@ -14,6 +14,7 @@
../users.nix
../packages.nix
../../server.nix
+ ./mail.nix
];
boot = {
loader.grub = {
diff --git a/hosts/cloud/hetzner/mail.nix b/hosts/cloud/hetzner/mail.nix
new file mode 100644
index 0000000..deab818
--- /dev/null
+++ b/hosts/cloud/hetzner/mail.nix
@@ -0,0 +1,82 @@
+{
+ config,
+ pkgs,
+ ...
+}: {
+ environment.etc = {
+ "stalwart/mail-pw1".text = "poguo";
+ "stalwart/mail-pw2".text = "shahezai";
+ "stalwart/admin-pw".text = "chengchun";
+ "stalwart/acme-secret".text = "caomushen";
+ };
+
+ services.stalwart-mail = {
+ enable = true;
+ package = pkgs.stalwart-mail;
+ openFirewall = true;
+ settings = {
+ server = {
+ hostname = "mail.urbit.cloud";
+ tls = {
+ enable = true;
+ implicit = true;
+ };
+ listener = {
+ smtp = {
+ protocol = "smtp";
+ bind = "[::]:25";
+ };
+ submissions = {
+ bind = "[::]:465";
+ protocol = "smtp";
+ };
+ imaps = {
+ bind = "[::]:993";
+ protocol = "imap";
+ };
+ jmap = {
+ bind = "[::]:88888";
+ url = "https://mail.urbit.cloud";
+ protocol = "jmap";
+ };
+ management = {
+ bind = ["127.0.0.1:8888"];
+ protocol = "http";
+ };
+ };
+ };
+ lookup.default = {
+ hostname = "mail.urbit.cloud";
+ domain = "urbit.cloud";
+ };
+ session.auth = {
+ mechanisms = "[plain]";
+ directory = "'in-memory'";
+ };
+ storage.directory = "in-memory";
+ session.rcpt.directory = "'in-memory'";
+ queue.outbound.next-hop = "'local'";
+ directory."in-memory" = {
+ type = "memory";
+ principals = [
+ {
+ class = "individual";
+ name = "User 1";
+ secret = "%{file:/etc/stalwart/mail-pw1}%";
+ email = ["polwex@urbit.cloud"];
+ }
+ {
+ class = "individual";
+ name = "postmaster";
+ secret = "%{file:/etc/stalwart/mail-pw1}%";
+ email = ["postmaster@urbit.cloud"];
+ }
+ ];
+ };
+ authentication.fallback-admin = {
+ user = "admin";
+ secret = "%{file:/etc/stalwart/admin-pw}%";
+ };
+ };
+ };
+}