%define vscan_uid 65416 %define vscan_gid 65416 Name: amavisd-new Version: 2.10.0 Release: 1mamba Summary: An interface between mailer (MTA) and content checkers: virus scanners, and/or SpamAssassin Group: System/Servers Vendor: openmamba Distribution: openmamba Packager: Silvan Calarco URL: http://www.ijs.si/software/amavisd/ 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 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: perl-File-LibMagic 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 install -D -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/amavisd.service %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %postun %systemd_postun_with_restart amavisd %pre if [ $1 -gt 1 ]; then /sbin/chkconfig --del amavisd 2>/dev/null fi 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 : %post if [ $1 -ge 1 ]; then #FQDN=`hostname -f` #sed -i "s|# \$myhostname.*|\$myhostname = '$FQDN';|" %{_sysconfdir}/amavisd.conf DOMAIN=`hostname -d` sed -i "s|# \$mydomain = .*|\$mydomain = '$DOMAIN';|" %{_sysconfdir}/amavisd.conf postconf -e "strict_rfc821_envelopes = yes" sudo postconf -e "content_filter = smtp-amavis:[127.0.0.1]:10024" [ "`grep amavisfeed %{_sysconfdir}/postfix/master.cf`" ] || { cat >> %{_sysconfdir}/postfix/master.cf << _EOF # BEGIN of amavaisd-new configuration smtp-amavis unix - - n - 2 smtp -o smtp_data_done_timeout=1200 -o smtp_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 local_recipient_maps= -o relay_recipient_maps= -o smtpd_restriction_classes= -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 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 %systemd_post amavisd postfix reload } fi exit 0 %preun %systemd_preun amavisd if [ $1 -eq 0 ]; then /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 %{_sbindir}/amavisd %{_unitdir}/amavisd.service %attr(0750,vscan,vscan) /var/virusmails %attr(0750,vscan,vscan) /var/amavis %doc LICENSE TODO %changelog * Fri Oct 24 2014 Silvan Calarco 2.10.0-1mamba - update to 2.10.0 - systemd switch * Thu Jul 24 2014 Silvan Calarco 2.9.1-2mamba - small fixes to amavisd.conf and postfix configuration changes upon first install * Tue Jul 08 2014 Automatic Build System 2.9.1-1mamba - automatic update by autodist * Mon Apr 21 2014 Silvan Calarco 2.8.1-2mamba - patch initscript to remove inclusion of deprecated /etc/sysconfig/network * Mon Jul 08 2013 Automatic Build System 2.8.1-1mamba - automatic version update by autodist * Thu May 23 2013 Automatic Build System 2.8.0-1mamba - automatic update by autodist * Tue Mar 06 2012 Silvan Calarco 2.7.0-2mamba - added requirements for arj and p7zip * Mon Jul 25 2011 Automatic Build System 2.7.0-1mamba - automatic version update by autodist * Sun Jun 19 2011 Automatic Build System 2.6.6-1mamba - automatic update by autodist * Wed Apr 13 2011 Automatic Build System 2.6.5-1mamba - automatic update by autodist * Tue Dec 07 2010 Silvan Calarco 2.6.4-2mamba - added requirement for altermime * Tue Jul 21 2009 Automatic Build System 2.6.4-1mamba - automatic update by autodist * Mon Jul 06 2009 Silvan Calarco 2.6.3-2mamba - added requirement for clamd and archivers - put clamav user in vscan group * Mon Apr 27 2009 Silvan Calarco 2.6.3-1mamba - package created by autospec