Used tmpfiles/sysusers workaround to support Image mode

Resolves: RHEL-156034
This commit is contained in:
Jaroslav Škarvada 2026-07-29 12:35:34 +02:00
parent b29332468b
commit aa84857d52
2 changed files with 27 additions and 11 deletions

View File

@ -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 <<EOF
u mailnull 47 - %{spooldir}/mqueue %{smshell}
u smmsp 51 - %{spooldir}/mqueue %{smshell}
EOF
%build
# generate redhat config file
cat > 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 <jskarvad@redhat.com> - 8.16.1-13
- Used tmpfiles/sysusers workaround to support Image mode
Resolves: RHEL-156034
* Tue Jul 21 2026 Jaroslav Škarvada <jskarvad@redhat.com> - 8.16.1-12
- Rebuilt for sendmail-milter move to AppStream
Resolves: RHEL-147755

4
sendmail.tmpfiles Normal file
View File

@ -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