Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > aa9a8b7049eb9805bf3cd467266b38cb > files > 5

amavisd-new-2.2.1-2mdk.src.rpm

%define name		amavisd-new
%define version		2.2.1
%define rel		2

%define build_plf 0
%{?_with_plf: %{expand: %%define build_plf 1}}
%{?_without_plf: %{expand: %%define build_plf 0}}

%if !%build_plf
%define release %{rel}mdk
%else
%define release %{rel}plf
%endif

Summary:	A Mail Virus Scanner
Name:		%{name}
Version:	%{version}
Release:	%{release}
URL:		http://www.ijs.si/software/amavisd/
Source0:	%{name}-%{version}.tar.bz2
Patch10:	amavisd-new-2.1.2-init.patch.bz2
Patch11:	amavisd-new-2.2.1-conf.patch.bz2
Patch12:	amavisd-new-2.2.1-daemon.patch.bz2
License:	GPL
Group:		Networking/Mail
Requires:	file >= 3.41
Requires:	smtpdaemon
Requires:	perl-Archive-Tar
Requires:	perl-Archive-Zip
Requires:	perl-BerkeleyDB
Requires:	perl-Compress-Zlib
Requires:	perl-Convert-UUlib
Requires:	perl-Convert-TNEF
Requires:	perl-DBI
Requires:	perl-Digest-MD5
Requires:	perl-IO-stringy
Requires:	perl-libnet
Requires:	perl-Mail-SpamAssassin
Requires:	perl-MailTools
Requires:	perl-MIME-Base64
Requires:	perl-MIME-tools >= 5.411
Requires:	perl-Net-Server >= 0.84
Requires:	perl-Razor-Agent
Requires:	perl-Time-HiRes
Requires:	perl-Unix-Syslog
Requires:	spamassassin >= 2.60
Requires:	binutils
Requires:	bzip2
Requires:	lha
Requires:	lzop
Requires:	ncompress
Requires:	nomarch
Requires:	pax
Requires:	ripole
%if %build_plf
#Requires:	arc
Requires:	unace
Requires:	unarj
Requires:	unrar
Requires:	zoo
Requires:	freeze
%endif
Provides:	amavisd
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildArch:	noarch
PreReq:		rpm-helper >= 0.3
#PreReq:	clamav

%description
AMaViS is a perl script that interfaces a Mail Transport Agent (MTA)
with one or more virus scanners (not provided).

%prep
%setup -q -n %{name}-%{version}
%patch10 -p1 -b .init
%patch11 -p1 -b .confpch
%patch12 -p1 -b .daemon

%install
mkdir -p \
	%buildroot%_initrddir \
	%buildroot%_sysconfdir/amavisd \
	%buildroot%_sbindir \
	%buildroot%_bindir \
	%buildroot/var/lib/amavis \
	%buildroot/var/lib/amavis/.spamassassin \
	%buildroot/var/spool/amavis/virusmails \
	%buildroot/var/lib/amavis/tmp \
	%buildroot/var/lib/amavis/db

install -m 755 amavisd_init.sh %buildroot%_initrddir/amavisd
install -m 640 amavisd.conf %buildroot%_sysconfdir/amavisd/amavisd.conf
install -m 640 amavisd.conf-default %buildroot%_sysconfdir/amavisd/amavisd.conf-default
install -m 640 amavisd.conf-sample %buildroot%_sysconfdir/amavisd/amavisd.conf-sample
install -m 755 amavisd %buildroot%_sbindir/amavisd

cat > %buildroot/var/lib/amavis/.spamassassin/user_prefs <<EOF
# SpamAssassin User Preferences file
# (see perldoc Mail::SpamAssassin::Conf for details of what can be tweaked).
# Note that the entries for headers won't have effect, since those are
# directly handled/overridden by amavisd and amavisd.conf.

dns_available yes

# Bayes filters requires at least 200 entries of spam and 200 of ham 
# for start working
bayes_file_mode 0640
use_bayes 1
auto_learn 1

skip_rbl_checks 1
use_razor2 0
use_pyzor 0
use_dcc 0
#dcc_add_header 1

# Custom scores (local|net|bayes|bayes+net)
#score   BAYES_99        4.300 4.300 5.400 5.400
#score   BAYES_90        3.500 3.500 3.500 3.500
#score   BAYES_80        3.000 3.000 3.000 3.000
#score   DCC_CHECK       4.000 4.000 4.000 4.000
#score   RAZOR2_CHECK    2.500 2.500 2.500 2.500
#score   HABEAS_SWE      -0.01
EOF

cat > %buildroot/%_bindir/amavisd-checkbayesdb <<EOF
#!/bin/sh
su amavis -c "/usr/bin/sa-learn --dump" -s /bin/sh
EOF

cat > %buildroot/%_bindir/amavisd-checkcfg <<EOF
#!/bin/sh
su amavis -c "/usr/bin/spamassassin --lint -D" -s /bin/sh
EOF

cat > %buildroot/%_bindir/amavisd-mboxlearnham <<EOF
#!/bin/sh
su amavis -c "/usr/bin/sa-learn --showdots --ham --mbox \$1" -s /bin/sh
EOF

cat > %buildroot/%_bindir/amavisd-mboxlearnspam <<EOF
#!/bin/sh
su amavis -c "/usr/bin/sa-learn --showdots --spam --mbox \$1" -s /bin/sh
EOF

%clean
rm -rf %buildroot

%pre
%_pre_useradd amavis /var/lib/amavis /bin/false
%_pre_groupadd amavis amavis,clamav

%post
%_post_service amavisd
grep -q "virusalert" %_sysconfdir/aliases || \
	echo "virusalert: root" >> %_sysconfdir/aliases
[ -x %_bindir/newaliases ] && %_bindir/newaliases > /dev/null 2>&1

if [ -x /usr/sbin/postconf ] && [ -z `/usr/sbin/postconf -h content_filter` ]; then
	postconf -e content_filter=lmtp-filter:127.0.0.1:10025
	postconf -e receive_override_options=no_address_mappings
fi

%preun
%_preun_service amavisd

%files
%defattr(-,root,root)
%doc AAAREADME.first INSTALL LICENSE README_FILES RELEASE_NOTES test-messages
%doc LDAP.schema
%attr(755,root,root) %_initrddir/amavisd
%attr(640,root,amavis) %config(noreplace) %_sysconfdir/amavisd/amavisd.conf
%attr(640,root,amavis) %_sysconfdir/amavisd/amavisd.conf-default
%attr(640,root,amavis) %_sysconfdir/amavisd/amavisd.conf-sample
%attr(755,root,root) %_sbindir/amavisd
%attr(755,root,root) %_bindir/amavisd-*
%attr(755,root,root) %dir /var/spool/amavis
%attr(750,amavis,amavis) %dir /var/spool/amavis/virusmails
%attr(750,amavis,amavis) %dir /var/lib/amavis
%attr(750,amavis,amavis) %dir /var/lib/amavis/tmp
%attr(750,amavis,amavis) %dir /var/lib/amavis/db
%attr(750,amavis,amavis) %dir /var/lib/amavis/.spamassassin
%config(noreplace) %attr(640,amavis,amavis) /var/lib/amavis/.spamassassin/user_prefs

%changelog
* Tue Mar 15 2005 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.2.1-2mdk
- fix deps
- rpmlint fixes

* Thu Dec 23 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.2.1-1mdk
- Release: 2.2.1.
- Rebuilt Patch11.
- Rebuilt Patch12.
- Added pax, ripmime, freeze to Requires.

* Thu Sep 23 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.1.2-1mdk
- Release: 2.1.2.
- Rebuilt Patch10.
- Rebuilt Patch11.
- Rebuilt Patch12.
- Added mthredir, sdboot.gen, funlove, yaha, zafi, gibe, lovgate, nyxem,
  mabutu, plexus to list of viruses that fake sender maps.

* Thu Jul 29 2004 Lenny Cartier <lenny@mandrakesoft.com> 0.20040701-1mdk
- updated to 20040701 by Andre Nathan <andre@digirati.com.br>

* Mon Mar 22 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.20030616-18mdk
- Updated to release 20030616p8.
- Added bagle to fakesender virus list.
- Rebuilt Patch11, Patch13.

* Wed Jan 28 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.20030616-17mdk
- Added mydoom to fakesender virus list.
- mark user_prefs file with config(noreplace) (Luca Berra).

* Mon Jan 26 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.20030616-16mdk
- Added X-Spam-Score flag for squirrelmail+avelsieve.

* Sat Jan 24 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.20030616-15mdk
- Removed "use_razor1 0" from user_prefs (after --lint -D check).

* Fri Jan 23 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.20030616-14mdk
- Updated to release 20030616p7.
- Sync with current postfix to use port 10026.

* Sun Dec 28 2003 Luca Berra <bluca@vodka.it> 0.20030616-13mdk
- plf package has plf extension.
- remove arc from Requires list, for now (seems missed from plf).
- more /var/amavis -> /var/lib/amavis in config.
- enable clamav in daemon mode (add clamav to amavis group).
- require smtpdaemon, not postfix.
- change default ports according to postfix FILTER_README standards.
- auto-add to postfix if found (commented right now).

* Fri Dec 26 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.20030616-12mdk
- Fixed Patch11 to use /var/lib/amavis as default for $MYHOME.

* Fri Dec 26 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.20030616-11mdk
- Release 20030616-p6.
- Readapted patches 11, 12, 13.

* Sun Nov 09 2003 Luca Berra <bluca@vodka.it> 0.20030616-10mdk
- now depends on spamassassin 2.60+

* Sat Oct 11 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.20030616-9mdk
- Fixed script amavisd-mboxlearnspam.

* Wed Oct 08 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.20030616-8mdk
- Fixed scripts amavisd-mboxlearnspam|ham.

* Sat Sep 27 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.20030616-7mdk
- Fixed bug #5324 (for real now, grrr!)
- Fixed bug #5994.

* Fri Sep 12 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.20030616-6mdk
- Fixed bug #5324.

* Tue Sep 09 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.20030616-5mdk
- init script renamed to amavisd.

* Tue Sep 09 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.20030616-4mdk
- Added LDAP.schema do docs (Buchan).

* Fri Aug 29 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.20030616-3mdk
- Release 20030616-p5.
- Removed Patch1 (merged).
- DIRM: /var/spool/amavis.
- Readapted Patch13.
- Init script named amavisd-new.

* Sat Jul 19 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.20030616-2mdk
- Set $TEMPBASE to /var/lib/amavis/tmp.
- Set default $final_virus_destiny to D_DISCARD (as they are
  anyway saved in /var/spool/amavisd/virusmails).
- Set default $final_spam_destiny to D_PASS (is a waste of time to bounce
  them, and generally sysadmins don't wan't to D_DISCARD them until they
  have learned the bayes filter).
- Added some script for bayes learning as 'amavis' user.
- TODO: write some robust script to configure postfix master.cf files 
  for supporting amavisd and a %post script for configuring mydomain in
  amavisd.conf to hostname.

* Mon Jun 30 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.20030616-1mdk
- Initial release.