1 { lib, pkgs, config, ... }:
3 options.myServices.mail.rspamd.sockets = lib.mkOption {
4 type = lib.types.attrsOf lib.types.path;
6 worker-controller = "/run/rspamd/worker-controller.sock";
13 config = lib.mkIf config.myServices.mail.enable {
14 services.duplyBackup.profiles.mail.excludeFile = ''
17 services.cron.systemCronJobs = let
18 cron_script = pkgs.runCommand "cron_script" {
19 buildInputs = [ pkgs.makeWrapper ];
22 cp ${./scan_reported_mails} $out/scan_reported_mails
25 wrapProgram "$i" --prefix PATH : ${lib.makeBinPath [ pkgs.coreutils pkgs.rspamd pkgs.flock ]}
29 [ "*/20 * * * * vhost ${cron_script}/scan_reported_mails" ];
35 "actions.conf".text = ''
40 "milter_headers.conf".text = ''
41 extended_spam_headers = true;
45 "redis.conf".text = ''
46 servers = "${config.myEnv.mail.rspamd.redis.socket}";
47 db = "${config.myEnv.mail.rspamd.redis.db}";
49 "classifier-bayes.conf".text = ''
52 servers = "${config.myEnv.mail.rspamd.redis.socket}";
53 database = "${config.myEnv.mail.rspamd.redis.db}";
72 enable_password = "${config.myEnv.mail.rspamd.write_password_hashed}";
73 password = "${config.myEnv.mail.rspamd.read_password_hashed}";
76 socket = config.myServices.mail.rspamd.sockets.worker-controller;
78 owner = config.services.rspamd.user;