opensmtpd: fix offline enqueueing (#491938)
This commit is contained in:
@@ -105,12 +105,21 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
security.wrappers.smtpctl = {
|
||||
owner = "root";
|
||||
group = "smtpq";
|
||||
setuid = false;
|
||||
setgid = true;
|
||||
source = "${cfg.package}/bin/smtpctl";
|
||||
security.wrappers = {
|
||||
makemap = {
|
||||
owner = "root";
|
||||
group = "smtpq";
|
||||
setuid = false;
|
||||
setgid = true;
|
||||
source = "${cfg.package}/bin/smtpctl";
|
||||
};
|
||||
smtpctl = {
|
||||
owner = "root";
|
||||
group = "smtpq";
|
||||
setuid = false;
|
||||
setgid = true;
|
||||
source = "${cfg.package}/bin/smtpctl";
|
||||
};
|
||||
};
|
||||
|
||||
services.mail.sendmailSetuidWrapper = lib.mkIf cfg.setSendmail (
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
Commit ID: 0527fcb65d6af4271a33dbd425f30d457fc7ab4f
|
||||
Change ID: puqrnyuutmspqxqtkkqqrsmsxnyqvomm
|
||||
Author : Ricardo Correia <someplaceguy@wizy.org> (2026-02-18 23:51:00)
|
||||
Committer: Ricardo Correia <someplaceguy@wizy.org> (2026-02-19 00:43:47)
|
||||
|
||||
(no description set)
|
||||
|
||||
diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c
|
||||
index 2365b1ee46..b9e40e1417 100644
|
||||
--- a/usr.sbin/smtpd/smtpd.c
|
||||
+++ b/usr.sbin/smtpd/smtpd.c
|
||||
@@ -1806,7 +1806,7 @@
|
||||
envp[1] = (char *)NULL;
|
||||
environ = envp;
|
||||
|
||||
- execvp(PATH_SMTPCTL, args.list);
|
||||
+ execvp(@@PATH_SENDMAIL@@, args.list);
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
pam,
|
||||
libxcrypt,
|
||||
nixosTests,
|
||||
binPath ? "/run/wrappers/bin",
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
@@ -43,11 +44,20 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
patches = [
|
||||
./proc_path.diff # TODO: upstream to OpenSMTPD, see https://github.com/NixOS/nixpkgs/issues/54045
|
||||
./offline.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace mk/smtpctl/Makefile.am --replace "chgrp" "true"
|
||||
substituteInPlace mk/smtpctl/Makefile.am --replace "chmod 2555" "chmod 0555"
|
||||
substituteInPlace mk/smtpctl/Makefile.am \
|
||||
--replace-fail "chgrp" "true" \
|
||||
--replace "chmod 2555" "chmod 0555"
|
||||
substituteInPlace mk/pathnames \
|
||||
--replace-fail "-DPATH_SMTPCTL=\\\"\$(sbindir)" \
|
||||
"-DPATH_SMTPCTL=\\\"${binPath}" \
|
||||
--replace-fail "-DPATH_MAKEMAP=\\\"\$(sbindir)" \
|
||||
"-DPATH_MAKEMAP=\\\"${binPath}"
|
||||
substituteInPlace usr.sbin/smtpd/smtpd.c \
|
||||
--replace-fail "@@PATH_SENDMAIL@@" "\"${binPath}/sendmail\""
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
|
||||
Reference in New Issue
Block a user