From aa84857d52fe3271afb346fc610ecde9cf8602b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Wed, 29 Jul 2026 12:35:34 +0200 Subject: [PATCH] Used tmpfiles/sysusers workaround to support Image mode Resolves: RHEL-156034 --- sendmail.spec | 34 +++++++++++++++++++++++----------- sendmail.tmpfiles | 4 ++++ 2 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 sendmail.tmpfiles diff --git a/sendmail.spec b/sendmail.spec index accdad2..598dd7a 100644 --- a/sendmail.spec +++ b/sendmail.spec @@ -29,7 +29,7 @@ Summary: A widely used Mail Transport Agent (MTA) Name: sendmail Version: 8.16.1 -Release: 12%{?dist} +Release: 13%{?dist} License: Sendmail URL: http://www.sendmail.org/ @@ -64,6 +64,8 @@ Source15: sendmail-etc-mail-mailertable Source16: sendmail-etc-mail-trusted-users # default /etc/mail/virtusertable Source17: sendmail-etc-mail-virtusertable +# /var/spool workaround for Image mode +Source18: sendmail.tmpfiles # fix man path and makemap man page Patch3: sendmail-8.14.4-makemapman.patch # fix smrsh paths @@ -214,6 +216,12 @@ done sed -i 's|/usr/local/bin/perl|%{_bindir}/perl|' contrib/*.pl +# Create a sysusers.d config file +cat >sendmail.sysusers.conf < redhat.config.m4 << EOF @@ -475,10 +483,15 @@ touch %{buildroot}%{_sysconfdir}/pam.d/smtp # create stub man pages for m in man8/hoststat.8 man8/purgestat.8; do - [ -f %{buildroot}%{_mandir}/$m ] || + [ -f %{buildroot}%{_mandir}/$m ] || echo ".so man8/sendmail.8" > %{buildroot}%{_mandir}/$m done +install -m0644 -D sendmail.sysusers.conf %{buildroot}%{_sysusersdir}/sendmail.conf + +# systemd-tmpfiles +install -p -D -m 0644 %{SOURCE18} %{buildroot}%{_tmpfilesdir}/sendmail.conf + %pre getent group mailnull >/dev/null || \ %{_sbindir}/groupadd -g 47 -r mailnull >/dev/null 2>&1 @@ -545,13 +558,6 @@ exit 0 %{_sysconfdir}/sasl2 2>/dev/null || : %endif -# Create sm-client.st if it doesn't exist -if [ ! -f %{spooldir}/clientmqueue/sm-client.st ]; then - touch %{spooldir}/clientmqueue/sm-client.st - chown smmsp:smmsp %{spooldir}/clientmqueue/sm-client.st - chmod 0660 %{spooldir}/clientmqueue/sm-client.st -fi - # Create self-signed SSL certificate if [ ! -f %{sslkey} ]; then umask 077 @@ -636,8 +642,8 @@ exit 0 %dir %{stdir} %dir %{_sysconfdir}/smrsh %dir %{maildir} -%attr(0770,smmsp,smmsp) %dir %{spooldir}/clientmqueue -%attr(0700,root,mail) %dir %{spooldir}/mqueue +%ghost %attr(0770,smmsp,smmsp) %dir %{spooldir}/clientmqueue +%ghost %attr(0700,root,mail) %dir %{spooldir}/mqueue %config(noreplace) %verify(not size mtime md5) %{stdir}/statistics %config(noreplace) %{maildir}/Makefile @@ -671,6 +677,8 @@ exit 0 %if "%{with_sasl2}" == "yes" %config(noreplace) %{_sysconfdir}/sasl2/Sendmail.conf %endif +%{_sysusersdir}/sendmail.conf +%{_tmpfilesdir}/sendmail.conf %files cf %doc %{sendmailcf}/README @@ -709,6 +717,10 @@ exit 0 %changelog +* Wed Jul 29 2026 Jaroslav Škarvada - 8.16.1-13 +- Used tmpfiles/sysusers workaround to support Image mode + Resolves: RHEL-156034 + * Tue Jul 21 2026 Jaroslav Škarvada - 8.16.1-12 - Rebuilt for sendmail-milter move to AppStream Resolves: RHEL-147755 diff --git a/sendmail.tmpfiles b/sendmail.tmpfiles new file mode 100644 index 0000000..1b7e21a --- /dev/null +++ b/sendmail.tmpfiles @@ -0,0 +1,4 @@ +# sendmail spool +d /var/spool/mqueue 0700 root mail - +d /var/spool/clientmqueue 0770 smmsp smmsp - +f /var/spool/clientmqueue/sm-client.st 0660 smmsp smmsp