summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Eiche <lewo@abesis.fr>2020-12-23 09:37:57 +0100
committerAntoine Eiche <lewo@abesis.fr>2020-12-23 09:39:55 +0100
commitee3d38a1570a1a9aa5e2daa3284d65a35d5e8864 (patch)
tree60844265a63842136b48729e7f91c7ef76ae4eee
parentae89eafb817f6c691cb0e97f9e67cd9204ada3a4 (diff)
Set mailserver.policydSPFExtraConfig in a debug module
The line type of this option make its concatenation cleaner: the user doesn't have to manually add `\n` to its policydSPFExtraConfig value when debug in set.
-rw-r--r--default.nix1
-rw-r--r--mail-server/debug.nix4
-rw-r--r--mail-server/postfix.nix6
3 files changed, 6 insertions, 5 deletions
diff --git a/default.nix b/default.nix
index 2de9b8a..1ca367c 100644
--- a/default.nix
+++ b/default.nix
@@ -894,6 +894,7 @@ in
imports = [
./mail-server/borgbackup.nix
+ ./mail-server/debug.nix
./mail-server/rsnapshot.nix
./mail-server/clamav.nix
./mail-server/monit.nix
diff --git a/mail-server/debug.nix b/mail-server/debug.nix
new file mode 100644
index 0000000..8107515
--- /dev/null
+++ b/mail-server/debug.nix
@@ -0,0 +1,4 @@
+{ config, lib, ... }:
+{
+ mailserver.policydSPFExtraConfig = lib.mkIf config.mailserver.debug "debugLevel = 4";
+}
diff --git a/mail-server/postfix.nix b/mail-server/postfix.nix
index d5281eb..4894a57 100644
--- a/mail-server/postfix.nix
+++ b/mail-server/postfix.nix
@@ -114,11 +114,7 @@ let
(lib.optional cfg.dkimSigning "unix:/run/opendkim/opendkim.sock")
++ [ "unix:/run/rspamd/rspamd-milter.sock" ];
- policyd-spf = pkgs.writeText "policyd-spf.conf" (
- cfg.policydSPFExtraConfig
- + (lib.optionalString cfg.debug ''
- debugLevel = 4
- ''));
+ policyd-spf = pkgs.writeText "policyd-spf.conf" cfg.policydSPFExtraConfig;
mappedFile = name: "hash:/var/lib/postfix/conf/${name}";