diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /mail-filter/qmail-scanner | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'mail-filter/qmail-scanner')
13 files changed, 805 insertions, 0 deletions
diff --git a/mail-filter/qmail-scanner/Manifest b/mail-filter/qmail-scanner/Manifest new file mode 100644 index 000000000000..6df5c3fbdd25 --- /dev/null +++ b/mail-filter/qmail-scanner/Manifest @@ -0,0 +1,8 @@ +DIST q-s-1.25st-20050406.patch.gz 124325 SHA256 a758b902150f432cc0fa0cc76448bf975e75395ab6b614ca1d8f3be64ab6535a +DIST q-s-2.05st-20080728.patch.gz 102235 SHA256 03f6b5c030fcd95a726b15b68ce722495b73cea406356fe00a51f0f52c0aa840 +DIST q-s-2.06st-20090419.patch.gz 103486 SHA256 449505268534d843d4d95377dac2ea220d6e3eca0a31800acc5212d4f6cb25eb +DIST q-s-2.08st-20091012.patch.gz 103757 SHA256 609992f877d8784f74a3006db963c850f1bac6b112c530d4f5e3a50fbbeb37af +DIST qmail-scanner-1.25.tgz 221156 SHA256 6fa5743a0d180bc4d1a626c4bf56c06a29ec3c0d7cb2ce834add8faceefb9c01 +DIST qmail-scanner-2.05.tgz 237577 SHA256 add5d19669838ea8d2fa414051b4d12d1eacba54a0d8a93b7af4c886cd9f6697 +DIST qmail-scanner-2.06.tgz 238926 SHA256 6330e97382efaf2d3ac40674cc1b09f394b7591cd4a7b6e2514eda334d144b09 +DIST qmail-scanner-2.08.tgz 239667 SHA256 d5db0ac6fccc8febaffb9f66bc2b926323f52247036d3754e7e38ed5977d6ca4 diff --git a/mail-filter/qmail-scanner/files/qmail-scanner-2.05.logrotate b/mail-filter/qmail-scanner/files/qmail-scanner-2.05.logrotate new file mode 100644 index 000000000000..a0f3cbd880e8 --- /dev/null +++ b/mail-filter/qmail-scanner/files/qmail-scanner-2.05.logrotate @@ -0,0 +1,4 @@ +/var/spool/qscan/qmail-queue.log /var/spool/qscan/quarantine.log /var/spool/qscan/mailstats.csv { + weekly + create 0600 qscand qscand +} diff --git a/mail-filter/qmail-scanner/files/qmail-scanner-2.06.logrotate b/mail-filter/qmail-scanner/files/qmail-scanner-2.06.logrotate new file mode 100644 index 000000000000..a0f3cbd880e8 --- /dev/null +++ b/mail-filter/qmail-scanner/files/qmail-scanner-2.06.logrotate @@ -0,0 +1,4 @@ +/var/spool/qscan/qmail-queue.log /var/spool/qscan/quarantine.log /var/spool/qscan/mailstats.csv { + weekly + create 0600 qscand qscand +} diff --git a/mail-filter/qmail-scanner/files/qmail-scanner-2.08-disable-suid-check.patch b/mail-filter/qmail-scanner/files/qmail-scanner-2.08-disable-suid-check.patch new file mode 100644 index 000000000000..c323dbae4c86 --- /dev/null +++ b/mail-filter/qmail-scanner/files/qmail-scanner-2.08-disable-suid-check.patch @@ -0,0 +1,17 @@ +this is a useless check for package builders + +https://bugs.gentoo.org/364123 + +--- a/configure ++++ b/configure +@@ -440,9 +440,7 @@ fi + #QMAILQUEUE_BIN="${QMAILQUEUE_BIN:-$BINDIR/qmail-queue}" + + #Sanity check that suid is allowed on the Qmail "/bin" partition +-QMNT=`df $BINDIR|head -2|tail -1|awk '{print $1}'` +-SUIDSTATUS=`mount|egrep "^$QMNT "|grep nosuid` +-if [ "$SUIDSTATUS" != "" ]; then ++if false; then + cat<<EOF + + *** FATAL ERROR *** diff --git a/mail-filter/qmail-scanner/files/qmail-scanner-2.08.logrotate b/mail-filter/qmail-scanner/files/qmail-scanner-2.08.logrotate new file mode 100644 index 000000000000..a0f3cbd880e8 --- /dev/null +++ b/mail-filter/qmail-scanner/files/qmail-scanner-2.08.logrotate @@ -0,0 +1,4 @@ +/var/spool/qscan/qmail-queue.log /var/spool/qscan/quarantine.log /var/spool/qscan/mailstats.csv { + weekly + create 0600 qscand qscand +} diff --git a/mail-filter/qmail-scanner/files/qmail-scanner-queue.pl.patch b/mail-filter/qmail-scanner/files/qmail-scanner-queue.pl.patch new file mode 100644 index 000000000000..c8461f50b145 --- /dev/null +++ b/mail-filter/qmail-scanner/files/qmail-scanner-queue.pl.patch @@ -0,0 +1,8 @@ +--- qmail-scanner-queue.pl.orig 2004-01-28 14:59:13.683490735 +0100 ++++ qmail-scanner-queue.pl 2004-01-28 14:59:58.125634019 +0100 +@@ -1,4 +1,4 @@ +-#!/usr/bin/suidperl -T ++#!/usr/bin/perl + # + # File: qmail-scanner-queue.pl + # Version: 1.20 diff --git a/mail-filter/qmail-scanner/files/qmailscanner.cronjob b/mail-filter/qmail-scanner/files/qmailscanner.cronjob new file mode 100644 index 000000000000..ca4527432e38 --- /dev/null +++ b/mail-filter/qmail-scanner/files/qmailscanner.cronjob @@ -0,0 +1,2 @@ +#!/bin/bash +/var/qmail/bin/qmail-scanner-queue -z diff --git a/mail-filter/qmail-scanner/files/qmailscanner.logrotate b/mail-filter/qmail-scanner/files/qmailscanner.logrotate new file mode 100644 index 000000000000..864cfe7f6fe3 --- /dev/null +++ b/mail-filter/qmail-scanner/files/qmailscanner.logrotate @@ -0,0 +1,4 @@ +/var/spool/qmailscan/qmail-queue.log /var/spool/qmailscan/quarantine.log /var/spool/qmailscan/mailstats.csv { + weekly + create 0600 qscand qscand +} diff --git a/mail-filter/qmail-scanner/metadata.xml b/mail-filter/qmail-scanner/metadata.xml new file mode 100644 index 000000000000..6e2faa5d7457 --- /dev/null +++ b/mail-filter/qmail-scanner/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>qmail</herd> + <use> + <flag name="spamassassin">Build faster <pkg>mail-filter/spamassassin</pkg> + checks into qmail-scanner</flag> + </use> + <upstream> + <remote-id type="sourceforge">qmail-scanner</remote-id> + </upstream> +</pkgmetadata> diff --git a/mail-filter/qmail-scanner/qmail-scanner-1.25-r1.ebuild b/mail-filter/qmail-scanner/qmail-scanner-1.25-r1.ebuild new file mode 100644 index 000000000000..c25e00149dc3 --- /dev/null +++ b/mail-filter/qmail-scanner/qmail-scanner-1.25-r1.ebuild @@ -0,0 +1,164 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +inherit fixheadtails toolchain-funcs eutils user + +Q_S_DATE=20050406 +DESCRIPTION="E-Mail virus scanner for qmail" +HOMEPAGE="http://qmail-scanner.sourceforge.net/" +SRC_URI="mirror://sourceforge/qmail-scanner/${P}.tgz + http://toribio.apollinare.org/qmail-scanner/download/q-s-${PV}st-${Q_S_DATE}.patch.gz" + +IUSE="spamassassin" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ppc x86" +RESTRICT="userpriv" + +RDEPEND=">=dev-lang/perl-5.6.1-r1 + >=virtual/perl-Time-HiRes-01.20-r2 + >=net-mail/tnef-1.1.1 + >=virtual/perl-DB_File-1.803-r2 + >=net-mail/ripmime-1.3.0.4 + virtual/qmail + >=app-arch/unzip-5.42-r1 + app-antivirus/clamav + spamassassin? ( >=mail-filter/spamassassin-2.64 )" +DEPEND="${RDEPEND}" + +pkg_setup() { + enewgroup qscand 210 + enewuser qscand 210 -1 /var/spool/qmailscan qscand +} + +pkg_preinst() { + local oldname="/var/qmail/bin/qmail-scanner-queue.pl" + if [ -f ${oldname} ]; then + newname=${oldname}.`date +%Y%m%d%H%M%S` + elog "Backing up old qmail-scanner as $newname in case of modifications." + cp ${oldname} ${newname} + chmod 600 ${newname} + fi +} + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${DISTDIR}"/q-s-${PV}st-${Q_S_DATE}.patch.gz + ht_fix_file autoupdaters/* configure + + EXTRA_VIRII="bagle,beagle,mydoom,sco,maldal,mimail,novarg,shimg,bugler,cissi,cissy,dloade,netsky,qizy" + elog "Adding items to the SILENT_VIRUSES list (${EXTRA_VIRII})" + sed -e "/^SILENT_VIRUSES/s/\"$/,${EXTRA_VIRII}\"/g" -i configure +} + +src_compile () { + local myconf + + addpredict /var/log/kav/kavscan.log + addpredict /opt/bdc/plugins.htm + + use spamassassin && myconf="--virus-to-delete yes --sa-quarantine 2.1 --sa-delete 4.2 --sa-reject no --sa-subject SPAM: --sa-delta 0.5 --sa-alt yes" + + PATH=${PATH}:/opt/f-prot:/opt/vlnx ./configure \ + --domain localhost \ + --batch \ + --log-details yes \ + --mime-unpacker "ripmime" \ + --skip-setuid-test \ + ${myconf} \ + || die "./configure failed!" + + # build for qmail-scanner-queue wrapper, so we don't need suidperl + cd contrib + $(tc-getCC) ${CFLAGS} -o qmail-scanner-queue qmail-scanner-queue.c || die +} + +src_install () { + # Create Directory Structure + diropts -m 755 -o qscand -g qscand + dodir /var/spool/qmailscan + keepdir /var/spool/qmailscan + diropts -m 750 -o qscand -g qscand + for i in quarantine working archive; do + for j in tmp new cur; do + dodir /var/spool/qmailscan/${i}/${j} + keepdir /var/spool/qmailscan/${i}/${j} + done + done + dodir /var/spool/qmailscan/tmp + keepdir /var/spool/qmailscan/tmp + + # Install standard quarantine attachments file + insinto /var/spool/qmailscan + insopts -m 644 -o qscand -g qscand + doins quarantine-attachments.txt + + # create quarantine.log and viruses.log + touch quarantine.log + insinto /var/spool/qmailscan + insopts -m 644 -o qscand -g qscand + doins quarantine.log + dosym quarantine.log ${DESTDIR}/var/spool/qmailscan/viruses.log + + # Install qmail-scanner wrapper + insinto /var/qmail/bin + insopts -m 4755 -o qscand -g qscand + doins contrib/qmail-scanner-queue + + # Install qmail-scanner script + insinto /var/qmail/bin + insopts -m 0755 -o qscand -g qscand + doins qmail-scanner-queue.pl + + insinto /etc/logrotate.d/ + insopts -m 644 -o root -g root + newins "${FILESDIR}"/qmailscanner.logrotate qmail-scanner + + exeinto /etc/cron.daily/ + newexe "${FILESDIR}"/qmailscanner.cronjob qmail-scanner + + # Install documentation + dodoc README CHANGES + dohtml README.html FAQ.php TODO.php configure-options.php manual-install.php perlscanner.php + + docinto contrib + cd "${S}"/contrib + dodoc spamc-nice.eml + dodoc test-trophie.pl + dodoc logrotate.qmailscanner + dodoc sub-avpdaemon.pl + dodoc logging_first_80_chars.eml + dodoc spamc-nasty.eml + dodoc avpdeamon.init + dodoc test_installation.sh + dodoc test-sophie.pl + dodoc reformime-test.eml + dodoc sub-sender-cache.pl + dodoc rbl_scanner.txt + dodoc test-clamd.pl + dodoc qs2mrtg.pl + dodoc mrtg-qmail-scanner.cfg +} + +pkg_postinst () { + einfo "Fixing ownerships" + chown -R qscand:qscand /var/spool/qmailscan/tmp /var/spool/qmailscan/working /var/spool/qmailscan/quarantine* /var/spool/qmailscan/archive /var/spool/qmailscan/qmail* + touch /var/qmail/bin/qmail-scanner-queue.pl + + # Setup perlscanner + Version Info + chmod -s "${ROOT}"/var/qmail/bin/qmail-scanner-queue.pl + "${ROOT}"/var/qmail/bin/qmail-scanner-queue -z + "${ROOT}"/var/qmail/bin/qmail-scanner-queue -g + + elog "To activate qmail-scanner, please edit your" + elog "/var/qmail/control/conf-common file and set:" + elog "export QMAILQUEUE=/var/qmail/bin/qmail-scanner-queue" + elog "Or place it in your tcprules file." + ewarn "Please note that it was a call to qmail-scanner-queue.pl before," + ewarn "but this is now changed to use a wrapper to improve security!" + ewarn "Once you have changed to the wrapper, you can remove the setuid " + ewarn "bit on qmail-scanner-queue.pl" +} diff --git a/mail-filter/qmail-scanner/qmail-scanner-2.05.ebuild b/mail-filter/qmail-scanner/qmail-scanner-2.05.ebuild new file mode 100644 index 000000000000..26b8c49f1772 --- /dev/null +++ b/mail-filter/qmail-scanner/qmail-scanner-2.05.ebuild @@ -0,0 +1,191 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +inherit fixheadtails toolchain-funcs eutils user + +Q_S_DATE=20080728 +DESCRIPTION="E-Mail virus scanner for qmail" +HOMEPAGE="http://qmail-scanner.sourceforge.net/" +SRC_URI="mirror://sourceforge/qmail-scanner/${P}.tgz + http://toribio.apollinare.org/qmail-scanner/download/q-s-${PV}st-${Q_S_DATE}.patch.gz" + +IUSE="clamav spamassassin" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ppc x86" +RESTRICT="userpriv" + +RDEPEND="dev-lang/perl + virtual/perl-Time-HiRes + net-mail/tnef + virtual/perl-DB_File + mail-filter/maildrop + virtual/qmail + app-arch/unzip + virtual/daemontools + clamav? ( app-antivirus/clamav ) + spamassassin? ( mail-filter/spamassassin )" +DEPEND="${RDEPEND}" + +pkg_setup() { + enewgroup qscand 210 + enewuser qscand 210 -1 /var/spool/qscan qscand + use clamav && usermod -a -G qscand,nofiles clamav +} + +pkg_preinst() { + local oldname="/var/qmail/bin/qmail-scanner-queue.pl" + if [ -f ${oldname} ]; then + newname=${oldname}.`date +%Y%m%d%H%M%S` + elog "Backing up old qmail-scanner as $newname in case of modifications." + cp ${oldname} ${newname} + chmod 600 ${newname} + fi +} + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${DISTDIR}"/q-s-${PV}st-${Q_S_DATE}.patch.gz + epatch "${FILESDIR}"/${PN}-2.08-disable-suid-check.patch #364123 + ht_fix_file autoupdaters/* configure + sed -i \ + -e "s:/var/spool/qscand:/var/spool/qscan:g" \ + README-st-patch.html \ + README-st-patch.txt || die "Fixing doc with sed failed" + + EXTRA_VIRII="bagle,beagle,mydoom,sco,maldal,mimail,novarg,shimg,bugler,cissi,cissy,dloade,netsky,qizy" + elog "Adding items to the SILENT_VIRUSES list (${EXTRA_VIRII})" + sed -e "/^SILENT_VIRUSES/s/\"$/,${EXTRA_VIRII}\"/g" -i configure +} + +src_compile () { + local myconf + + addpredict /var/log/kav/kavscan.log + addpredict /opt/bdc/plugins.htm + + use spamassassin && myconf="--virus-to-delete yes --sa-quarantine 2.1 --sa-delete 4.2 --sa-reject no --sa-subject SPAM: --sa-delta 0.5 --sa-alt yes" + + PATH=${PATH}:/opt/f-prot:/opt/vlnx ./configure \ + --domain localhost \ + --batch \ + --log-details yes \ + --skip-setuid-test \ + ${myconf} \ + || die "./configure failed!" + + # build for qmail-scanner-queue wrapper, so we don't need suidperl + cd contrib + $(tc-getCC) ${CFLAGS} -o qmail-scanner-queue qmail-scanner-queue.c || die +} + +src_install () { + # Create Directory Structure + diropts -m 755 -o qscand -g qscand + dodir /var/spool/qscan + keepdir /var/spool/qscan + diropts -m 750 -o qscand -g qscand + dodir /var/spool/qscan/quarantine + for i in quarantine/{viruses,policy,spam} working archives; do + for j in tmp new cur; do + dodir /var/spool/qscan/${i}/${j} + keepdir /var/spool/qscan/${i}/${j} + done + done + dodir /var/spool/qscan/tmp + keepdir /var/spool/qscan/tmp + + # Install standard quarantine events file + insinto /var/spool/qscan + insopts -m 644 -o qscand -g qscand + doins quarantine-events.txt + + # create quarantine.log and viruses.log + touch quarantine.log + insinto /var/spool/qscan + insopts -m 644 -o qscand -g qscand + doins quarantine.log + dosym quarantine.log ${DESTDIR}/var/spool/qscan/viruses.log + + # Install qmail-scanner wrapper + insinto /var/qmail/bin + insopts -m 4755 -o qscand -g qscand + doins contrib/qmail-scanner-queue + + # Install qmail-scanner script + insinto /var/qmail/bin + insopts -m 0755 -o qscand -g qscand + doins qmail-scanner-queue.pl + + insinto /etc/logrotate.d/ + insopts -m 644 -o root -g root + newins "${FILESDIR}"/${P}.logrotate qmail-scanner + + exeinto /etc/cron.daily/ + newexe "${FILESDIR}"/qmailscanner.cronjob qmail-scanner + + # Install documentation + dodoc README CHANGES + dohtml README.html FAQ.php TODO.php configure-options.php manual-install.php perlscanner.php + + docinto contrib + cd "${S}"/contrib + dodoc spamc-nice.eml \ + test-trophie.pl \ + logrotate.qmail-scanner \ + sub-avpdaemon.pl \ + logging_first_80_chars.eml \ + spamc-nasty.eml \ + avpdeamon.init \ + test_installation.sh \ + test-sophie.pl \ + reformime-test.eml \ + sub-sender-cache.pl \ + rbl_scanner.txt \ + test-clamd.pl \ + qs2mrtg.pl \ + mrtg-qmail-scanner.cfg \ + check_AV_daemons \ + patch_for_nod32_single_user.eml \ + qmail-delay \ + qs-scanner-report.sh \ + qs_config.sh \ + qscan-spam-to-users.pl \ + test-avgd.pl \ + test_password.zip \ + vpopmail-issues.eml +} + +pkg_postinst () { + einfo "Fixing ownerships" + chown -R qscand:qscand /var/spool/qscan + touch /var/qmail/bin/qmail-scanner-queue.pl + + # Setup perlscanner + Version Info + chmod -s "${ROOT}"/var/qmail/bin/qmail-scanner-queue.pl + "${ROOT}"/var/qmail/bin/qmail-scanner-queue -z + "${ROOT}"/var/qmail/bin/qmail-scanner-queue -g + + elog "To activate qmail-scanner, please edit your" + elog "/var/qmail/control/conf-common file and set:" + elog "export QMAILQUEUE=/var/qmail/bin/qmail-scanner-queue" + elog "Or place it in your tcprules file." + ewarn "Please note that it was a call to qmail-scanner-queue.pl before," + ewarn "but this is now changed to use a wrapper to improve security!" + ewarn "Once you have changed to the wrapper, you can remove the setuid " + ewarn "bit on qmail-scanner-queue.pl" + + ewarn "If this is an upgrade from <=2.0.1 the home directory of the qscand" + ewarn "user is changed. Please update it manually to /var/spool/qscan" + ewarn "or remove the user and emerge again this package" + + if use clamav; then + ewarn "To allow clamav integration comment-out in /etc/clamd.conf:" + ewarn "AllowSupplementaryGroups putting yes." + ewarn "After that, restart clamd with" + ewarn "/etc/init.d/clamd restart" + fi +} diff --git a/mail-filter/qmail-scanner/qmail-scanner-2.06.ebuild b/mail-filter/qmail-scanner/qmail-scanner-2.06.ebuild new file mode 100644 index 000000000000..1610ba9160ab --- /dev/null +++ b/mail-filter/qmail-scanner/qmail-scanner-2.06.ebuild @@ -0,0 +1,193 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ +EAPI=2 + +inherit fixheadtails toolchain-funcs eutils user + +Q_S_DATE=20090419 +DESCRIPTION="E-Mail virus scanner for qmail" +HOMEPAGE="http://qmail-scanner.sourceforge.net/" +SRC_URI="mirror://sourceforge/qmail-scanner/${P}.tgz + http://toribio.apollinare.org/qmail-scanner/download/q-s-${PV}st-${Q_S_DATE}.patch.gz" + +IUSE="clamav spamassassin" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +RESTRICT="userpriv" + +RDEPEND="dev-lang/perl + virtual/perl-Time-HiRes + net-mail/tnef + virtual/perl-DB_File + mail-filter/maildrop + virtual/qmail + app-arch/unzip + virtual/daemontools + clamav? ( app-antivirus/clamav ) + spamassassin? ( mail-filter/spamassassin )" +DEPEND="${RDEPEND}" + +pkg_setup() { + enewgroup qscand 210 + enewuser qscand 210 -1 /var/spool/qscan qscand + use clamav && usermod -a -G qscand,nofiles clamav +} + +pkg_preinst() { + local oldname="/var/qmail/bin/qmail-scanner-queue.pl" + if [ -f ${oldname} ]; then + newname=${oldname}.`date +%Y%m%d%H%M%S` + elog "Backing up old qmail-scanner as $newname in case of modifications." + cp ${oldname} ${newname} + chmod 600 ${newname} + fi +} + +src_prepare() { + epatch "${DISTDIR}"/q-s-${PV}st-${Q_S_DATE}.patch.gz + epatch "${FILESDIR}"/${PN}-2.08-disable-suid-check.patch #364123 + ht_fix_file autoupdaters/* configure + sed -i \ + -e "s:/var/spool/qscand:/var/spool/qscan:g" \ + README-st-patch.html \ + README-st-patch.txt || die "Fixing doc with sed failed" + + EXTRA_VIRII="bagle,beagle,mydoom,sco,maldal,mimail,novarg,shimg,bugler,cissi,cissy,dloade,netsky,qizy" + elog "Adding items to the SILENT_VIRUSES list (${EXTRA_VIRII})" + sed -i \ + -e "/^SILENT_VIRUSES/s/\"$/,${EXTRA_VIRII}\"/g" \ + -e '/DD/s/1\\.0/ 1\\.0/' \ + configure +} + +src_configure() { + local myconf + + addpredict /var/log/kav/kavscan.log + addpredict /opt/bdc/plugins.htm + + use spamassassin && myconf="--virus-to-delete yes --sa-quarantine 2.1 --sa-delete 4.2 --sa-reject no --sa-subject SPAM: --sa-delta 0.5 --sa-alt yes" + + PATH=${PATH}:/opt/f-prot:/opt/vlnx ./configure \ + --domain localhost \ + --batch \ + --log-details yes \ + --skip-setuid-test \ + ${myconf} \ + || die "./configure failed!" + + # build for qmail-scanner-queue wrapper, so we don't need suidperl + cd contrib + $(tc-getCC) ${CFLAGS} -o qmail-scanner-queue qmail-scanner-queue.c || die +} + +src_install () { + # Create Directory Structure + diropts -m 755 -o qscand -g qscand + dodir /var/spool/qscan + keepdir /var/spool/qscan + diropts -m 750 -o qscand -g qscand + dodir /var/spool/qscan/quarantine + for i in quarantine/{viruses,policy,spam} working archives; do + for j in tmp new cur; do + dodir /var/spool/qscan/${i}/${j} + keepdir /var/spool/qscan/${i}/${j} + done + done + dodir /var/spool/qscan/tmp + keepdir /var/spool/qscan/tmp + + # Install standard quarantine events file + insinto /var/spool/qscan + insopts -m 644 -o qscand -g qscand + doins quarantine-events.txt + + # create quarantine.log and viruses.log + touch quarantine.log + insinto /var/spool/qscan + insopts -m 644 -o qscand -g qscand + doins quarantine.log + dosym quarantine.log ${DESTDIR}/var/spool/qscan/viruses.log + + # Install qmail-scanner wrapper + insinto /var/qmail/bin + insopts -m 4755 -o qscand -g qscand + doins contrib/qmail-scanner-queue + + # Install qmail-scanner script + insinto /var/qmail/bin + insopts -m 0755 -o qscand -g qscand + doins qmail-scanner-queue.pl + + insinto /etc/logrotate.d/ + insopts -m 644 -o root -g root + newins "${FILESDIR}"/${P}.logrotate qmail-scanner + + exeinto /etc/cron.daily/ + newexe "${FILESDIR}"/qmailscanner.cronjob qmail-scanner + + # Install documentation + dodoc README CHANGES + dohtml README.html FAQ.php TODO.php configure-options.php manual-install.php perlscanner.php + + docinto contrib + cd "${S}"/contrib + dodoc spamc-nice.eml \ + test-trophie.pl \ + logrotate.qmail-scanner \ + sub-avpdaemon.pl \ + logging_first_80_chars.eml \ + spamc-nasty.eml \ + avpdeamon.init \ + test_installation.sh \ + test-sophie.pl \ + reformime-test.eml \ + sub-sender-cache.pl \ + rbl_scanner.txt \ + test-clamd.pl \ + qs2mrtg.pl \ + mrtg-qmail-scanner.cfg \ + check_AV_daemons \ + patch_for_nod32_single_user.eml \ + qmail-delay \ + qs-scanner-report.sh \ + qs_config.sh \ + qscan-spam-to-users.pl \ + test-avgd.pl \ + test_password.zip \ + vpopmail-issues.eml +} + +pkg_postinst () { + einfo "Fixing ownerships" + chown -R qscand:qscand /var/spool/qscan + touch /var/qmail/bin/qmail-scanner-queue.pl + + # Setup perlscanner + Version Info + chmod -s "${ROOT}"/var/qmail/bin/qmail-scanner-queue.pl + "${ROOT}"/var/qmail/bin/qmail-scanner-queue -z + "${ROOT}"/var/qmail/bin/qmail-scanner-queue -g + + elog "To activate qmail-scanner, please edit your" + elog "/var/qmail/control/conf-common file and set:" + elog "export QMAILQUEUE=/var/qmail/bin/qmail-scanner-queue" + elog "Or place it in your tcprules file." + ewarn "Please note that it was a call to qmail-scanner-queue.pl before," + ewarn "but this is now changed to use a wrapper to improve security!" + ewarn "Once you have changed to the wrapper, you can remove the setuid " + ewarn "bit on qmail-scanner-queue.pl" + + ewarn "If this is an upgrade from <=2.0.1 the home directory of the qscand" + ewarn "user is changed. Please update it manually to /var/spool/qscan" + ewarn "or remove the user and emerge again this package" + + if use clamav; then + ewarn "To allow clamav integration comment-out in /etc/clamd.conf:" + ewarn "AllowSupplementaryGroups putting yes." + ewarn "After that, restart clamd with" + ewarn "/etc/init.d/clamd restart" + fi +} diff --git a/mail-filter/qmail-scanner/qmail-scanner-2.08.ebuild b/mail-filter/qmail-scanner/qmail-scanner-2.08.ebuild new file mode 100644 index 000000000000..3ad5457e4fbb --- /dev/null +++ b/mail-filter/qmail-scanner/qmail-scanner-2.08.ebuild @@ -0,0 +1,194 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ +EAPI=2 + +inherit fixheadtails toolchain-funcs eutils user + +Q_S_DATE=20091012 +DESCRIPTION="E-Mail virus scanner for qmail" +HOMEPAGE="http://qmail-scanner.sourceforge.net/ + http://toribio.apollinare.org/qmail-scanner/" +SRC_URI="mirror://sourceforge/${PN}/${PV}/${P}.tgz + http://toribio.apollinare.org/qmail-scanner/download/q-s-${PV}st-${Q_S_DATE}.patch.gz" + +IUSE="clamav spamassassin" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +RESTRICT="userpriv" + +RDEPEND="dev-lang/perl + virtual/perl-Time-HiRes + net-mail/tnef + virtual/perl-DB_File + mail-filter/maildrop + virtual/qmail + app-arch/unzip + virtual/daemontools + clamav? ( app-antivirus/clamav ) + spamassassin? ( mail-filter/spamassassin )" +DEPEND="${RDEPEND}" + +pkg_setup() { + enewgroup qscand 210 + enewuser qscand 210 -1 /var/spool/qscan qscand + use clamav && usermod -a -G qscand,nofiles clamav +} + +pkg_preinst() { + local oldname="/var/qmail/bin/qmail-scanner-queue.pl" + if [ -f ${oldname} ]; then + newname=${oldname}.`date +%Y%m%d%H%M%S` + elog "Backing up old qmail-scanner as $newname in case of modifications." + cp ${oldname} ${newname} + chmod 600 ${newname} + fi +} + +src_prepare() { + epatch "${DISTDIR}"/q-s-${PV}st-${Q_S_DATE}.patch.gz + epatch "${FILESDIR}"/${PN}-2.08-disable-suid-check.patch #364123 + ht_fix_file autoupdaters/* configure + sed -i \ + -e "s:/var/spool/qscand:/var/spool/qscan:g" \ + README-st-patch.html \ + README-st-patch.txt || die "Fixing doc with sed failed" + + EXTRA_VIRII="bagle,beagle,mydoom,sco,maldal,mimail,novarg,shimg,bugler,cissi,cissy,dloade,netsky,qizy" + elog "Adding items to the SILENT_VIRUSES list (${EXTRA_VIRII})" + sed -i \ + -e "/^SILENT_VIRUSES/s/\"$/,${EXTRA_VIRII}\"/g" \ + -e '/DD/s/1\\.0/ 1\\.0/' \ + configure +} + +src_configure() { + local myconf + + addpredict /var/log/kav/kavscan.log + addpredict /opt/bdc/plugins.htm + + use spamassassin && myconf="--virus-to-delete yes --sa-quarantine 2.1 --sa-delete 4.2 --sa-reject no --sa-subject SPAM: --sa-delta 0.5 --sa-alt yes" + + PATH=${PATH}:/opt/f-prot:/opt/vlnx ./configure \ + --domain localhost \ + --batch \ + --log-details yes \ + --skip-setuid-test \ + ${myconf} \ + || die "./configure failed!" + + # build for qmail-scanner-queue wrapper, so we don't need suidperl + cd contrib + $(tc-getCC) ${CFLAGS} -o qmail-scanner-queue qmail-scanner-queue.c || die +} + +src_install () { + # Create Directory Structure + diropts -m 755 -o qscand -g qscand + dodir /var/spool/qscan + keepdir /var/spool/qscan + diropts -m 750 -o qscand -g qscand + dodir /var/spool/qscan/quarantine + for i in quarantine/{viruses,policy,spam} working archives; do + for j in tmp new cur; do + dodir /var/spool/qscan/${i}/${j} + keepdir /var/spool/qscan/${i}/${j} + done + done + dodir /var/spool/qscan/tmp + keepdir /var/spool/qscan/tmp + + # Install standard quarantine events file + insinto /var/spool/qscan + insopts -m 644 -o qscand -g qscand + doins quarantine-events.txt + + # create quarantine.log and viruses.log + touch quarantine.log + insinto /var/spool/qscan + insopts -m 644 -o qscand -g qscand + doins quarantine.log + dosym quarantine.log ${DESTDIR}/var/spool/qscan/viruses.log + + # Install qmail-scanner wrapper + insinto /var/qmail/bin + insopts -m 4755 -o qscand -g qscand + doins contrib/qmail-scanner-queue + + # Install qmail-scanner script + insinto /var/qmail/bin + insopts -m 0755 -o qscand -g qscand + doins qmail-scanner-queue.pl + + insinto /etc/logrotate.d/ + insopts -m 644 -o root -g root + newins "${FILESDIR}"/${P}.logrotate qmail-scanner + + exeinto /etc/cron.daily/ + newexe "${FILESDIR}"/qmailscanner.cronjob qmail-scanner + + # Install documentation + dodoc README CHANGES + dohtml README.html FAQ.php TODO.php configure-options.php manual-install.php perlscanner.php + + docinto contrib + cd "${S}"/contrib + dodoc spamc-nice.eml \ + test-trophie.pl \ + logrotate.qmail-scanner \ + sub-avpdaemon.pl \ + logging_first_80_chars.eml \ + spamc-nasty.eml \ + avpdeamon.init \ + test_installation.sh \ + test-sophie.pl \ + reformime-test.eml \ + sub-sender-cache.pl \ + rbl_scanner.txt \ + test-clamd.pl \ + qs2mrtg.pl \ + mrtg-qmail-scanner.cfg \ + check_AV_daemons \ + patch_for_nod32_single_user.eml \ + qmail-delay \ + qs-scanner-report.sh \ + qs_config.sh \ + qscan-spam-to-users.pl \ + test-avgd.pl \ + test_password.zip \ + vpopmail-issues.eml +} + +pkg_postinst () { + einfo "Fixing ownerships" + chown -R qscand:qscand /var/spool/qscan + touch /var/qmail/bin/qmail-scanner-queue.pl + + # Setup perlscanner + Version Info + chmod -s "${ROOT}"/var/qmail/bin/qmail-scanner-queue.pl + "${ROOT}"/var/qmail/bin/qmail-scanner-queue -z + "${ROOT}"/var/qmail/bin/qmail-scanner-queue -g + + elog "To activate qmail-scanner, please edit your" + elog "/var/qmail/control/conf-common file and set:" + elog "export QMAILQUEUE=/var/qmail/bin/qmail-scanner-queue" + elog "Or place it in your tcprules file." + ewarn "Please note that it was a call to qmail-scanner-queue.pl before," + ewarn "but this is now changed to use a wrapper to improve security!" + ewarn "Once you have changed to the wrapper, you can remove the setuid " + ewarn "bit on qmail-scanner-queue.pl" + + ewarn "If this is an upgrade from <=2.0.1 the home directory of the qscand" + ewarn "user is changed. Please update it manually to /var/spool/qscan" + ewarn "or remove the user and emerge again this package" + + if use clamav; then + ewarn "To allow clamav integration comment-out in /etc/clamd.conf:" + ewarn "AllowSupplementaryGroups putting yes." + ewarn "After that, restart clamd with" + ewarn "/etc/init.d/clamd restart" + fi +} |