Merge pull request #33227 from Ekleog/fcron-opensmtpd
fcron module: be compatible with non-wrapped sendmail's, like opensmt…
This commit is contained in:
commit
54b16bcd11
@ -90,14 +90,22 @@ in
|
|||||||
[ (allowdeny "allow" (cfg.allow))
|
[ (allowdeny "allow" (cfg.allow))
|
||||||
(allowdeny "deny" cfg.deny)
|
(allowdeny "deny" cfg.deny)
|
||||||
# see man 5 fcron.conf
|
# see man 5 fcron.conf
|
||||||
{ source = pkgs.writeText "fcron.conf" ''
|
{ source =
|
||||||
|
let
|
||||||
|
isSendmailWrapped =
|
||||||
|
lib.hasAttr "sendmail" config.security.wrappers;
|
||||||
|
sendmailPath =
|
||||||
|
if isSendmailWrapped then "/run/wrappers/bin/sendmail"
|
||||||
|
else "${config.system.path}/bin/sendmail";
|
||||||
|
in
|
||||||
|
pkgs.writeText "fcron.conf" ''
|
||||||
fcrontabs = /var/spool/fcron
|
fcrontabs = /var/spool/fcron
|
||||||
pidfile = /var/run/fcron.pid
|
pidfile = /var/run/fcron.pid
|
||||||
fifofile = /var/run/fcron.fifo
|
fifofile = /var/run/fcron.fifo
|
||||||
fcronallow = /etc/fcron.allow
|
fcronallow = /etc/fcron.allow
|
||||||
fcrondeny = /etc/fcron.deny
|
fcrondeny = /etc/fcron.deny
|
||||||
shell = /bin/sh
|
shell = /bin/sh
|
||||||
sendmail = /run/wrappers/bin/sendmail
|
sendmail = ${sendmailPath}
|
||||||
editor = ${pkgs.vim}/bin/vim
|
editor = ${pkgs.vim}/bin/vim
|
||||||
'';
|
'';
|
||||||
target = "fcron.conf";
|
target = "fcron.conf";
|
||||||
|
Loading…
Reference in New Issue
Block a user