Skip to content
This repository was archived by the owner on Jun 29, 2018. It is now read-only.

Commit b0f60f9

Browse files
committed
postfix: Support setting options for policyd-spf
1 parent b6e2bd0 commit b0f60f9

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

default.nix

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,18 @@ in
454454
'';
455455
};
456456

457+
policydSPFExtraConfig = mkOption {
458+
type = types.lines;
459+
default = "";
460+
example = ''
461+
skip_addresses = 127.0.0.0/8,::ffff:127.0.0.0/104,::1
462+
'';
463+
description = ''
464+
Extra configuration options for policyd-spf. This can be use to among
465+
other things skip spf checking for some IP addresses.
466+
'';
467+
};
468+
457469
monitoring = {
458470
enable = mkEnableOption "monitoring via monit";
459471

mail-server/postfix.nix

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,9 @@ let
9898
(lib.optional cfg.dkimSigning "unix:/run/opendkim/opendkim.sock")
9999
++ [ "unix:/run/rspamd/rspamd-milter.sock" ];
100100

101-
policyd-spf = pkgs.writeText "policyd-spf.conf" (''
102-
TestOnly = 1
103-
104-
HELO_reject = Fail
105-
Mail_From_reject = Fail
106-
107-
PermError_reject = False
108-
TempError_Defer = False
109-
110-
skip_addresses = 127.0.0.0/8,::ffff:127.0.0.0/104,::1
111-
'' + (lib.optionalString cfg.debug ''
101+
policyd-spf = pkgs.writeText "policyd-spf.conf" (
102+
cfg.policydExtraConfig
103+
+ (lib.optionalString cfg.debug ''
112104
debugLevel = 4
113105
''));
114106
in

0 commit comments

Comments
 (0)