summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2012-10-11 07:00:02 +0000
committerPatrick Lauer <patrick@gentoo.org>2012-10-11 07:00:02 +0000
commit2bd7dacc8569e8b524def80cc709d909dd752801 (patch)
treee4a9fd12161ed9312389a064d6ed081a78be293d /mail-filter
parentFix logrotate script not to fail when exim isn't running, by Anatoly, bug #43... (diff)
downloadhistorical-2bd7dacc8569e8b524def80cc709d909dd752801.tar.gz
historical-2bd7dacc8569e8b524def80cc709d909dd752801.tar.bz2
historical-2bd7dacc8569e8b524def80cc709d909dd752801.zip
Re-import of MailScanner, see erroneous removal #251575
Package-Manager: portage-2.2.0_alpha137/cvs/Linux x86_64
Diffstat (limited to 'mail-filter')
-rw-r--r--mail-filter/MailScanner/ChangeLog9
-rw-r--r--mail-filter/MailScanner/MailScanner-4.84.5.2.ebuild322
-rw-r--r--mail-filter/MailScanner/Manifest5
3 files changed, 336 insertions, 0 deletions
diff --git a/mail-filter/MailScanner/ChangeLog b/mail-filter/MailScanner/ChangeLog
new file mode 100644
index 000000000000..42304898d07a
--- /dev/null
+++ b/mail-filter/MailScanner/ChangeLog
@@ -0,0 +1,9 @@
+# ChangeLog for mail-filter/MailScanner
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/MailScanner/ChangeLog,v 1.15 2012/10/11 07:00:02 patrick Exp $
+
+*MailScanner-4.84.5.2 (11 Oct 2012)
+
+ 11 Oct 2012; Patrick Lauer <patrick@gentoo.org> +MailScanner-4.84.5.2.ebuild,
+ +files/confd.mailscanner, +files/initd.mailscanner, +metadata.xml:
+ Re-import of MailScanner, see erroneous removal #251575
diff --git a/mail-filter/MailScanner/MailScanner-4.84.5.2.ebuild b/mail-filter/MailScanner/MailScanner-4.84.5.2.ebuild
new file mode 100644
index 000000000000..89e0b4533130
--- /dev/null
+++ b/mail-filter/MailScanner/MailScanner-4.84.5.2.ebuild
@@ -0,0 +1,322 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/MailScanner/MailScanner-4.84.5.2.ebuild,v 1.1 2012/10/11 07:00:02 patrick Exp $
+
+inherit eutils versionator multilib
+
+MY_PV=$(get_version_component_range 1-3 )
+MY_PVR=$(replace_version_separator 3 '-' )
+
+DESCRIPTION="Free Anti-Virus and Anti-Spam Filter"
+HOMEPAGE="http://www.mailscanner.info/"
+SRC_URI="http://www.mailscanner.info/files/4/tar/${PN}-install-${MY_PVR}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="clamav doc exim postfix spamassassin"
+
+DEPEND="dev-lang/perl"
+RDEPEND="${DEPEND}
+ dev-perl/Archive-Zip
+ virtual/perl-IO-Compress
+ dev-perl/Convert-BinHex
+ dev-perl/Convert-TNEF
+ dev-perl/DBD-SQLite
+ dev-perl/DBI
+ dev-perl/Filesys-Df
+ dev-perl/HTML-Parser
+ dev-perl/HTML-Tagset
+ dev-perl/IO-stringy
+ dev-perl/MIME-tools
+ dev-perl/MailTools
+ dev-perl/Net-CIDR
+ dev-perl/Net-DNS
+ dev-perl/OLE-StorageLite
+ dev-perl/Sys-Hostname-Long
+ dev-perl/TimeDate
+ net-mail/tnef
+ dev-perl/Sys-SigAction
+ virtual/perl-File-Spec
+ virtual/perl-File-Temp
+ virtual/perl-Getopt-Long
+ virtual/perl-Sys-Syslog
+ virtual/perl-MIME-Base64
+ postfix? ( mail-mta/postfix )
+ exim? ( !postfix? ( mail-mta/exim ) )
+ !postfix? ( !exim? ( mail-mta/sendmail ) )
+ clamav? ( app-antivirus/clamav )
+ spamassassin? ( mail-filter/spamassassin )"
+
+S="${WORKDIR}/${PN}-${MY_PVR}"
+BASE="/usr"
+
+src_unpack() {
+ unpack ${A}
+ unpack ./${PN}-install-${MY_PV}/perl-tar/${PN}-${MY_PVR}.tar.gz
+
+ # setup MTA
+ if use postfix ; then
+ RUNASUSER='postfix'
+ RUNASGROUP='postfix'
+ INQUEUE='/var/spool/postfix.in/deferred'
+ OUTQUEUE='/var/spool/postfix/incoming'
+ MTA='postfix'
+ SENDMAIL='/usr/lib/sendmail'
+ SENDMAIL2='/usr/lib/sendmail'
+ elif use exim ; then
+ RUNASUSER='mail'
+ RUNASGROUP='mail'
+ INQUEUE='/var/spool/exim.in/input'
+ OUTQUEUE='/var/spool/exim/input'
+ MTA='exim'
+ SENDMAIL='/usr/sbin/exim -oMr MailScanner'
+ SENDMAIL2='/usr/sbin/exim -C /etc/exim/exim_out.conf -oMr MailScanner'
+ else
+ # use sendmail as default, but we should add more as needed
+ # RUNASUSER='mail'
+ # RUNASGROUP='mail'
+ INQUEUE='/var/spool/mqueue.in'
+ OUTQUEUE='/var/spool/mqueue'
+ MTA='sendmail'
+ SENDMAIL='/usr/lib/sendmail'
+ SENDMAIL2='/usr/lib/sendmail'
+ fi
+
+ # setup virus scanner(s)
+ VIRUS_SCANNERS=""
+ use clamav && VIRUS_SCANNERS="clamav ${VIRUS_SCANNERS}"
+
+ if [ "$VIRUS_SCANNERS" == "" ]; then
+ VIRUS_SCANNERS="none"
+ VIRUS_SCANNING="no"
+ else
+ VIRUS_SCANNING="yes"
+ fi
+
+ sed -i \
+ -e "s/^\(Virus Scanning[ \t]*=\).*/\1 ${VIRUS_SCANNING}/" \
+ -e "s/^\(Virus Scanners[ \t]*=\).*/\1 ${VIRUS_SCANNERS}/" \
+ "${S}/etc/MailScanner.conf"
+
+ # setup spamassassin
+ if use spamassassin ; then
+ sed -i \
+ -e "s/^\(Use SpamAssassin[ \t]*=\).*$/\1 yes/" \
+ "${S}/etc/MailScanner.conf"
+ else
+ sed -i \
+ -e "s/^\(Use SpamAssassin[ \t]*=\).*$/\1 no/" \
+ "${S}/etc/MailScanner.conf"
+ fi
+
+ # update bin files
+ sed -i \
+ -e "s#msbindir=/opt/MailScanner/bin#msbindir=/usr/sbin#g" \
+ -e "s#config=/opt/MailScanner/etc/MailScanner.conf#config=/etc/MailScanner/MailScanner.conf#g" \
+ "${S}/bin/check_mailscanner"
+ for each in update_virus_scanners update_phishing_sites update_bad_phishing_sites ; do
+ sed -i \
+ -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
+ "${S}"/bin/${each}
+ done
+ sed -i \
+ -e "s#/etc/sysconfig/MailScanner#/etc/conf.d/MailScanner#g" \
+ "${S}"/bin/update_spamassassin
+ sed -i \
+ -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
+ -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
+ "${S}"/bin/MailScanner
+
+ # update cron files
+ sed -i \
+ -e "s#/opt/MailScanner/bin/check_mailscanner#/usr/sbin/check_MailScanner#g" \
+ "${S}"/bin/cron/check_MailScanner.cron
+ for cronfile in update_virus_scanners.cron update_{,bad_}phishing_sites.cron; do
+ sed -i \
+ -e "s#/etc/sysconfig/MailScanner#/etc/conf.d/mailscanner#g" \
+ -e "s#/opt/MailScanner/bin#/usr/sbin#g" \
+ "${S}"/bin/cron/${cronfile}
+ done
+
+ # Determine some things that may need to be changed in conf file
+ # (need to arrive at sensible replacement for yoursite)
+ YOURSITE=`dnsdomainname | sed -e "s/\./-/g"`
+ BASEBIN="${BASE}/sbin"
+
+ # ClamAV requires some specific changes to MailScanner.conf
+ # when mailscanner is running as root (i.e. sendmail)
+ if use clamav ; then
+ if [ "$MTA" == "sendmail" ] ; then
+ WORKGRP="clamav"
+ WORKPERM="0640"
+ else
+ WORKGRP=""
+ WORKPERM="0600"
+ fi
+ else
+ WORKGRP=""
+ WORKPERM="0600"
+ fi
+
+ # update conf files
+ sed -i \
+ -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
+ -e "s#/opt/MailScanner/bin#$BASEBIN#g" \
+ -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
+ -e "s#^\(Run As User[ \t]*=\).*#\1 $RUNASUSER#" \
+ -e "s#^\(Run As Group[ \t]*=\).*#\1 $RUNASGROUP#" \
+ -e "s#^\(Incoming Queue Dir[ \t]*=\).*#\1 $INQUEUE#" \
+ -e "s#^\(Outgoing Queue Dir[ \t]*=\).*#\1 $OUTQUEUE#" \
+ -e "s#^\(MTA[ \t]*=\).*#\1 $MTA#" \
+ -e "s/^#\(TNEF.*internal\)$/\1/" \
+ -e "s/^\(TNEF.*0000\)$/#\1/" \
+ -e "s#^\(PID file[ \t]=\).*#\1 /var/run/mailscanner.pid#" \
+ -e "s#^\(%org-name%\)[ \t]*=.*#\1 = ${YOURSITE}#" \
+ -e "s#^\(Sendmail[ \t]*=\).*#\1 ${SENDMAIL}#" \
+ -e "s#^\(Sendmail2[ \t]*=\).*#\1 ${SENDMAIL2}#" \
+ -e "s#^\(Incoming Work Group[ \t]*=\).*#\1 ${WORKGRP}#" \
+ -e "s#^\(Incoming Work Permissions[ \t]*=\).*#\1 ${WORKPERM}#" \
+ "${S}/etc/MailScanner.conf"
+
+ # update spam.assassin.prefs.conf
+ sed -i -e "s#YOURDOMAIN-COM#${YOURSITE}#" "${S}/etc/spam.assassin.prefs.conf"
+
+ # net-mail/clamav net-mail/f-prot package compatibility
+ sed -i \
+ -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#" \
+ -e 's#^\(clamav\t.*/usr\)/local$#\1#' \
+ -e 's#^\(f-prot.*\)/usr/local/f-prot$#\1/opt/f-prot#' \
+ "${S}/etc/virus.scanners.conf"
+
+ # update lib files
+ sed -i \
+ -e "s#/opt/MailScanner/bin#$BASEBIN#g" \
+ -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
+ -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
+ "${S}/lib/MailScanner/ConfigDefs.pl"
+ sed -i \
+ -e "s#/opt/MailScanner/bin#$BASEBIN#g" \
+ -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
+ -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
+ "${S}/bin/MailScanner"
+ sed -i \
+ -e "s#/opt/MailScanner/bin#$BASEBIN#g" \
+ -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
+ -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
+ "${S}/bin/update_virus_scanners"
+ sed -i \
+ -e "s#/opt/MailScanner/bin#$BASEBIN#g" \
+ -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
+ -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
+ "${S}/bin/mailscanner_create_locks"
+ sed -i \
+ -e "s#/etc/MailScanner#/etc/MailScanner#g" \
+ "${S}/lib/MailScanner/CustomConfig.pm"
+
+ # finally, change MailScanner.conf into MailScanner.conf.sample
+ cp "${S}/etc/MailScanner.conf" "${S}/etc/MailScanner.conf.${MY_PV}"
+ mv "${S}/etc/MailScanner.conf" "${S}/etc/MailScanner.conf.sample"
+
+}
+
+src_install() {
+ exeinto ${BASE}/sbin
+ doexe bin/MailScanner
+ newexe bin/check_mailscanner check_MailScanner
+ doexe bin/d2mbox bin/df2mbox
+ doexe bin/update_virus_scanners
+ doexe bin/upgrade_MailScanner_conf
+ doexe bin/mailscanner_create_locks
+ doexe bin/Quick.Peek
+ doexe bin/update_bad_phishing_sites bin/update_phishing_sites
+ newexe bin/Sophos.install.linux Sophos.install
+
+ insinto /etc/MailScanner/conf.d
+ doins etc/conf.d/*
+
+ insinto /etc/MailScanner
+ doins etc/*.conf
+ doins etc/mailscanner.conf.with.mcp
+ doins etc/MailScanner.conf.${MY_PV}
+ doins etc/MailScanner.conf.sample
+
+ insinto /etc/MailScanner/rules
+ doins etc/rules/*
+ insinto /etc/MailScanner/mcp
+ doins etc/mcp/*
+
+ insinto /etc/MailScanner
+ doins -r etc/reports
+
+ insinto ${BASE}/$(get_libdir)/MailScanner
+ doins lib/*.prf
+
+ exeinto ${BASE}/$(get_libdir)/MailScanner
+ doexe lib/*-wrapper
+ doexe lib/*-autoupdate
+ doexe lib/*-autoupdate.old
+ doexe lib/*.pm
+
+ exeinto ${BASE}/$(get_libdir)/MailScanner/MailScanner
+ doexe lib/MailScanner/*.pm
+ doexe lib/MailScanner/*.pl
+
+ exeinto ${BASE}/$(get_libdir)/MailScanner/MailScanner/CustomFunctions
+ doexe lib/MailScanner/CustomFunctions/MyExample.pm
+
+ newinitd "${FILESDIR}"/initd.mailscanner MailScanner
+ newconfd "${FILESDIR}"/confd.mailscanner MailScanner
+
+ #Set up cron jobs
+ exeinto /etc/cron.hourly
+ newexe "${S}/bin/cron/check_MailScanner.cron" check_MailScanner
+ for cronfile in update_{virus_scanners,{bad_,}phishing_sites}; do
+ newexe "${S}/bin/cron/${cronfile}.cron" ${cronfile}
+ done
+
+ exeinto /etc/cron.daily
+ newexe "${S}/bin/cron/clean.quarantine.cron" clean.quarantine
+
+ dodoc README
+ insinto /usr/share/doc/${PF}
+ doins MailScanner.conf.index.html
+
+ keepdir /var/spool/MailScanner/incoming
+ keepdir /var/spool/MailScanner/quarantine
+ keepdir /var/spool/MailScanner/spamassassin
+ keepdir /var/spool/MailScanner/archive
+ keepdir ${BASE}/var
+
+ if use postfix ; then
+ chown -R postfix:postfix "${D}/var/spool/MailScanner/"
+ elif use exim ; then
+ chown -R mail:mail "${D}/var/spool/MailScanner/"
+ else
+ keepdir /var/spool/mqueue.in
+ fi
+ use spamassassin && dosym /etc/MailScanner/spam.assassin.prefs.conf /etc/mail/spamassassin/mailscanner.cf
+
+}
+
+pkg_postinst() {
+ if use postfix; then
+ elog "Note that postfix 2.4 now supports HOLD of messages"
+ elog "and reinjection without second postfix instance"
+ elog "Inbound path is now ${ROOT}var/spool/postfix/hold"
+ elog
+ elog "See http://mailscanner.info/postfix.html for details"
+ elog "or check (english) gentoo-wiki.com page which has been updated"
+ fi
+
+ if [ -f "/etc/MailScanner/MailScanner.conf" ]; then
+ einfo "Upgrading the MailScanner.conf file"
+ cp /etc/MailScanner/MailScanner.conf /etc/MailScanner/MailScanner.conf.pre_upgrade.${MY_PV}
+ /usr/sbin/upgrade_MailScanner_conf \
+ /etc/MailScanner/MailScanner.conf.pre_upgrade.${MY_PV} \
+ /etc/MailScanner/MailScanner.conf.${MY_PV} \
+ > /etc/MailScanner/MailScanner.conf 2> /dev/null
+ else
+ cp /etc/MailScanner/MailScanner.conf.sample /etc/MailScanner/MailScanner.conf
+ fi
+}
diff --git a/mail-filter/MailScanner/Manifest b/mail-filter/MailScanner/Manifest
new file mode 100644
index 000000000000..9099f8e7e04e
--- /dev/null
+++ b/mail-filter/MailScanner/Manifest
@@ -0,0 +1,5 @@
+AUX confd.mailscanner 147 SHA256 d0ef32a53c83a2c2938d970f30b3765676fe4669b2ec98407c39ca070cd24bbb SHA512 2fb6f96eef254fae597e23ddb80c649e5754999e542436b7172ab4fca0d3e281645a2fcf21a3bde4c6c9d7cd48de868e64e74c5caac7ff235dbbbcc6c2ebeda3 WHIRLPOOL 1402fbdef6cfbdd2937c6a172587444960fa76dcaccce643652eccd437ca8809a9019b91d1c411fa513329b1926d1a5728d43902f24f9afe9061ba2514e1cdda
+AUX initd.mailscanner 981 SHA256 e65a64fbfe6a20146ea99e48097a7320253a1eab1afd31134e5df65d8da435b0 SHA512 089724cbc6cc1b8007338e707c30a04a738a1a5a51faf1aac55f95942698d9f3b65c3c3dc789e277c716dc230f86e5256543219094b49010aa6d45abcf6a3f70 WHIRLPOOL c4115291228cc9f2b3522535630bfd3103611ffbe333bbf23db584c20b4e742d3d3b04a8aa47b2285b2f6bcd5714eaefc3c88bab869177f40d141a37a4552e1a
+DIST MailScanner-install-4.84.5-2.tar.gz 9510489 SHA256 3467a53159cc95a8b4f93a326a59e2d3acc0ad6f90f048f048742fe13ac741f1 SHA512 d9d082e29ddb6eae4f30069298507805a7674c264bf8edad3db3322fa0f2c2ad4539c0c2213c6fcbee11b7c57a36218c1d24243077358bac98e7ae07f7ee506f WHIRLPOOL a253706f33dbc3925e49d7bb0740fab39f87c690240c043eb10cf8d57ea938fd1e002fcec9d8f1c026003e07df01b724d2b696a6224a6cf52e8afc0e1d175d59
+EBUILD MailScanner-4.84.5.2.ebuild 9842 SHA256 833968a47bc2f3d65542750b003940b66b23a22b2cf1ffc5507b67512df44843 SHA512 92d2bb8979d44591e2518c0ca8264e18eb0c2e41cad88f1513cefdd5772795068ac9c9973e884a8e72615a6e5122831302bf99f034de5c57334717ed04a0990f WHIRLPOOL 22d1cfebcf534adade18faf2144cd6bf4b2d8129ce22a6a2259f5268351234d54f877c618c71ee59717724254aa232ea64be5003a68247f48fd354814b885dd4
+MISC metadata.xml 508 SHA256 1830c78748761d1449b95eb47bd86d753be527d54075265efe2ae68e49cd1cb0 SHA512 b00d84bb19d521b74e32cff232b5aefa4410b3f74d281684be17fd98945244c551f44b323e63ede5d2bd1b0f79ce5ad08b159e2c028201ec1373bb90e5fa64c5 WHIRLPOOL 68dd76557db7e8c759960d8be130610d6fc946154cc91e54a448468c1b9945aa3ada628e52565dbfa56c254a020fc8207678839c5a974dea80bceee08b660d51