Initial version of a SpamAssassin service.
The configuration is expected to be managed by the user in /etc/spamassassin.
This commit is contained in:
parent
1fcef0a0e0
commit
1b249eaf05
|
@ -88,6 +88,7 @@
|
|||
./services/mail/freepops.nix
|
||||
./services/mail/mail.nix
|
||||
./services/mail/postfix.nix
|
||||
./services/mail/spamassassin.nix
|
||||
./services/misc/autofs.nix
|
||||
./services/misc/disnix.nix
|
||||
./services/misc/felix.nix
|
||||
|
|
45
modules/services/mail/spamassassin.nix
Normal file
45
modules/services/mail/spamassassin.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.spamassassin;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
|
||||
services.spamassassin = {
|
||||
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
description = "Whether to run the SpamAssassin daemon.";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
# This makes comfortable for users to run 'spamassassin'.
|
||||
environment.systemPackages = [ pkgs.spamassassin ];
|
||||
|
||||
jobs.spamd = {
|
||||
description = "Spam Assassin Server";
|
||||
startOn = "started networking and filesystem";
|
||||
environment.TZ = config.time.timeZone;
|
||||
exec = "spamd -C /etc/spamassassin/init.pre --siteconfigpath=/etc/spamassassin --debug --pidfile=/var/run/spamd.pid";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in a new issue