From 0ad69b95b2d254649473808b1c196be489b69cb3 Mon Sep 17 00:00:00 2001 From: Daniel Frank Date: Mon, 21 Feb 2022 21:55:38 +0100 Subject: [PATCH] Allow a specific mailserver to skip the spam filter --- mailserver.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mailserver.nix b/mailserver.nix index 6ec6b6e..6d9a121 100644 --- a/mailserver.nix +++ b/mailserver.nix @@ -1,5 +1,12 @@ { config, pkgs, ... }: +let + spamfilter_greenlight_map = pkgs.writeText "spamfilter_greenlight_map.cf" '' + # Disable Milters for specific clients + 2a00:14b0:4200:3000:122::1/128 DISABLE + 212.12.48.122/32 DISABLE + ''; +in { # Import some configuration as they are too long to be easily readable here imports = [ @@ -17,4 +24,8 @@ adminAddress = "postmaster@mail.hamburg.freifunk.net"; mailFQDN = "mail2.hamburg.freifunk.net"; }; + # Special config + services.postfix.config = { + smtpd_milter_maps = "cidr:${spamfilter_greenlight_map}"; + }; }