fix re-adding duplicated configuration blocks in post script [release 2.12.2-2mamba;Sat Jan 28 2023]

This commit is contained in:
Silvan Calarco 2024-01-05 20:22:15 +01:00
parent b74c98e7bb
commit 9270d397a5

View File

@ -3,7 +3,7 @@
Name: amavisd-new Name: amavisd-new
Version: 2.12.2 Version: 2.12.2
Release: 1mamba Release: 2mamba
Summary: An interface between mailer (MTA) and content checkers: virus scanners, and/or SpamAssassin Summary: An interface between mailer (MTA) and content checkers: virus scanners, and/or SpamAssassin
Group: System/Servers Group: System/Servers
Vendor: openmamba Vendor: openmamba
@ -80,9 +80,6 @@ install -D -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/amavisd.service
%systemd_postun_with_restart amavisd %systemd_postun_with_restart amavisd
%pre %pre
if [ $1 -gt 1 ]; then
/sbin/chkconfig --del amavisd 2>/dev/null
fi
if [ $1 -ge 1 ]; then if [ $1 -ge 1 ]; then
/usr/sbin/groupadd vscan -g %{vscan_gid} 2>/dev/null /usr/sbin/groupadd vscan -g %{vscan_gid} 2>/dev/null
/usr/sbin/useradd -u %{vscan_uid} -c 'Virus Scan user' -d /var/amavis -g vscan -s /bin/false vscan 2>/dev/null /usr/sbin/useradd -u %{vscan_uid} -c 'Virus Scan user' -d /var/amavis -g vscan -s /bin/false vscan 2>/dev/null
@ -98,9 +95,9 @@ if [ $1 -ge 1 ]; then
sed -i "s|# \$mydomain = .*|\$mydomain = '$DOMAIN';|" %{_sysconfdir}/amavisd.conf sed -i "s|# \$mydomain = .*|\$mydomain = '$DOMAIN';|" %{_sysconfdir}/amavisd.conf
postconf -e "strict_rfc821_envelopes = yes" postconf -e "strict_rfc821_envelopes = yes"
sudo postconf -e "content_filter = smtp-amavis:[127.0.0.1]:10024" sudo postconf -e "content_filter = smtp-amavis:[127.0.0.1]:10024"
[ "`grep amavisfeed %{_sysconfdir}/postfix/master.cf`" ] || { grep -q amavisd %{_sysconfdir}/postfix/master.cf || {
cat >> %{_sysconfdir}/postfix/master.cf << _EOF cat >> %{_sysconfdir}/postfix/master.cf << _EOF
# BEGIN of amavaisd-new configuration # BEGIN of amavisd-new configuration
smtp-amavis unix - - n - 2 smtp smtp-amavis unix - - n - 2 smtp
-o smtp_data_done_timeout=1200 -o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes -o smtp_send_xforward_command=yes
@ -132,7 +129,7 @@ _EOF
postfix reload postfix reload
} }
fi fi
exit 0 :
%preun %preun
%systemd_preun amavisd %systemd_preun amavisd
@ -140,7 +137,7 @@ if [ $1 -eq 0 ]; then
/usr/sbin/userdel vscan 2>/dev/null /usr/sbin/userdel vscan 2>/dev/null
/usr/sbin/groupdel vscan 2>/dev/null /usr/sbin/groupdel vscan 2>/dev/null
fi fi
exit 0 :
%files %files
%defattr(-,root,root) %defattr(-,root,root)
@ -152,6 +149,9 @@ exit 0
%doc LICENSE TODO %doc LICENSE TODO
%changelog %changelog
* Sat Jan 28 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 2.12.2-2mamba
- fix re-adding duplicated configuration blocks in post script
* Wed Dec 29 2021 Automatic Build System <autodist@mambasoft.it> 2.12.2-1mamba * Wed Dec 29 2021 Automatic Build System <autodist@mambasoft.it> 2.12.2-1mamba
- automatic version update by autodist - automatic version update by autodist