diff options
author | Markus Ullmann <jokey@gentoo.org> | 2008-03-27 01:33:23 +0000 |
---|---|---|
committer | Markus Ullmann <jokey@gentoo.org> | 2008-03-27 01:33:23 +0000 |
commit | e34f8816ca546ab1ac4df425a6a36400922e91ce (patch) | |
tree | 25cdb2291763c5723f9c8229fc7b4a16e51f5a1b /mail-filter | |
parent | Drop old (diff) | |
download | historical-e34f8816ca546ab1ac4df425a6a36400922e91ce.tar.gz historical-e34f8816ca546ab1ac4df425a6a36400922e91ce.tar.bz2 historical-e34f8816ca546ab1ac4df425a6a36400922e91ce.zip |
Various improvements from bug #214122 thanks to Costas Cavouracis and John Wilcock
Package-Manager: portage-2.1.4.4
Diffstat (limited to 'mail-filter')
-rw-r--r-- | mail-filter/MailScanner/ChangeLog | 9 | ||||
-rw-r--r-- | mail-filter/MailScanner/MailScanner-4.67.6.1-r1.ebuild | 305 | ||||
-rw-r--r-- | mail-filter/MailScanner/Manifest | 11 |
3 files changed, 319 insertions, 6 deletions
diff --git a/mail-filter/MailScanner/ChangeLog b/mail-filter/MailScanner/ChangeLog index f6f7e073c9d8..2239f7af828c 100644 --- a/mail-filter/MailScanner/ChangeLog +++ b/mail-filter/MailScanner/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for mail-filter/MailScanner # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/MailScanner/ChangeLog,v 1.1 2008/03/20 15:34:14 jokey Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-filter/MailScanner/ChangeLog,v 1.2 2008/03/27 01:33:23 jokey Exp $ + +*MailScanner-4.67.6.1-r1 (27 Mar 2008) + + 27 Mar 2008; Markus Ullmann <jokey@gentoo.org> + +MailScanner-4.67.6.1-r1.ebuild: + Various improvements from bug #214122 thanks to Costas Cavouracis and John + Wilcock *MailScanner-4.67.6.1 (20 Mar 2008) diff --git a/mail-filter/MailScanner/MailScanner-4.67.6.1-r1.ebuild b/mail-filter/MailScanner/MailScanner-4.67.6.1-r1.ebuild new file mode 100644 index 000000000000..3bf9bb1b9b94 --- /dev/null +++ b/mail-filter/MailScanner/MailScanner-4.67.6.1-r1.ebuild @@ -0,0 +1,305 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/MailScanner/MailScanner-4.67.6.1-r1.ebuild,v 1.1 2008/03/27 01:33:23 jokey Exp $ + +inherit eutils versionator + +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="~x86" +IUSE="bitdefender clamav doc exim f-prot postfix spamassassin" + +DEPEND="dev-lang/perl" +RDEPEND="${DEPEND} + dev-perl/Archive-Zip + dev-perl/Compress-Zlib + dev-perl/Convert-BinHex + dev-perl/Convert-TNEF + dev-perl/DBD-SQLite + dev-perl/DBI + >=dev-perl/HTML-Parser-3.45 + dev-perl/HTML-Tagset + dev-perl/IO-stringy + >=dev-perl/MIME-tools-5.417 + dev-perl/MailTools + dev-perl/Net-CIDR + dev-perl/Net-DNS + dev-perl/TimeDate + dev-perl/Sys-Hostname-Long + dev-perl/Filesys-Df + >=net-mail/tnef-1.4.3 + virtual/perl-File-Spec + virtual/perl-File-Temp + virtual/perl-Getopt-Long + >=virtual/perl-Sys-Syslog-0.18 + >=virtual/perl-MIME-Base64-3.05 + virtual/cron + postfix? ( mail-mta/postfix ) + exim? ( !postfix? ( mail-mta/exim ) ) + !postfix? ( !exim? ( mail-mta/sendmail ) ) + bitdefender? ( app-antivirus/bitdefender-console ) + clamav? ( >=app-antivirus/clamav-0.88.4 ) + f-prot? ( app-antivirus/f-prot ) + spamassassin? ( >=mail-filter/spamassassin-3.1.5 )" + +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 bitdefender && VIRUS_SCANNERS="bitdefender ${VIRUS_SCANNERS}" + use clamav && VIRUS_SCANNERS="clamav ${VIRUS_SCANNERS}" + use f-prot && VIRUS_SCANNERS="f-prot ${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" + + # 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#/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/update_bad_phishing_sites bin/update_phishing_sites + newexe bin/Sophos.install.linux Sophos.install + + 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 + + insinto ${BASE}/$(get_libdir)/MailScanner/MailScanner + doins lib/MailScanner/*.txt + + 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 index c2f3b906fb20..84832dbb1b9d 100644 --- a/mail-filter/MailScanner/Manifest +++ b/mail-filter/MailScanner/Manifest @@ -4,13 +4,14 @@ Hash: SHA1 AUX confd.mailscanner 147 RMD160 2472095d115d136498f93a6dca3ce540e335222f SHA1 377447317cf1354b4e377912d18a459b12f7a8d6 SHA256 d0ef32a53c83a2c2938d970f30b3765676fe4669b2ec98407c39ca070cd24bbb AUX initd.mailscanner 756 RMD160 f75589025bbe9e7a3bc2f10a4a5eadab11f8d36a SHA1 cb4c505b3c9f4f993b656b6c96c6992ae00be5e0 SHA256 ba63aec0dae9c820b533d467c3325ada70a4b73761bed2207d10814f82f31b65 DIST MailScanner-install-4.67.6-1.tar.gz 8128173 RMD160 6a38ba6dd02cd90ebb887c6146485cbc771a3643 SHA1 51d08b364566bc902a1d3d91386c479b5f6e68ef SHA256 e0c803a6c3b243aa19b7e6bbac009617c02a308bc394eb64615e2148ac5d72e1 +EBUILD MailScanner-4.67.6.1-r1.ebuild 9341 RMD160 1753cb7e69779bb916e42c4f9a2502068bfde941 SHA1 e7d118916b7b3a03a8e7d3e443f6a73f837661a4 SHA256 2760c5195fa14408004b18c030dfc4cfba10b3d3e2faa388d403dd90bded9aa8 EBUILD MailScanner-4.67.6.1.ebuild 9046 RMD160 b6a730f3bb1ea13987f7deb5a2f37fc6387bf4e1 SHA1 935afcf84ae6c95a14d8366308838b5edb1f73de SHA256 6f2c0ee028f3620a3c5a43e405eb802b4368bad2019352927f5395fbe13d05e5 -MISC ChangeLog 1728 RMD160 e3699b18445c4bca2d358a7663cac881be00211d SHA1 642c0b2b77c4b6dc643125f694b05c354a7872b0 SHA256 ce16800196e913f14067c82860ded2e32139de31edaaa2198357952961057bf1 +MISC ChangeLog 1940 RMD160 67bc740f643e93ddfbdfa1d415026460d8f47e99 SHA1 0e9f5d42c1b5961cd0220940ad4891c8c61b689d SHA256 280e0cb7b359ae1b5cb6bd2f4e01cda92ae213c97a9910f3682bb41d1216c87f MISC metadata.xml 251 RMD160 f98b79c78c9a648314ee514bc8521a31a8018b3d SHA1 f58b9ae8d4a67e568288a4cf7d0037f228ba3fc4 SHA256 2ecb6b4fcce7435885895d82f44bd288b8ab797c7d6476eaac494d44a56f8886 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.7 (GNU/Linux) +Version: GnuPG v2.0.9 (GNU/Linux) -iD8DBQFH4oP8z974XjDVpbkRAu9aAJ0T2eWLVfJctVM2+nyeVPHsDa+IqQCggHMT -PK+0SBGXRa43APz5A3F6+OM= -=aNZ3 +iEYEARECAAYFAkfq+WgACgkQz974XjDVpbnbogCfYyvfG3TIfsVWw1EOWdd+gBIU +GLEAoNgoWSB/jnBbaOs9yv/ISA069zwI +=+vHq -----END PGP SIGNATURE----- |