Merge pull request #243289 from SuperSandro2000/nullmailer-group

nixos/nullmailer: allow users in the nullmailer group to send mails
This commit is contained in:
Sandro 2023-07-13 21:44:18 +02:00 committed by GitHub
commit 6873b5c7ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -203,7 +203,7 @@ with lib;
users = {
users.${cfg.user} = {
description = "Nullmailer relay-only mta user";
group = cfg.group;
inherit (cfg) group;
isSystemUser = true;
};
@ -211,10 +211,10 @@ with lib;
};
systemd.tmpfiles.rules = [
"d /var/spool/nullmailer - ${cfg.user} - - -"
"d /var/spool/nullmailer/failed 750 ${cfg.user} - - -"
"d /var/spool/nullmailer/queue 750 ${cfg.user} - - -"
"d /var/spool/nullmailer/tmp 750 ${cfg.user} - - -"
"d /var/spool/nullmailer - ${cfg.user} ${cfg.group} - -"
"d /var/spool/nullmailer/failed 770 ${cfg.user} ${cfg.group} - -"
"d /var/spool/nullmailer/queue 770 ${cfg.user} ${cfg.group} - -"
"d /var/spool/nullmailer/tmp 770 ${cfg.user} ${cfg.group} - -"
];
systemd.services.nullmailer = {
@ -238,7 +238,7 @@ with lib;
program = "sendmail";
source = "${pkgs.nullmailer}/bin/sendmail";
owner = cfg.user;
group = cfg.group;
inherit (cfg) group;
setuid = true;
setgid = true;
};