Summary Files Commits Branches @commit @diff @stats
path: root / machines / marduk / mail.nix
diff options
context:
space:
mode:
Commit1e99bf8f1c33e77c6aa5a5a4d128b71b4a8e53f1 (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-07-04 09:21:44 +0300
Committer
 Syndamia <kamen@syndamia.com>
2025-07-04 09:21:44 +0300
Files4890638ba55b5d7c4ae05b751fe14c8f0b9b1713 /machines/marduk/mail.nix
nix-1e99bf8f1c33e77c6aa5a5a4d128b71b4a8e53f1.tar
nix-1e99bf8f1c33e77c6aa5a5a4d128b71b4a8e53f1.tar.gz
nix-1e99bf8f1c33e77c6aa5a5a4d128b71b4a8e53f1.zip
Parent5a7f3676d1dd5c0792a4c1637aca04c3609b3db6 (diff)
feat(machines/marduk): Split configuration into multiple files and make code more generic
1 files changed, 40 insertions, 0 deletions
-rw-r--r--machines/marduk/mail.nix40
diff --git a/machines/marduk/mail.nix b/machines/marduk/mail.nix
new file mode 100644
index 0000000..928be56
--- /dev/null
+++ b/machines/marduk/mail.nix
@@ -0,0 +1,40 @@
+# This mail server is meant to be LOCAL/INTERNAL ONLY!
+# It is woefully insecure, but the plan is to be used only between devices
+# on my home network, so its ok.
+#
+# Configuring internal mail clients:
+# INCOMING SERVER
+# Protocol : IMAP
+# Hostname : mail.int
+# Port : 143
+# Connection security : None
+# Authentication method: Normal Password
+# Username : NAME@mail.int
+# OUTGOING SERVER (SMTP)
+# Hostname : mail.int
+# Port : 587
+# Connection security : None
+# Authentication method: Normal Password
+# Username : NAME@mail.int
+{ pkgs, config, ... }: let
+ mailDomain = "mail." + config.constants.tld;
+in {
+ services.dnsmasq.settings.address = [
+ "/${mailDomain}/${config.constants.ip}"
+ ];
+
+ services.maddy = {
+ localDomains = [ mailDomain ];
+
+ ensureAccounts = [
+ "john@${mailDomain}"
+ "yorgus@${mailDomain}"
+ ];
+ ensureCredentials = {
+ # Do not use this in production. This will make passwords world-readable
+ # in the Nix store
+ "john@${mailDomain}".passwordFile = "${pkgs.writeText "postmaster" "john"}";
+ "yorgus@${mailDomain}".passwordFile = "${pkgs.writeText "postmaster" "yorgus"}";
+ };
+ };
+}