spamassassin: use virtual user home directories under /var/lib/spamassassin to avoid permission problems
When spamd isn't running as 'root', it cannot access the usual ~/.spamassassin path where user-specific files normally reside. Instead, we use the path /var/lib/spamassassin-<user> to store those home directories.
This commit is contained in:
parent
bcb8038726
commit
6f052ee62e
@ -126,6 +126,7 @@ in
|
|||||||
clamav = 51;
|
clamav = 51;
|
||||||
fprot = 52;
|
fprot = 52;
|
||||||
wwwrun = 54;
|
wwwrun = 54;
|
||||||
|
spamd = 55;
|
||||||
networkmanager = 56;
|
networkmanager = 56;
|
||||||
|
|
||||||
# When adding a gid, make sure it doesn't match an existing uid.
|
# When adding a gid, make sure it doesn't match an existing uid.
|
||||||
|
@ -38,17 +38,23 @@ in
|
|||||||
# Allow users to run 'spamc'.
|
# Allow users to run 'spamc'.
|
||||||
environment.systemPackages = [ pkgs.spamassassin ];
|
environment.systemPackages = [ pkgs.spamassassin ];
|
||||||
|
|
||||||
users.extraUsers = singleton
|
users.extraUsers = singleton {
|
||||||
{ name = "spamd";
|
name = "spamd";
|
||||||
description = "Spam Assassin Daemon";
|
description = "Spam Assassin Daemon";
|
||||||
uid = config.ids.uids.spamd;
|
uid = config.ids.uids.spamd;
|
||||||
};
|
group = "spamd";
|
||||||
|
};
|
||||||
|
|
||||||
|
users.extraGroups = singleton {
|
||||||
|
name = "spamd";
|
||||||
|
gid = config.ids.gids.spamd;
|
||||||
|
};
|
||||||
|
|
||||||
jobs.spamd = {
|
jobs.spamd = {
|
||||||
description = "Spam Assassin Server";
|
description = "Spam Assassin Server";
|
||||||
startOn = "started networking and filesystem";
|
startOn = "started networking and filesystem";
|
||||||
environment.TZ = config.time.timeZone;
|
environment.TZ = config.time.timeZone;
|
||||||
exec = "${pkgs.spamassassin}/bin/spamd ${optionalString cfg.debug "-D"} --username=spamd --pidfile=/var/run/spamd.pid";
|
exec = "${pkgs.spamassassin}/bin/spamd ${optionalString cfg.debug "-D"} --username=spamd --groupname=spamd --nouser-config --virtual-config-dir=/var/lib/spamassassin/user-%u --allow-tell --pidfile=/var/run/spamd.pid";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user