summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLim Swee Tat <st_lim@gentoo.org>2006-02-13 16:02:22 +0000
committerLim Swee Tat <st_lim@gentoo.org>2006-02-13 16:02:22 +0000
commit38b024b5174167aa35f664aa804b0c800270fc8c (patch)
treef63ebf59265c25ce29070fff6dea2dca4babc55c /mail-filter/dspam
parentVersion bump. Thanks to Matteo Azzali bug #122650 (diff)
downloadgentoo-2-38b024b5174167aa35f664aa804b0c800270fc8c.tar.gz
gentoo-2-38b024b5174167aa35f664aa804b0c800270fc8c.tar.bz2
gentoo-2-38b024b5174167aa35f664aa804b0c800270fc8c.zip
Version bump
(Portage version: 2.1_pre4-r1)
Diffstat (limited to 'mail-filter/dspam')
-rw-r--r--mail-filter/dspam/ChangeLog8
-rw-r--r--mail-filter/dspam/Manifest50
-rw-r--r--mail-filter/dspam/dspam-3.6.4.ebuild474
-rw-r--r--mail-filter/dspam/files/digest-dspam-3.6.46
-rw-r--r--mail-filter/dspam/files/dspam.cron28
5 files changed, 561 insertions, 5 deletions
diff --git a/mail-filter/dspam/ChangeLog b/mail-filter/dspam/ChangeLog
index 7a3f12c99943..39b2288d2a75 100644
--- a/mail-filter/dspam/ChangeLog
+++ b/mail-filter/dspam/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for mail-filter/dspam
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/ChangeLog,v 1.72 2006/01/20 08:23:21 st_lim Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/ChangeLog,v 1.73 2006/02/13 15:59:26 st_lim Exp $
+
+*dspam-3.6.4 (13 Feb 2006)
+
+ 13 Feb 2006; Lim Swee Tat <st_lim@gentoo.org> files/dspam.cron,
+ +dspam-3.6.4.ebuild:
+ Version bump 3.6.4
*dspam-3.6.3 (20 Jan 2006)
diff --git a/mail-filter/dspam/Manifest b/mail-filter/dspam/Manifest
index 37921dabe24e..283316d99eb7 100644
--- a/mail-filter/dspam/Manifest
+++ b/mail-filter/dspam/Manifest
@@ -1,21 +1,69 @@
MD5 e61e777b7c3fe1aadb852c7ddc4db2c8 ChangeLog 12868
+RMD160 b69e7db62bc57430891864a4ac68c11d33d0ab7f ChangeLog 12868
+SHA256 c688426eb5269d93147a3cdfc1eb06c99051f20dcf5ea759de1efd9c117b17cb ChangeLog 12868
MD5 d67e6503fcd6df5a6b7875c95c3d082a dspam-3.2.7.ebuild 15522
+RMD160 23a4c5f7b2bc6e3678ac7ac2f52b082b6b0c78ff dspam-3.2.7.ebuild 15522
+SHA256 fd4058d2906f69dfedca2503f4ddbb9fee9188d2bde6bc65ec4ddd71821e9b9c dspam-3.2.7.ebuild 15522
MD5 1357c22572c375162a93d9be034d53cd dspam-3.4.9.ebuild 19643
+RMD160 2ed5893c13fb9ff727bc092ae6ac6b550f4f340c dspam-3.4.9.ebuild 19643
+SHA256 2c31f1e96d682d85f4ec64c748a385aa6d64541adc293300c031b531dcfffcba dspam-3.4.9.ebuild 19643
MD5 e117e7b4c6a7b15bd24832c416c106f3 dspam-3.6.0.ebuild 18417
+RMD160 23e253a75d5c26ce2739583013f900bd5e999aa6 dspam-3.6.0.ebuild 18417
+SHA256 1bb0dd4ff675eabf6255d0ab385335691d2428701a037f979da79196bcca1a84 dspam-3.6.0.ebuild 18417
MD5 64c1c2f016fbf8a85f9877ef6a757618 dspam-3.6.1.ebuild 18243
+RMD160 16e0cea71d783d6acf1200390d6c5a7882c3c2ba dspam-3.6.1.ebuild 18243
+SHA256 d01a6acfddfbd0b767297818192a69db3c5a24cc4ad0e415518690e65f62a18c dspam-3.6.1.ebuild 18243
MD5 16f46fe5b2ee6a9deb4e8cd7fd7254c1 dspam-3.6.2.ebuild 18243
+RMD160 8b8a4dba999c8164a30715f5da0ffc58dbb89a14 dspam-3.6.2.ebuild 18243
+SHA256 25ffa4a2359ca1ec1bfe6bff1990e4d16c0d075c82924e200096f2da17bbc423 dspam-3.6.2.ebuild 18243
MD5 5ba2779930edea12864163bc70f3b161 dspam-3.6.3.ebuild 18245
+RMD160 0a60874b910029b0c6998aaa51a469977493fd62 dspam-3.6.3.ebuild 18245
+SHA256 8f153964373e03e1c54fefcbd570382b3a0a205ce36d63cea7acde48866ae4ce dspam-3.6.3.ebuild 18245
+MD5 b0d7d0b75362396264aa67250e8b396f dspam-3.6.4.ebuild 17922
+RMD160 d0d1c0d25e1e3664e5d6f8614b2ae42d90c60d15 dspam-3.6.4.ebuild 17922
+SHA256 f1c7e5972dad22938d8444fb1e5597a58c6ba9e387dba27558562cd7be5d5473 dspam-3.6.4.ebuild 17922
MD5 c12a54112c6fec3530a7b1a368d04ac8 files/README.postfix 309
+RMD160 34f35ffa4e393ba1791cef2800bc8b4d4f49df5b files/README.postfix 309
+SHA256 e0928cf2d734e79419c30a4ee829962351ef5a1247ed1d1ddf3b58410e14828b files/README.postfix 309
MD5 e0469b961385fda4305602dc2519d319 files/README.qmail 2317
+RMD160 ebdd90be77441540848caf39b6fcde3d332b2b93 files/README.qmail 2317
+SHA256 c70a32eb183401f3d36b8e13c1e298875692b8a9d3f34151ae42b172dd6f064a files/README.qmail 2317
MD5 cd1bdb75fd86304f9453741a910cb8a2 files/crontab.db4 196
+RMD160 f1f9b7df67029b81d185cadf531c6310b1a90fb1 files/crontab.db4 196
+SHA256 d10ae01b52ac1710ebefe44f54d05bde315a1d59e58bb5d106d728babff3f36a files/crontab.db4 196
MD5 f2f86e8f7ab440c8537f40fa18a0ee43 files/crontab.mysql 118
+RMD160 9948beccbe686a23e32b06c569dbc3701a1abd6e files/crontab.mysql 118
+SHA256 e6ae345c6be2fc9e741e9f83a1b0399b2a6b362a062a9fe94ff01861d300cee4 files/crontab.mysql 118
MD5 7735956f416bd58bfcbeee99af43bea0 files/digest-dspam-3.2.7 63
+RMD160 ce7960915bff3c533ccffc2698ab6a2a44e63623 files/digest-dspam-3.2.7 63
+SHA256 f30a88498275e3e0f401a373c3fd8f0e7f6669cf1eac9f06a7a6addbbe1be1d5 files/digest-dspam-3.2.7 63
MD5 bf443ca4bd218fa9d4b8975bf450c347 files/digest-dspam-3.4.9 129
+RMD160 594451cae2ecf5d42a6dfe9f3457d2bfc4deeae6 files/digest-dspam-3.4.9 129
+SHA256 f7dbfa097029001a229850fed24a47b578e2bf72b661edd229b5cddf7d2e04e7 files/digest-dspam-3.4.9 129
MD5 03b69dda833751bdda04e5413a9305e0 files/digest-dspam-3.6.0 129
+RMD160 7938c059468012e29bb5f97bd2c45aabcaf581f6 files/digest-dspam-3.6.0 129
+SHA256 f3687b62ab140539ba49cf5efc5113cb0313604c8221fcef8fe9ad9364e819c2 files/digest-dspam-3.6.0 129
MD5 5a495629f2b3fbcfabc0f4ae4a9b4e4b files/digest-dspam-3.6.1 129
+RMD160 2f8252fb53b7bd3c69af67cc73d79edb28dbb9ea files/digest-dspam-3.6.1 129
+SHA256 22fe216d58d850934d647270dec89fe999bf2d75a47f69845c0773595b3a534e files/digest-dspam-3.6.1 129
MD5 c7e2e5a923e66ccdb462ab5b58f134bc files/digest-dspam-3.6.2 129
+RMD160 9ede1c3e4ca2415e9e0eb71e7564b9288c9da924 files/digest-dspam-3.6.2 129
+SHA256 8e040de867d0a3880f8f71be861e3baed9f2ae1bb58c57227eb911589cde4d0f files/digest-dspam-3.6.2 129
MD5 f73f2bd58b9d8ace7a6f431e8587c909 files/digest-dspam-3.6.3 129
-MD5 34841f2d2c9d6e057b9839bbe354e34a files/dspam.cron 3478
+RMD160 10d6cbe604729a619fdea9fe27714d117d593342 files/digest-dspam-3.6.3 129
+SHA256 51b4104316124d35d8e81d99b681b13e2a15c41f650e50dec6bf8b6d461be3a2 files/digest-dspam-3.6.3 129
+MD5 05946cf8fedd62fdf054d5abc2374f75 files/digest-dspam-3.6.4 479
+RMD160 6de5fa0dcf705c1ac19dc8423adf9e011d8bd4dd files/digest-dspam-3.6.4 479
+SHA256 8ef5a56d692d54d6de1b379475c19471bce4b926003d9987b9e38be64b383b80 files/digest-dspam-3.6.4 479
+MD5 c587b15b04392911dd203bb84b410fc1 files/dspam.cron 4365
+RMD160 480ee9f38e938e326d8027a3ea9278627104f4ac files/dspam.cron 4365
+SHA256 4c5e354832d89e8de6fdd1666c68cad66cd93f65ba53b7c3badf409a613c70f1 files/dspam.cron 4365
MD5 e2850ede85e459ab5479b7d2e79eeb5a files/dspam.rc 1025
+RMD160 d223977cf390b1e89392462f06b31b0722810fa3 files/dspam.rc 1025
+SHA256 9726e4b7699ccbb305d5e161baec2010e115731e582f69c3c670ec36bb099d34 files/dspam.rc 1025
MD5 2163ca41de383f09f4d754e2d35cb158 files/logrotate.dspam 156
+RMD160 256f2607b275336f944b0882591366c39b53daf7 files/logrotate.dspam 156
+SHA256 75e04139e564ad55011ee77b8245dc5cdefbb6d56ca451feab5861ab907d614e files/logrotate.dspam 156
MD5 dbfbe5a3bbe3347938107f5f5bd2197e metadata.xml 308
+RMD160 e00f0ac6e9ed220c85106ef5b3f3f10c2ae7367e metadata.xml 308
+SHA256 22e22f11e18ee12d274bff94c5d12acb02acd5a823fb2e5ebe0d0da609e3507e metadata.xml 308
diff --git a/mail-filter/dspam/dspam-3.6.4.ebuild b/mail-filter/dspam/dspam-3.6.4.ebuild
new file mode 100644
index 000000000000..0211d95c9086
--- /dev/null
+++ b/mail-filter/dspam/dspam-3.6.4.ebuild
@@ -0,0 +1,474 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.6.4.ebuild,v 1.1 2006/02/13 15:59:26 st_lim Exp $
+
+inherit eutils
+
+DESCRIPTION="A statistical-algorithmic hybrid anti-spam filter"
+SRC_URI="http://dspam.nuclearelephant.com/sources/${P}.tar.gz
+ http://dspam.nuclearelephant.com/sources/extras/dspam_sa_trainer.tar.gz"
+HOMEPAGE="http://dspam.nuclearelephant.com/"
+LICENSE="GPL-2"
+
+IUSE="berkdb clamav debug large-domain ldap logrotate mysql oci8 postgres sqlite sqlite3 virtual-users user-homedirs"
+DEPEND="berkdb? ( >=sys-libs/db-4.0 )
+ clamav? ( >=app-antivirus/clamav-0.86 )
+ ldap? ( >=net-nds/openldap-2.2 )
+ mysql? ( >=dev-db/mysql-3.23 )
+ postgres? ( >=dev-db/postgresql-7.4.3 )
+ sqlite? ( <dev-db/sqlite-3 )
+ sqlite3? ( =dev-db/sqlite-3* )
+ "
+RDEPEND="sys-process/cronbase
+ berkdb? ( >=sys-libs/db-4.0 )
+ clamav? ( >=app-antivirus/clamav-0.86 )
+ logrotate? ( app-admin/logrotate )
+ mysql? ( >=dev-db/mysql-3.23 )
+ postgres? ( >=dev-db/postgresql-7.4.3 )
+ sqlite? ( <dev-db/sqlite-3 )
+ sqlite3? ( =dev-db/sqlite-3* )"
+KEYWORDS="~x86 ~ppc ~alpha ~amd64"
+SLOT="0"
+
+# some FHS-like structure
+HOMEDIR="/var/spool/dspam"
+CONFDIR="/etc/mail/dspam"
+LOGDIR="/var/log/dspam"
+
+pkg_setup() {
+ local multiple_dbs="0"
+ local supported_dbs="berkdb mysql postgres oci8 sqlite sqlite3"
+ for foo in ${supported_dbs}; do
+ if use ${foo}; then
+ let multiple_dbs="((multiple_dbs + 1 ))"
+ einfo " ${foo} database support in your USE flags."
+ fi
+ done
+ if [ "${multiple_dbs}" -ge "2" ]; then
+ echo
+ ewarn "You have multiple database backends active in your USE flags."
+ ewarn "Will default to MySQL as your dspam database backend."
+ ewarn "If you want to build with another database backend; hit Control-C now."
+ ewarn "Change your USE flag -mysql and emerge again."
+ echo
+ has_version ">=sys-apps/portage-2.0.50" && (
+ einfo "It would be best practice to add the set of USE flags that you use for this"
+ einfo "package to the file: /etc/portage/package.use. Example:"
+ einfo "\`echo \"mail-filter/dspam -mysql postgres -oci8 -sqlite -sqlite3\" >> /etc/portage/package.use\`"
+ einfo "to build dspam with Postgres database as your dspam backend."
+ )
+ elif [ "${multiple_dbs}" -eq "0" ]; then
+ echo
+ ewarn "You did not select any SQL based database backend."
+ ewarn "DSPAM will use self-contained Hash driver for storing data."
+ ewarn "If you don't want that, then enable one of the following"
+ ewarn "USE flags: ${supported_dbs}"
+ fi
+ has_version ">sys-kernel/linux-headers-2.6" || (
+ einfo "To use the new DSPAM deamon mode, you need to emerge"
+ einfo ">sys-kernel/linux-headers-2.6 and rebuild glibc to support NPTL"
+ )
+ if use virtual-users && use user-homedirs ; then
+ ewarn "If the users are virtual, then they probably should not have home directories."
+ fi
+ if use user-homedirs ; then
+ ewarn "WARNING: dspam-web will not work with user-homedirs. Disable this USE flag"
+ ewarn "if you intend on using dspam-web."
+ fi
+ id dspam 2>/dev/null || enewgroup dspam 26
+ id dspam 2>/dev/null || enewuser dspam 26 /bin/bash ${HOMEDIR} dspam
+}
+
+src_compile() {
+ local myconf
+
+ myconf="${myconf} --enable-long-username"
+ myconf="${myconf} --with-delivery-agent=/usr/bin/procmail"
+ use large-domain && myconf="${myconf} --enable-large-scale" ||\
+ myconf="${myconf} --enable-domain-scale"
+
+ myconf="${myconf} --with-dspam-home=${HOMEDIR}"
+ myconf="${myconf} --sysconfdir=${CONFDIR}"
+ use user-homedirs && myconf="${myconf} --enable-homedir"
+ use clamav && myconf="${myconf} --enable-clamav"
+ use ldap && myconf="${myconf} --enable-ldap"
+
+ # enables support for debugging (touch /etc/dspam/.debug to turn on)
+ # optional: even MORE debugging output, use with extreme caution!
+ use debug && myconf="${myconf} --enable-debug --enable-verbose-debug --enable-bnr-debug"
+
+ # select storage driver
+ if use sqlite ; then
+ myconf="${myconf} --with-storage-driver=sqlite_drv"
+ myconf="${myconf} --enable-virtual-users"
+ elif use sqlite3 ; then
+ myconf="${myconf} --with-storage-driver=sqlite3_drv"
+ myconf="${myconf} --enable-virtual-users"
+ elif use mysql; then
+ myconf="${myconf} --with-storage-driver=mysql_drv"
+ myconf="${myconf} --with-mysql-includes=/usr/include/mysql"
+ myconf="${myconf} --with-mysql-libraries=/usr/lib/mysql"
+ myconf="${myconf} --enable-preferences-extension"
+
+ if has_version ">sys-kernel/linux-headers-2.6"; then
+ myconf="${myconf} --enable-daemon"
+ fi
+
+ use virtual-users && myconf="${myconf} --enable-virtual-users"
+ elif use postgres ; then
+ myconf="${myconf} --with-storage-driver=pgsql_drv"
+ myconf="${myconf} --with-pgsql-includes=/usr/include/postgresql"
+ myconf="${myconf} --with-pgsql-libraries=/usr/lib/postgresql"
+ myconf="${myconf} --enable-preferences-extension"
+
+ if has_version ">sys-kernel/linux-headers-2.6"; then
+ myconf="${myconf} --enable-daemon"
+ fi
+
+ use virtual-users && myconf="${myconf} --enable-virtual-users"
+ elif use oci8 ; then
+ myconf="${myconf} --with-storage-driver=ora_drv"
+ myconf="${myconf} --with-oracle-home=${ORACLE_HOME}"
+ myconf="${myconf} --enable-virtual-users"
+
+ # I am in no way a Oracle specialist. If someone knows
+ # how to query the version of Oracle, then let me know.
+ if (expr ${ORACLE_HOME/*\/} : 10 1>/dev/null 2>&1); then
+ myconf="${myconf} --with-oracle-version=10"
+ fi
+ elif use berkdb ; then
+ myconf="${myconf} --with-storage-driver=libdb4_drv"
+ else
+ myconf="${myconf} --with-storage-driver=hash_drv"
+ fi
+
+ econf ${myconf} || die
+ emake || die
+}
+
+src_install () {
+
+ # Fix issues with older dspam configuration
+ CONFIG_PROTECT="${CONFIG_PROTECT} ${HOMEDIR} ${CONFDIR} /var/run/dspam"
+ CONFIG_PROTECT_MASK="${CONFIG_PROTECTMASK/${HOMEDIR}/}"
+ CONFIG_PROTECT_MASK="${CONFIG_PROTECTMASK/${CONFDIR}/}"
+
+ # open up perms on $HOMEDIR
+ diropts -m0775 -o dspam -g dspam
+ dodir ${HOMEDIR}
+ keepdir ${HOMEDIR}
+
+ # keeps dspam data in $CONFDIR
+ diropts -m0775 -o dspam -g dspam
+ dodir ${CONFDIR}
+ keepdir ${CONFDIR}
+
+ # make install
+ make DESTDIR=${D} install || die
+ chmod o+s ${D}/usr/bin/dspam
+ chmod o+s ${D}/usr/bin/dspam_stats
+
+ # documentation
+ dodoc CHANGELOG LICENSE README* RELEASE.NOTES UPGRADING
+ dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz
+ docinto doc
+ dodoc doc/*.txt
+ docinto gentoo
+ dodoc ${FILESDIR}/README.postfix ${FILESDIR}/README.qmail
+ if use sqlite; then
+ dodoc src/tools.sqlite_drv/README
+ elif use mysql; then
+ dodoc src/tools.mysql_drv/README
+ elif use postgres ; then
+ dodoc src/tools.pgsql_drv/README
+ elif use oci8 ; then
+ dodoc src/tools.ora_drv/README
+ fi
+ doman man/dspam*
+ dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz
+
+ # build some initial configuration data
+ [ ! -f ${CONFDIR}/dspam.conf ] \
+ && cp src/dspam.conf ${T}/dspam.conf
+
+ if use mysql || use postgres; then
+ if has_version ">sys-kernel/linux-headers-2.6"; then
+ # keeps dspam socket for deamon in /var/run/dspam
+ diropts -m0775 -o dspam -g dspam
+ dodir /var/run/dspam
+ keepdir /var/run/dspam
+
+ # We use sockets for the deamon instead of tcp port 24
+ sed -e 's:^#*\(ServerDomainSocketPath[\t ]\{1,\}\).*:\1\"/var/run/dspam/dspam.sock\":gI' \
+ -e 's:^#*\(ServerPID[\t ]\{1,\}\).*:\1/var/run/dspam/dspam.pid:gI' \
+ -i ${T}/dspam.conf
+
+ # dspam init script
+ exeinto /etc/init.d
+ exeopts -m0755 -o root -g root
+ newexe ${FILESDIR}/dspam.rc dspam
+ fi
+ fi
+
+ # generate random password
+ local PASSWORD="${RANDOM}${RANDOM}${RANDOM}${RANDOM}"
+
+ # database related configuration and scripts
+ if use sqlite; then
+ insinto ${CONFDIR}
+ insopts -m644 -o dspam -g dspam
+ newins src/tools.sqlite_drv/purge-2.sql sqlite_purge.sql
+ elif use sqlite3; then
+ insinto ${CONFDIR}
+ insopts -m644 -o dspam -g dspam
+ newins src/tools.sqlite_drv/purge-3.sql sqlite3_purge.sql
+ elif use mysql; then
+ # Use existing configuration if possible
+ if [[ -f ${ROOT}${CONFDIR}/mysql.data ]]; then
+ DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/mysql.data") )
+ for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
+ [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
+ done
+ else
+ DSPAM_DB_DATA[0]="/var/run/mysqld/mysqld.sock"
+ DSPAM_DB_DATA[1]=""
+ DSPAM_DB_DATA[2]="dspam"
+ DSPAM_DB_DATA[3]="${PASSWORD}"
+ DSPAM_DB_DATA[4]="dspam"
+ DSPAM_DB_DATA[5]="true"
+ fi
+
+ # Modify configuration and create mysql.data file
+ sed -e "s:^#*\(MySQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
+ -e "s:^#*\(MySQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
+ -e "s:^#*\(MySQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
+ -e "s:^#*\(MySQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \
+ -e "s:^#*\(MySQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \
+ -e "s:^#*\(MySQLCompress[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[5]}:gI" \
+ -i ${T}/dspam.conf
+ for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
+ echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/mysql.data
+ done
+ insinto ${CONFDIR}
+ insopts -m644 -o dspam -g dspam
+ doins ${T}/mysql.data
+ newins src/tools.mysql_drv/mysql_objects-space.sql mysql_objects-space.sql
+ newins src/tools.mysql_drv/mysql_objects-speed.sql mysql_objects-speed.sql
+ newins src/tools.mysql_drv/mysql_objects-4.1.sql mysql_objects-4.1.sql
+ newins src/tools.mysql_drv/virtual_users.sql mysql_virtual_users.sql
+ newins src/tools.mysql_drv/purge.sql mysql_purge.sql
+ newins src/tools.mysql_drv/purge-4.1.sql mysql_purge-4.1.sql
+
+ elif use postgres ; then
+ # Use existing configuration if possible
+ if [ -f ${ROOT}${CONFDIR}/pgsql.data ]; then
+ DSPAM_DB_DATA=( $(cat "${ROOT}${CONFDIR}/pgsql.data") )
+ for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
+ [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
+ done
+ else
+ DSPAM_DB_DATA[0]="127.0.0.1"
+ DSPAM_DB_DATA[1]="5432"
+ DSPAM_DB_DATA[2]="dspam"
+ DSPAM_DB_DATA[3]="${PASSWORD}"
+ DSPAM_DB_DATA[4]="dspam"
+ fi
+
+ # Modify configuration and create pgsql.data file
+ sed -e "s:^#*\(PgSQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
+ -e "s:^#*\(PgSQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
+ -e "s:^#*\(PgSQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
+ -e "s:^#*\(PgSQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \
+ -e "s:^#*\(PgSQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \
+ -e "s:^#*\(PgSQLConnectionCache[\t ]*.\):\1:gI" \
+ -i ${T}/dspam.conf
+ for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
+ echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/pgsql.data
+ done
+
+ insinto ${CONFDIR}
+ insopts -m644 -o dspam -g dspam
+ doins ${T}/pgsql.data
+ newins src/tools.pgsql_drv/pgsql_objects.sql pgsql_objects.sql
+ newins src/tools.pgsql_drv/virtual_users.sql pgsql_virtual_users.sql
+ newins src/tools.pgsql_drv/purge.sql pgsql_purge.sql
+
+ elif use oci8 ; then
+ # Use existing configuration if possible
+ if [ -f ${ROOT}${CONFDIR}/oracle.data ]; then
+ DSPAM_DB_DATA=( $(cat "${ROOT}${CONFDIR}/oracle.data") )
+ for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
+ [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
+ done
+ else
+ DSPAM_DB_DATA[0]="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=PROD)))"
+ DSPAM_DB_DATA[1]="dspam"
+ DSPAM_DB_DATA[2]="${PASSWORD}"
+ DSPAM_DB_DATA[3]="dspam"
+ fi
+
+ # Modify configuration and create oracle.data file
+ sed -e "s:^#*\(OraServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
+ -e "s:^\(OraUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
+ -e "s:^\(OraPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
+ -e "s:^\(OraSchema[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI"\
+ -i ${T}/dspam.conf
+ for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
+ echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/oracle.data
+ done
+
+ insinto ${CONFDIR}
+ insopts -m644 -o dspam -g dspam
+ doins ${T}/oracle.data
+ newins src/tools.ora_drv/oral_objects.sql ora_objects.sql
+ newins src/tools.ora_drv/virtual_users.sql ora_virtual_users.sql
+ newins src/tools.ora_drv/purge.sql ora_purge.sql
+ fi
+
+ sed -e "s:^\(Purge.*\):###\1:g" \
+ -e "s:^#\(Purge.*\):\1:g" \
+ -e "s:^###\(Purge.*\):#\1:g" \
+ -i ${T}/dspam.conf
+ insinto ${CONFDIR}
+ insopts -m644 -o dspam -g dspam
+ doins ${T}/dspam.conf
+
+ # installs the notification messages
+ # -> The documentation is wrong! The files need to be in ./txt
+ diropts -m0775 -o dspam -g dspam
+ dodir ${HOMEDIR}/txt
+ keepdir ${HOMEDIR}/txt
+ insinto ${HOMEDIR}/txt
+ insopts -m644 -o dspam -g dspam
+ doins ${S}/txt/*.txt
+
+ # Create the opt-in / opt-out directories
+ diropts -m0775 -o dspam -g dspam
+ dodir ${HOMEDIR}/opt-in
+ keepdir ${HOMEDIR}/opt-in
+ dodir ${HOMEDIR}/opt-out
+ keepdir ${HOMEDIR}/opt-out
+
+ # logrotation scripts
+ diropts -m0755 -o dspam -g dspam
+ dodir /etc/logrotate.d
+ keepdir /etc/logrotate.d
+ insinto /etc/logrotate.d
+ insopts -m0644 -o dspam -g dspam
+ newins ${FILESDIR}/logrotate.dspam dspam
+
+ # dspam cron job
+ diropts -m0755 -o dspam -g dspam
+ dodir /etc/cron.daily
+ keepdir /etc/cron.daily
+ exeinto /etc/cron.daily
+ exeopts -m0755 -o dspam -g dspam
+ doexe ${FILESDIR}/dspam.cron
+
+ # dspam enviroment
+ echo -ne "CONFIG_PROTECT=\"${CONFDIR} /var/run/dspam\"\n\n" > ${T}/40dspam
+ doenvd ${T}/40dspam || die
+}
+
+pkg_postinst() {
+ env-update
+ if use mysql || use postgres || use oci8; then
+ echo
+ einfo "To setup DSPAM to run out-of-the-box on your system with a MySQL,"
+ einfo "PostgreSQL or Oracle database, run:"
+ einfo "emerge --config ${PF}"
+ fi
+ if use mysql || use postgres; then
+ if has_version ">sys-kernel/linux-headers-2.6"; then
+ einfo "If you want to run DSPAM in the new deamon mode. Remember"
+ einfo "to make the DSPAM daemon start durig boot:"
+ einfo " rc-update add dspam default"
+ fi
+ fi
+ if use exim ; then
+ echo
+ einfo "To use dspam in conjunction with your exim system, you should read the README"
+ fi
+}
+
+pkg_config () {
+ if use sqlite ; then
+ einfo "sqlite_drv will automatically create the necessary database"
+ elif use mysql ; then
+ DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/mysql.data") )
+ for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
+ [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
+ done
+ DSPAM_MySQL_USER="${DSPAM_DB_DATA[2]}"
+ DSPAM_MySQL_PWD="${DSPAM_DB_DATA[3]}"
+ DSPAM_MySQL_DB="${DSPAM_DB_DATA[4]}"
+
+ ewarn "When prompted for a password, please enter your MySQL root password"
+ ewarn
+
+ einfo "Creating DSPAM MySQL database \"${DSPAM_MySQL_DB}\""
+ /usr/bin/mysqladmin -u root -p create ${DSPAM_MySQL_DB}
+
+ einfo "Creating DSPAM MySQL tables for data objects"
+ einfo " Please select what kind of object database you like to use."
+ einfo " [1] Space optimized database"
+ einfo " [2] Speed optimized database"
+ einfo
+ while true
+ do
+ read -n 1 -s -p " Press 1 or 2 on the keyboard to select database" DSPAM_MySQL_DB_Type
+ [[ "${DSPAM_MySQL_DB_Type}" == "1" || "${DSPAM_MySQL_DB_Type}" == "2" ]] && echo && break
+ done
+
+ if [ "${DSPAM_MySQL_DB_Type}" == "1" ]
+ then
+ /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-space.sql
+ else
+ /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-speed.sql
+ fi
+
+ if use virtual-users ; then
+ einfo "Creating DSPAM MySQL database for virtual-users users"
+ /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_virtual_users.sql
+ fi
+
+ einfo "Creating DSPAM MySQL user \"${DSPAM_MySQL_USER}\""
+ /usr/bin/mysql -u root -p -e "GRANT SELECT,INSERT,UPDATE,DELETE ON ${DSPAM_MySQL_DB}.* TO ${DSPAM_MySQL_USER}@localhost IDENTIFIED BY '${DSPAM_MySQL_PWD}';FLUSH PRIVILEGES;" -D mysql
+ elif use postgres ; then
+ DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/pgsql.data") )
+ for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
+ [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
+ done
+ DSPAM_PgSQL_USER="${DSPAM_DB_DATA[2]}"
+ DSPAM_PgSQL_PWD="${DSPAM_DB_DATA[3]}"
+ DSPAM_PgSQL_DB="${DSPAM_DB_DATA[4]}"
+
+ ewarn "When prompted for a password, please enter your PgSQL postgres password"
+ ewarn
+
+ einfo "Creating DSPAM PostgreSQL database \"${DSPAM_PgSQL_DB}\" and user \"${DSPAM_PgSQL_USER}\""
+ /usr/bin/psql -h localhost -d template1 -U postgres -c "CREATE USER ${DSPAM_PgSQL_USER} WITH PASSWORD '${DSPAM_PgSQL_PWD}' NOCREATEDB NOCREATEUSER; CREATE DATABASE ${DSPAM_PgSQL_DB}; GRANT ALL PRIVILEGES ON DATABASE ${DSPAM_PgSQL_DB} TO ${DSPAM_PgSQL_USER}; GRANT ALL PRIVILEGES ON SCHEMA public TO ${DSPAM_PgSQL_USER}; UPDATE pg_database SET datdba=(SELECT usesysid FROM pg_shadow WHERE usename='${DSPAM_PgSQL_USER}') WHERE datname='${DSPAM_PgSQL_DB}';"
+
+ einfo "Creating DSPAM PostgreSQL tables"
+ PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${CONFDIR}/pgsql_objects.sql 1>/dev/null 2>&1
+
+ if use virtual-users ; then
+ einfo "Creating DSPAM PostgreSQL database for virtual-users users"
+ PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${CONFDIR}/pgsql_virtual-users.sql 1>/dev/null 2>&1
+ fi
+ elif use oci8 ; then
+ einfo "We have not enought Oracle knowledge to configure Oracle"
+ einfo "automatically. If you know how, please post a message in"
+ einfo "Gentoo Bugzilla."
+ einfo
+ einfo "You need manually to create the Oracle user for DSPAM and"
+ einfo "the necessary database."
+ einfo "But the DSPAM configuration file dspam.conf and oracle.data"
+ einfo "was already configured with the necessary information to"
+ einfo "access the database."
+ einfo "Please read your dspam.conf, oracle.data and the README for"
+ einfo "more info on how to setup DSPAM with Oracle."
+ einfo "objects for each user upon first use of DSPAM by that user."
+ fi
+
+}
diff --git a/mail-filter/dspam/files/digest-dspam-3.6.4 b/mail-filter/dspam/files/digest-dspam-3.6.4
new file mode 100644
index 000000000000..da38c38c3288
--- /dev/null
+++ b/mail-filter/dspam/files/digest-dspam-3.6.4
@@ -0,0 +1,6 @@
+MD5 e5e5d4beeea8d067aee9ad373c20cb22 dspam-3.6.4.tar.gz 743467
+RMD160 241389dd7da4749e13ab462c8c8e46ef9f03b477 dspam-3.6.4.tar.gz 743467
+SHA256 86868379d4f7ad4be8d039c9d8610739e7701f5602d0f67a3a7a059ea6865f16 dspam-3.6.4.tar.gz 743467
+MD5 8ffe9d41e6104a4c6d19067528193145 dspam_sa_trainer.tar.gz 1230
+RMD160 c3d0fca7169d23ecf9d44c850ee255b42d97d818 dspam_sa_trainer.tar.gz 1230
+SHA256 8fb6b1ebe592acf00a028737ef8e174544af166768b987d29048b2319bc5a215 dspam_sa_trainer.tar.gz 1230
diff --git a/mail-filter/dspam/files/dspam.cron b/mail-filter/dspam/files/dspam.cron
index 7651c018b7b2..b8e4e69d3f67 100644
--- a/mail-filter/dspam/files/dspam.cron
+++ b/mail-filter/dspam/files/dspam.cron
@@ -1,7 +1,7 @@
#!/bin/bash
# Remove old signatures and unimportant tokens from the DSPAM database
-for foo in awk head tail
+for foo in awk head tail cut sed
do
DSPAM_Check_App="$(${foo} --version 2>&1)"
if [[ "${DSPAM_Check_App/ *}" == "bash:" ]]
@@ -13,12 +13,34 @@ done
DSPAM_HOMEDIR="$(grep ^dspam /etc/passwd|awk -F : '{print $6}')"
[[ ! -d "${DSPAM_HOMEDIR}" ]] && exit 2
+if [ ! -f ${DSPAM_HOMEDIR}/*.data ]
+then
+ if [ -f /etc/mail/dspam/*.data ]
+ then
+ DSPAM_HOMEDIR="/etc/mail/dspam"
+ fi
+fi
if [[ -f "${DSPAM_HOMEDIR}/mysql.data" ]]
then
+ [[ ! -f "/usr/bin/mysql_config" ]] && exit 4
DSPAM_MySQL_PURGE_SQL=""
- [[ -f "${DSPAM_HOMEDIR}/config/mysql_purge.sql" ]] && DSPAM_MySQL_PURGE_SQL="${DSPAM_HOMEDIR}/config/mysql_purge.sql"
- [[ -f "${DSPAM_HOMEDIR}/mysql_purge.sql" ]] && DSPAM_MySQL_PURGE_SQL="${DSPAM_HOMEDIR}/mysql_purge.sql"
+ DSPAM_MySQL_VER="$(mysql_config --version | sed "s:\([^0-9\.]*\)::g")"
+ DSPAM_MySQL_MAJOR="$(echo "${DSPAM_MySQL_VER}" | cut -d. -f1)"
+ DSPAM_MySQL_MINOR="$(echo "${DSPAM_MySQL_VER}" | cut -d. -f2)"
+ DSPAM_MySQL_MICRO="$(echo "${DSPAM_MySQL_VER}" | cut -d. -f3)"
+ DSPAM_MySQL_INT="$((DSPAM_MySQL_MAJOR * 65536 + DSPAM_MySQL_MINOR * 256 + DSPAM_MySQL_MICRO))"
+
+ # For MySQL >= 4.1 use the new purge script
+ if [[ "${DSPAM_MySQL_INT}" -ge "262400" ]]
+ then
+ [[ -f "${DSPAM_HOMEDIR}/config/mysql_purge-4.1.sql" ]] && DSPAM_MySQL_PURGE_SQL="${DSPAM_HOMEDIR}/config/mysql_purge-4.1.sql"
+ [[ -f "${DSPAM_HOMEDIR}/mysql_purge-4.1.sql" ]] && DSPAM_MySQL_PURGE_SQL="${DSPAM_HOMEDIR}/mysql_purge-4.1.sql"
+ else
+ [[ -f "${DSPAM_HOMEDIR}/config/mysql_purge.sql" ]] && DSPAM_MySQL_PURGE_SQL="${DSPAM_HOMEDIR}/config/mysql_purge.sql"
+ [[ -f "${DSPAM_HOMEDIR}/mysql_purge.sql" ]] && DSPAM_MySQL_PURGE_SQL="${DSPAM_HOMEDIR}/mysql_purge.sql"
+ fi
+
[[ "${DSPAM_MySQL_PURGE_SQL}" == "" ]] && exit 3
[[ ! -f "/usr/bin/mysql" ]] && exit 4
DSPAM_MySQL_HOST="$(cat ${DSPAM_HOMEDIR}/mysql.data|head -n 1|tail -n 1)"