···
rspamdCfg = config.services.rspamd;
cfg = config.services.rmilter;
10
-
inetSockets = map (sock: let s = stringSplit ":" sock; in "inet:${last s}:${head s}") cfg.bindInetSockets;
10
+
inetSockets = map (sock: let s = splitString ":" sock; in "inet:${last s}@${head s}") cfg.bindInetSockets;
unixSockets = map (sock: "unix:${sock}") cfg.bindUnixSockets;
allSockets = unixSockets ++ inetSockets;
16
-
pidfile = /run/rmilter/rmilter.pid;
17
-
bind_socket = ${if cfg.socketActivation then "fd:3" else concatStringsSep ", " allSockets};
16
+
pidfile = /run/rmilter/rmilter.pid;
17
+
bind_socket = ${if cfg.socketActivation then "fd:3" else last inetSockets};
'' + (with cfg.rspamd; if enable then ''
22
-
servers = ${concatStringsSep ", " servers};
23
-
connect_timeout = 1s;
24
-
results_timeout = 20s;
28
-
reject_message = "${rejectMessage}";
29
-
${optionalString (length whitelist != 0) "whitelist = ${concatStringsSep ", " whitelist};"}
21
+
servers = ${concatStringsSep ", " servers};
22
+
connect_timeout = 1s;
23
+
results_timeout = 20s;
27
+
reject_message = "${rejectMessage}";
28
+
${optionalString (length whitelist != 0) "whitelist = ${concatStringsSep ", " whitelist};"}
31
-
# rspamd_metric - metric for using with rspamd
32
-
# Default: "default"
33
-
rspamd_metric = "default";
30
+
# rspamd_metric - metric for using with rspamd
31
+
# Default: "default"
32
+
rspamd_metric = "default";
'' else "") + cfg.extraConfig;
rmilterConfigFile = pkgs.writeText "rmilter.conf" rmilterConf;
···
Enable systemd socket activation for rmilter.
103
-
(disabling socket activation not recommended
104
-
when unix socket used, and follow to wrong
105
-
permissions on unix domain socket.)
103
+
Disabling socket activation is not recommended when a Unix
104
+
domain socket is used and could lead to incorrect
105
+
permissions. Therefore, setting this to false will
106
+
configure rmilter to use an inet socket only.