From 14ad30e65d1c99eeeb93704542ae733f8983d452 Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Sat, 17 Dec 2022 12:58:27 +0100 Subject: [PATCH] beautified the file and added opendkim --- modules/mail.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/mail.nix b/modules/mail.nix index abfe0ec..e03672c 100644 --- a/modules/mail.nix +++ b/modules/mail.nix @@ -1,15 +1,17 @@ { config, pkgs, ... }: - let hostname = "mail.test.stramke.com"; + let + hostname = "mail.test.stramke.com"; + domain = "test.stramke.com"; in { networking.firewall.allowedTCPPorts = [ 25 587 143 ]; services = { postfix = { enable = true; hostname = "${hostname}"; - domain = "test.stramke.com"; + domain = "${domain}"; relayHost = ""; - origin = "test.stramke.com"; - destination = ["mail.test.stramke.com" "test.stramke.com" "localhost"]; + origin = "${domain}"; + destination = ["${hostname}" "${domain}" "localhost"]; config = { mynetworks = "168.119.135.69/32 10.0.0.0/24 0.0.0.0/0 127.0.0.1"; smtpd_recipient_restrictions = [ @@ -62,6 +64,14 @@ } ''; }; + rspamd = { + enable = true; + }; + opendkim = { + enable = true; + selector = "mail"; + domains = "csl:${domain}"; + }; }; }