patch initscript to remove inclusion of deprecated /etc/sysconfig/network [release 2.8.1-2mamba;Mon Apr 21 2014]

This commit is contained in:
Silvan Calarco 2024-01-05 20:22:14 +01:00
parent 4d051beb42
commit 3a7c5e2b65
3 changed files with 187 additions and 0 deletions

View File

@ -1,2 +1,4 @@
# amavisd-new
amavisd-new is a high-performance interface between mailer (MTA) and content checkers: virus scanners, and/or SpamAssassin. It is written in Perl for maintainability, without paying a significant price for speed. It talks to MTA via (E)SMTP or LMTP, or by using helper programs. Best with Postfix, fine with dual-sendmail setup and Exim v4, works with sendmail/milter, or with any MTA as a SMTP relay. For Courier and qmail MTA integration there is a patch in the distributed package.

View File

@ -0,0 +1,13 @@
diff -Nru amavisd-new-2.8.1.orig/amavisd_init.sh amavisd-new-2.8.1/amavisd_init.sh
--- amavisd-new-2.8.1.orig/amavisd_init.sh 2002-11-16 05:22:47.000000000 +0100
+++ amavisd-new-2.8.1/amavisd_init.sh 2014-04-21 14:13:47.279674469 +0200
@@ -12,9 +12,6 @@
# Source function library.
. /etc/rc.d/init.d/functions
-# Source networking configuration.
-. /etc/sysconfig/network
-
#prog="/opt/amavisd-new/sbin/amavisd"
prog="/usr/sbin/amavisd"
prog_base="$(basename ${prog})"

172
amavisd-new.spec Normal file
View File

@ -0,0 +1,172 @@
%define vscan_uid 65416
%define vscan_gid 65416
Name: amavisd-new
Version: 2.8.1
Release: 2mamba
Summary: An interface between mailer (MTA) and content checkers: virus scanners, and/or SpamAssassin
Group: System/Servers
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.ijs.si/software/amavisd/
Source: http://www.ijs.si/software/amavisd/amavisd-new-%{version}.tar.gz
Patch0: amavisd-new-2.8.1-initscript-no-deprecated-network.patch
License: GPL
BuildRoot: %{_tmppath}/%{name}-%{version}-root
## AUTOBUILDREQ-BEGIN
BuildRequires: libperl
BuildRequires: perl-MIME-Tools
BuildRequires: perl-Net-Server
BuildRequires: perl-Unix-Syslog
BuildRequires: perl-devel
## AUTOBUILDREQ-END
Requires(pre): postfix
Requires(pre): clamd
Requires: perl-BerkeleyDB
Requires: SpamAssassin
Requires: perl-Convert-TNEF
Requires: perl-Convert-UUlib
Requires: perl-Mail-DKIM
Requires: perl-Mail-Tools
Requires: perl-MIME-tools
Requires: perl-Archive-Zip
Requires: clamav
Requires: clamd
Requires: pax
Requires: gzip
Requires: bzip2
Requires: lzop
Requires: rpm
Requires: cpio
Requires: tar
Requires: unrar
Requires: arj
Requires: nomarch
#Requires: zoo
#Requires: lha
Requires: cabextract
Requires: altermime
Requires: p7zip
Requires: tnef
%description
amavisd-new is a high-performance interface between mailer (MTA) and content checkers: virus scanners, and/or SpamAssassin. It is written in Perl for maintainability, without paying a significant price for speed. It talks to MTA via (E)SMTP or LMTP, or by using helper programs. Best with Postfix, fine with dual-sendmail setup and Exim v4, works with sendmail/milter, or with any MTA as a SMTP relay. For Courier and qmail MTA integration there is a patch in the distributed package.
%prep
%setup -q
%patch0 -p1
%build
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
install -d %{buildroot}/var/amavis/{tmp,var,db,home}
install -D -m0755 amavisd %{buildroot}%{_sbindir}/amavisd
install -D -m0755 amavisd_init.sh %{buildroot}%{_initrddir}/amavisd
install -D -m0640 amavisd.conf %{buildroot}%{_sysconfdir}/amavisd.conf
install -d %{buildroot}/var/virusmails
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%pre
if [ $1 -ge 1 ]; then
/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/usermod clamav -G vscan
fi
exit 0
%post
if [ $1 -ge 1 ]; then
FQDN=`hostname -f`
sed -i "s|# \$myhostname.*|\$myhostname = '$FQDN';|" %{_sysconfdir}/amavisd.conf
/sbin/chkconfig --add amavisd
/sbin/service amavisd restart
postconf -e "strict_rfc821_envelopes = yes"
[ "`grep amavisfeed %{_sysconfdir}/postfix/master.cf`" ] || {
cat >> %{_sysconfdir}/postfix/master.cf << _EOF
# BEGIN of amavaisd-new configuration
amavisfeed unix - - n - 2 lmtp
-o lmtp_data_done_timeout=1200
-o lmtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_data_restrictions=reject_unauth_pipelining
-o smtpd_end_of_data_restrictions=
-o smtpd_restriction_classes=
-o mynetworks=127.0.0.0/8
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters
-o local_header_rewrite_clients=
# END of amavisd-new configuration
_EOF
postfix reload
}
fi
exit 0
%preun
if [ $1 -eq 0 ]; then
/sbin/chkconfig --del amavisd
/sbin/service amavisd stop
/usr/sbin/userdel vscan 2>/dev/null
/usr/sbin/groupdel vscan 2>/dev/null
fi
exit 0
%files
%defattr(-,root,root)
%attr(0640,root,vscan) %config(noreplace) %{_sysconfdir}/amavisd.conf
%{_initrddir}/amavisd
%{_sbindir}/amavisd
%attr(0750,vscan,vscan) /var/virusmails
%attr(0750,vscan,vscan) /var/amavis
%doc LICENSE TODO
%changelog
* Mon Apr 21 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 2.8.1-2mamba
- patch initscript to remove inclusion of deprecated /etc/sysconfig/network
* Mon Jul 08 2013 Automatic Build System <autodist@mambasoft.it> 2.8.1-1mamba
- automatic version update by autodist
* Thu May 23 2013 Automatic Build System <autodist@mambasoft.it> 2.8.0-1mamba
- automatic update by autodist
* Tue Mar 06 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.0-2mamba
- added requirements for arj and p7zip
* Mon Jul 25 2011 Automatic Build System <autodist@mambasoft.it> 2.7.0-1mamba
- automatic version update by autodist
* Sun Jun 19 2011 Automatic Build System <autodist@mambasoft.it> 2.6.6-1mamba
- automatic update by autodist
* Wed Apr 13 2011 Automatic Build System <autodist@mambasoft.it> 2.6.5-1mamba
- automatic update by autodist
* Tue Dec 07 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6.4-2mamba
- added requirement for altermime
* Tue Jul 21 2009 Automatic Build System <autodist@mambasoft.it> 2.6.4-1mamba
- automatic update by autodist
* Mon Jul 06 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6.3-2mamba
- added requirement for clamd and archivers
- put clamav user in vscan group
* Mon Apr 27 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6.3-1mamba
- package created by autospec