update to 2.10.0

systemd switch [release 2.10.0-1mamba;Fri Oct 24 2014]
This commit is contained in:
Silvan Calarco 2024-01-05 20:22:15 +01:00
parent 996c8bb120
commit 13f02a0df4
2 changed files with 34 additions and 11 deletions

12
amavisd-new-service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=Amavisd an interface between MTA and content checkers.
After=syslog.target network.target
Wants=clamd.service
[Service]
Type=forking
PIDFile=/var/amavis/amavisd.pid
ExecStart=/usr/sbin/amavisd -c /etc/amavisd.conf
[Install]
WantedBy=multi-user.target

View File

@ -2,15 +2,16 @@
%define vscan_gid 65416 %define vscan_gid 65416
Name: amavisd-new Name: amavisd-new
Version: 2.9.1 Version: 2.10.0
Release: 2mamba Release: 1mamba
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
Distribution: openmamba Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.ijs.si/software/amavisd/ URL: http://www.ijs.si/software/amavisd/
Source: http://www.ijs.si/software/amavisd/amavisd-new-%{version}.tar.gz Source: http://www.ijs.si/software/amavisd/amavisd-new-%{version}.tar.xz
Source1: amavisd-new-service
Patch0: amavisd-new-2.8.1-initscript-no-deprecated-network.patch Patch0: amavisd-new-2.8.1-initscript-no-deprecated-network.patch
License: GPL License: GPL
BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRoot: %{_tmppath}/%{name}-%{version}-root
@ -31,6 +32,7 @@ Requires: perl-Mail-DKIM
Requires: perl-Mail-Tools Requires: perl-Mail-Tools
Requires: perl-MIME-tools Requires: perl-MIME-tools
Requires: perl-Archive-Zip Requires: perl-Archive-Zip
Requires: perl-File-LibMagic
Requires: clamav Requires: clamav
Requires: clamd Requires: clamd
Requires: pax Requires: pax
@ -55,7 +57,7 @@ amavisd-new is a high-performance interface between mailer (MTA) and content che
%prep %prep
%setup -q %setup -q
%patch0 -p1 #%patch0 -p1
%build %build
@ -63,20 +65,27 @@ amavisd-new is a high-performance interface between mailer (MTA) and content che
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
install -d %{buildroot}/var/amavis/{tmp,var,db,home} install -d %{buildroot}/var/amavis/{tmp,var,db,home}
install -D -m0755 amavisd %{buildroot}%{_sbindir}/amavisd install -D -m0755 amavisd %{buildroot}%{_sbindir}/amavisd
install -D -m0755 amavisd_init.sh %{buildroot}%{_initrddir}/amavisd #install -D -m0755 amavisd_init.sh %{buildroot}%{_initrddir}/amavisd
install -D -m0640 amavisd.conf %{buildroot}%{_sysconfdir}/amavisd.conf install -D -m0640 amavisd.conf %{buildroot}%{_sysconfdir}/amavisd.conf
install -d %{buildroot}/var/virusmails install -d %{buildroot}/var/virusmails
install -D -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/amavisd.service
%clean %clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%postun
%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
/usr/sbin/usermod clamav -G vscan /usr/sbin/usermod clamav -G vscan
fi fi
exit 0 :
%post %post
if [ $1 -ge 1 ]; then if [ $1 -ge 1 ]; then
@ -84,8 +93,6 @@ if [ $1 -ge 1 ]; then
#sed -i "s|# \$myhostname.*|\$myhostname = '$FQDN';|" %{_sysconfdir}/amavisd.conf #sed -i "s|# \$myhostname.*|\$myhostname = '$FQDN';|" %{_sysconfdir}/amavisd.conf
DOMAIN=`hostname -d` DOMAIN=`hostname -d`
sed -i "s|# \$mydomain = .*|\$mydomain = '$DOMAIN';|" %{_sysconfdir}/amavisd.conf sed -i "s|# \$mydomain = .*|\$mydomain = '$DOMAIN';|" %{_sysconfdir}/amavisd.conf
/sbin/chkconfig --add amavisd
/sbin/service amavisd restart
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 amavisfeed %{_sysconfdir}/postfix/master.cf`" ] || {
@ -118,15 +125,15 @@ smtp-amavis unix - - n - 2 smtp
-o local_header_rewrite_clients= -o local_header_rewrite_clients=
# END of amavisd-new configuration # END of amavisd-new configuration
_EOF _EOF
%systemd_post amavisd
postfix reload postfix reload
} }
fi fi
exit 0 exit 0
%preun %preun
%systemd_preun amavisd
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
/sbin/chkconfig --del amavisd
/sbin/service amavisd stop
/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
@ -135,13 +142,17 @@ exit 0
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%attr(0640,root,vscan) %config(noreplace) %{_sysconfdir}/amavisd.conf %attr(0640,root,vscan) %config(noreplace) %{_sysconfdir}/amavisd.conf
%{_initrddir}/amavisd
%{_sbindir}/amavisd %{_sbindir}/amavisd
%{_unitdir}/amavisd.service
%attr(0750,vscan,vscan) /var/virusmails %attr(0750,vscan,vscan) /var/virusmails
%attr(0750,vscan,vscan) /var/amavis %attr(0750,vscan,vscan) /var/amavis
%doc LICENSE TODO %doc LICENSE TODO
%changelog %changelog
* Fri Oct 24 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 2.10.0-1mamba
- update to 2.10.0
- systemd switch
* Thu Jul 24 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 2.9.1-2mamba * Thu Jul 24 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 2.9.1-2mamba
- small fixes to amavisd.conf and postfix configuration changes upon first install - small fixes to amavisd.conf and postfix configuration changes upon first install