Initial version of a SpamAssassin service.

The configuration is expected to be managed by the user in /etc/spamassassin.
This commit is contained in:
Peter Simons 2012-08-03 15:11:28 +02:00
parent 1fcef0a0e0
commit 1b249eaf05
2 changed files with 46 additions and 0 deletions

View file

@ -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

View 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";
};
};
}