aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Shelton <stuart@shelton.me>2013-12-29 21:01:10 +0000
committerStuart Shelton <stuart@shelton.me>2013-12-29 21:01:10 +0000
commitd8b5f8e385aa8b701d33bb0a1877ecc7276b80ac (patch)
treefa73227f2f68b59ca4d13e1bba302349a153b4e2 /mail-filter/spamassassin
parentUpdate mdadm-3.3-r2 (diff)
downloadsrcshelton-d8b5f8e385aa8b701d33bb0a1877ecc7276b80ac.tar.gz
srcshelton-d8b5f8e385aa8b701d33bb0a1877ecc7276b80ac.tar.bz2
srcshelton-d8b5f8e385aa8b701d33bb0a1877ecc7276b80ac.zip
Add ~mail-filter/spamassassin-3.3.2 with state files located within /var/run
Diffstat (limited to 'mail-filter/spamassassin')
-rw-r--r--mail-filter/spamassassin/Manifest14
-rw-r--r--mail-filter/spamassassin/files/3.0.0-spamd.conf46
-rw-r--r--mail-filter/spamassassin/files/3.3.1-spamd.init46
-rw-r--r--mail-filter/spamassassin/files/secrets.cf14
-rw-r--r--mail-filter/spamassassin/files/spamassassin-3.3.2-binary_token.patch13
-rw-r--r--mail-filter/spamassassin/files/spamassassin-3.3.2-innodb.patch114
-rw-r--r--mail-filter/spamassassin/files/spamassassin-3.3.2-mysql_count_rows.patch88
-rw-r--r--mail-filter/spamassassin/files/spamassassin.service14
-rw-r--r--mail-filter/spamassassin/files/spamassassin.service-r114
-rw-r--r--mail-filter/spamassassin/files/spamassassin.service.conf5
-rw-r--r--mail-filter/spamassassin/spamassassin-3.3.2-r1.ebuild218
-rw-r--r--mail-filter/spamassassin/spamassassin-3.3.2-r2.ebuild222
-rw-r--r--mail-filter/spamassassin/spamassassin-3.3.2-r3.ebuild222
-rw-r--r--mail-filter/spamassassin/spamassassin-3.3.2-r4.ebuild223
14 files changed, 1253 insertions, 0 deletions
diff --git a/mail-filter/spamassassin/Manifest b/mail-filter/spamassassin/Manifest
new file mode 100644
index 00000000..f40c5109
--- /dev/null
+++ b/mail-filter/spamassassin/Manifest
@@ -0,0 +1,14 @@
+AUX 3.0.0-spamd.conf 1527 SHA256 ea61041e8b6b1616ec096cc42245ab8442b962f72c318695f5acff1fd794ee34 SHA512 4b820bfa56d565844298be9c9ba888847d7835afb218b7b95317d2fe078407b0776003bacda577e0789344070cfd3e1726115a0945e3c1400626d376197d2055 WHIRLPOOL 97571ccbcffe79e71dba041be6713cc9916240f3ea90807cf112f1c32008ca0e0c6857d13fb90d43672e4f81f0caa343893bcde245b5a7e987d4d2e8c2c6a3ed
+AUX 3.3.1-spamd.init 1080 SHA256 eb5ae5a408404e629c7586d50fd0b04c3572f67235e5cf6829e5d8dbb1816acd SHA512 cf76131482293e7a2c8edcafcaf8bd9117a0f972b70f30a57d18eb6c692e3caea448356bfb50c1e07fe2897e62d39f73fcd89cece994f673c6c7bf073d71c538 WHIRLPOOL c378f6594e45516f91289eec7ed006f20091c571135196ad581baa0866609893b0255b2a46896872ec875f7c661abddf30244ff123b7126cd59046105e4b678e
+AUX secrets.cf 664 SHA256 9f134c7b857b21689f612fc6d131f719e5a65e2ba341b282e7aa57402c854139 SHA512 bb6992098a44e16147be46b75b70e3fb81672285dd71a30719606e2cab556720fc9dd318c7a80832ceaf2e6d9c98c2dd7434f48242feede1922c3e1073559edb WHIRLPOOL 1eccfd765106199312fb23581612b810b92fe8cc3e94b9c4964bcf550ac68bab1e88af07d5324a2be11111cf04f941f4bcfe5482bc71c72ef5ab35be53512ebc
+AUX spamassassin-3.3.2-binary_token.patch 465 SHA256 170ffed8831f7e45d7e50fda774dccd2482f4652c733e419c664d04b3208f37f SHA512 0e101c9792bc1cc6123fa1546e2d412b23bd9811541f18454182871995ad4436916e038be2352774c313e61c6decf99c7b378b3e107dfd05fbeedb75a65ce6ad WHIRLPOOL 88739e51bba39242dfba9adc437a06922f1c9f43e7bc5988c3e6cccc3da937949b634567824587c5c366ff0a4f30b68631f14faf0425f05cd068380d87c83dbc
+AUX spamassassin-3.3.2-innodb.patch 4749 SHA256 d40a72692f9b7161f2a332189e68cfd5486b69a4d2e9fdea9d23d6ae7bd7fd10 SHA512 8d72542f1853eee35a9fb8a3127bd8a3a3aeb2ee0b30e1f15a7c45f7a1d81054c50c57a9b8109c9348dbdbe1a084a0932bc9efa8a5516da92142bd8371ed2ecd WHIRLPOOL 7f58df175bb6cef1d970577960e29077ae2172d74bda30dd7c47283df4e7dfbbe8f44045259531659f2eddc748b3f05853aca5c62f90949c6a22d3287a90495c
+AUX spamassassin-3.3.2-mysql_count_rows.patch 3319 SHA256 a97f6b9b67e721a95885b978c2def9a1065577855ab4377f80fb142fdf6cbba1 SHA512 47a5cb63e87fa2f76267578d1e9bf4b308fe16467bad9fa69894762c78dda9b6441872e4d6226a1d0e2dce205db9a92eb689377de3ec9f2df9da4d725ab7402d WHIRLPOOL 2f59f05fd813d556ad99829f35c48753ae120bc217f74c940599976d57400c41bc1b29e0734e0935e9856aaf6fcb5feadb9d499963d58467bfb37fa3117ee2b8
+AUX spamassassin.service 290 SHA256 c9c9e7aa13a47e05063a9e3b686d5e00fee34dba2983e42c91e48ae4207ba635 SHA512 409a468457f653c3705586262dd46e75bfdb7442a5a0828797c5f37a760740ecb1c19822f7f8d241176e2287b235a670d82e9470a1080c15c89d822aa1cda0e2 WHIRLPOOL 4658469f87868e421336e7a49698ca90a0710205bdd7b26a8af71427483beae7a28e13804cb940da678377f7bd3af4f2ab1c2106116fc1492f8086e69206e8b1
+AUX spamassassin.service-r1 302 SHA256 01d1168ac21a04dc76be7955dbbb4b84d0bc6d3c18d13718312b9414fb67eb5b SHA512 a4507a7c51563fb49e3e008bbfa2dfa15c52feb82af5bab3a029b61666619d10eb9ed566b62b279882481081f8f0e9e5bb8a591cba0328ea2c26090c491b134d WHIRLPOOL 562db1a22ff948f98595145ed397e895c828bfc76de16909077ee4ceab602c9aa572f3c830e5adaad7cf38031b34639e97615c6a6d443fe6d31757ed36a7da26
+AUX spamassassin.service.conf 190 SHA256 4d82b27bba2a44592402e23bcff05ddf40c3bf260616a186ded9d57ff415d97e SHA512 f9bad29c5676ad2a0faece6834fb123ba67906155d9426bc1d9a62bc12ebc77a7d7e94e43e034f9e2ec50fd896a96a15386ded8630521b64a3ee8af6d2954ce7 WHIRLPOOL 51d7faa743daa6d2f42f080416cb277c980bf9bb5c91ef6cc133aa793234ff6b8fb560eba86c8d61ae9bf64ba7bc78aa2506dc6100ce8a0dc5aad70751d7198e
+DIST Mail-SpamAssassin-3.3.2.tar.bz2 1006577 SHA256 c7239b4b4ef04ba5e2d5aedb9156850146ed3fa47c88f0a0757f08e22f93a205 SHA512 3baabfacd2f3ac1debc2bbcdc0b2109ad51f6b176b9a6d037e14999c430150f0922469f777e7d35311ab819eb20905b55c00aa58f1c3c8d5f881d173dd441cbd WHIRLPOOL 5751d7285ffd29c041056f15ff6c85f66ecf6b9e806558623716ad8826124e1f92096f0e8b00016158b4a965927bde7e9e5ed48984ee956906175431e8a45ee5
+EBUILD spamassassin-3.3.2-r1.ebuild 6986 SHA256 8a6e461ef59bc4da883a54cecb57be69797b08f68f35deb61f739e44178e9f47 SHA512 d9c62cedbb9f6194f8ee87ffaadebac0b18ec202f0986cf3d93b8e1e2f4b70f7e5fdfc23eb2fd2e5df8a14a3a86a98167bcc391aef1912882bb6cf4a6ac9856f WHIRLPOOL 6814a5fbd830579a9c88fcaa51e9e57c124fd1436cd3ba2423224930e7c7f07bb2b91ec60e8542958abe2605b92c56d024767633d3c78fac83b3c2d177f7c969
+EBUILD spamassassin-3.3.2-r2.ebuild 7075 SHA256 6472702153d404e839e76554156c2a125f1690c9e95ad73f984a26dfdee6ab6f SHA512 20805f90c79036ff25493cacd44c063512b05d653657e67f2c536c1b0d1024345cdb1f2f75b7d3515c6bf94d62c67b9daf916efb71f9f465345f8a5a89b73ac7 WHIRLPOOL d162639aec9160b0822001e10322d074a554e54db8fe966e4034f0a90eead284ed0b7eadf96458d24ad686a3c6d7b4870d9d36a08061de12b97a58ba64dc1b8a
+EBUILD spamassassin-3.3.2-r3.ebuild 7084 SHA256 d2cb152adfb9717c04ac9fc5e09b159c5effe0ef4432c07cbd33c23ff31a882f SHA512 1d464952443aa171c8145f49defed4e8525a41cf2dd983fd713f52008baf0110352ab4a679e62da900e8bef9fb6413c81f252a6cc3d587ddefa25c008218c3b5 WHIRLPOOL 109c3e1774ea650147dcc61008514da1e6b26d98f78b611b81d64f5ff3a8ad9ce5ae082a069b191b3f097145f8456952dcb41a2cc55c9af0cadc4feeb3cf1c33
+EBUILD spamassassin-3.3.2-r4.ebuild 7160 SHA256 d820aae363c967a02696903c2fe7d17c943afc6c53741be5ace693d5bed2be92 SHA512 9427db39b5b6904061877a477c991f1bf5c30460a7f332dedf1bc318a119826be7677a196fdb24214cd39e56248b6201d3453550f47bb274f5ae9d0adce8fcea WHIRLPOOL 0afe4fbd8ec1f4a8372e3a6dfc96bb77b3f842755ff8d4ce7c5182099cdc1cb83133c168c980cee877ff1795fce1ce3a178e0d141f59d2890b4e8ab27967f91c
diff --git a/mail-filter/spamassassin/files/3.0.0-spamd.conf b/mail-filter/spamassassin/files/3.0.0-spamd.conf
new file mode 100644
index 00000000..b6fca036
--- /dev/null
+++ b/mail-filter/spamassassin/files/3.0.0-spamd.conf
@@ -0,0 +1,46 @@
+# Config file for /etc/init.d/spamd
+
+
+# ***WARNING***
+# spamd was not designed to listed to an untrusted network. spamd
+# is vulnerable to DoS attacks (and eternal doom) if used to listen
+# to an untrusted network.
+#
+
+
+# Some options:
+#
+# -c to create a per user configuration file
+# -H [dir] to switch home dirs for helper apps, dir optional
+# -i [ip] to listen on the specified IP,
+# 127.0.0.1 if omitted,
+# 0.0.0.0 (ie. all) if given without value;
+# must be used in combination with -A to actually allow
+# connections from anybody but localhost
+# -m limit to set the number of children, default 5
+# -u user the user to run spamd as
+# -L if you want to run no net tests
+#
+# for more help look in man spamd
+#
+# Note: if you plan on using the -u flag to spamd you will need to
+# make sure the location of the PID file is writable by that user.
+# This can be done by making the directory /var/run/spamd and
+# changing the owner to the UID that runs spamd. You will then
+# need to edit $pidfile in /etc/init.d/spamd. This should fix the
+# problem with stop/restart in the init scripts.
+#
+# See http://bugs.gentoo.org/show_bug.cgi?id=70124 for a full
+# explanation.
+
+SPAMD_OPTS="-m 5 -c -H"
+
+# spamd stores its pid in this file. If you use the -u option to
+# run spamd under another user, you might need to adjust it.
+
+PIDFILE="/var/run/spamd.pid"
+
+# SPAMD_NICELEVEL lets you set the 'nice'ness of the running
+# spamd process
+
+# SPAMD_NICELEVEL=5
diff --git a/mail-filter/spamassassin/files/3.3.1-spamd.init b/mail-filter/spamassassin/files/3.3.1-spamd.init
new file mode 100644
index 00000000..d8316ce8
--- /dev/null
+++ b/mail-filter/spamassassin/files/3.3.1-spamd.init
@@ -0,0 +1,46 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin/files/3.3.1-spamd.init,v 1.6 2013/10/17 11:44:12 zlogene Exp $
+
+# NB: Config is in /etc/conf.d/spamd
+
+# Provide a default location if they haven't in /etc/conf.d/spamd
+PIDFILE=${PIDFILE:-/var/run/spamd.pid}
+
+extra_started_commands="reload"
+
+depend() {
+ need net
+ before mta
+ use logger
+@USEPOSTGRES@ use postgresql
+@USEMYSQL@ use mysql
+}
+
+start() {
+ ebegin "Starting spamd"
+ start-stop-daemon --start --quiet \
+ --name spamd \
+ --nicelevel ${SPAMD_NICELEVEL:-0} \
+ --pidfile ${PIDFILE} \
+ --exec /usr/sbin/spamd -- -d -r ${PIDFILE} \
+ ${SPAMD_OPTS}
+ retval=$?
+ if ! [ -f "${PIDFILE}" ]; then
+ sleep 1
+ fi
+ eend ${retval} "Failed to start spamd"
+}
+
+stop() {
+ ebegin "Stopping spamd"
+ start-stop-daemon --stop --quiet --pidfile ${PIDFILE}
+ eend $? "Failed to stop spamd"
+}
+
+reload() {
+ ebegin "Reloading configuration"
+ start-stop-daemon --signal HUP --quiet --pidfile ${PIDFILE}
+ eend $?
+}
diff --git a/mail-filter/spamassassin/files/secrets.cf b/mail-filter/spamassassin/files/secrets.cf
new file mode 100644
index 00000000..efa31a6f
--- /dev/null
+++ b/mail-filter/spamassassin/files/secrets.cf
@@ -0,0 +1,14 @@
+# The below sample from bug 91430 is an example of using mysql
+# for spam filter storage
+
+#(Tell Spamassissin to use MySQL for bayes data
+#bayes_store_module Mail::SpamAssassin::BayesStore::SQL
+#bayes_sql_dsn DBI:mysql:sa_bayes:localhost:3306
+#bayes_sql_username db_name
+#bayes_sql_password another_very_secret_password
+
+#(Tell Spamassissin to use MySQL for AWL data
+#auto_whitelist_factory Mail::SpamAssassin::SQLBasedAddrList
+#user_awl_dsn DBI:mysql:sa_bayes:localhost:3306
+#user_awl_sql_username db_name
+#user_awl_sql_password another_very_secret_password
diff --git a/mail-filter/spamassassin/files/spamassassin-3.3.2-binary_token.patch b/mail-filter/spamassassin/files/spamassassin-3.3.2-binary_token.patch
new file mode 100644
index 00000000..5ce5c0d9
--- /dev/null
+++ b/mail-filter/spamassassin/files/spamassassin-3.3.2-binary_token.patch
@@ -0,0 +1,13 @@
+Index: sql/bayes_mysql.sql
+===================================================================
+--- sql/bayes_mysql.sql (revision 1139005)
++++ sql/bayes_mysql.sql (working copy)
+@@ -22,7 +22,7 @@
+
+ CREATE TABLE bayes_token (
+ id int(11) NOT NULL default '0',
+- token char(5) NOT NULL default '',
++ token binary(5) NOT NULL default '',
+ spam_count int(11) NOT NULL default '0',
+ ham_count int(11) NOT NULL default '0',
+ atime int(11) NOT NULL default '0',
diff --git a/mail-filter/spamassassin/files/spamassassin-3.3.2-innodb.patch b/mail-filter/spamassassin/files/spamassassin-3.3.2-innodb.patch
new file mode 100644
index 00000000..8bf13720
--- /dev/null
+++ b/mail-filter/spamassassin/files/spamassassin-3.3.2-innodb.patch
@@ -0,0 +1,114 @@
+Index: sql/README.bayes
+===================================================================
+--- sql/README.bayes (revision 1139008)
++++ sql/README.bayes (working copy)
+@@ -17,27 +17,37 @@
+ bayes_store_module Mail::SpamAssassin::BayesStore::SQL
+
+ This directive is used by the Bayes module to determine which storage
+-module should be used. If not set it will default to:
++module should be used. If not set it will default to:
+ Mail::SpamAssassin::BayesStore::DBM
+
++The storage module Mail::SpamAssassin::BayesStore::SQL is an older generic
++SQL module which can be also be used with versions of MySQL which did not
++have support for an InnoDB engine and transactions. If choosing this module
++consider replacing the InnoDB engine with MyISAM (explicitly or defaulted)
++in the schema (files bayes_mysql.sql and awl_mysql.sql). Note that old
++versions of MySQL expect syntax TYPE=MyISAM instead of ENGINE=MyISAM,
++while newer versions throw a syntax error on TYPE and only allow ENGINE.
++In short: replace ENGINE=InnoDB with TYPE=MyISAM (or just leave it out)
++in the bayes_mysql.sql and awl_mysql.sql schemas if ENGINE=InnoDB is not
++accepted.
++
++There is also a MySQL specific storage driver available to provides a
++small boost in performance. It requires version 4.1 or above of the
++MySQL database software to work properly. In addition, it provides
++rollback on error functionality if you create your bayes database table
++using the InnoDB storage engine. WARNING: Using this module with a version
++of MySQL < 4.1 could have unexpected results. To use the MySQL 4.1+
++specific module set your bayes_store_module directive accordingly:
++ bayes_store_module Mail::SpamAssassin::BayesStore::MySQL
++
+ PostgreSQL users will want to use the PostgreSQL specific storage
+ module:
+-bayes_store_module Mail::SpamAssassin::BayesStore::PgSQL
++ bayes_store_module Mail::SpamAssassin::BayesStore::PgSQL
+ This module provides a slightly different interface to makes better
+ use of the resources that PostgreSQL offers. In addition, please make
+ sure that you follow the instructions below for loading the proper
+ procedural language and installing the tables and stored procedure.
+
+-There is also a MySQL specific storage driver available to provides a
+-small boost in performance. It requires version 4.1 or above of the
+-MySQL database software to work properly. In addition, it provides
+-rollback on error functionality if you create your bayes database
+-table using the InnoDB storage engine (ie s/MyISAM/InnoDB/ on the
+-bayes_mysql.sql file). WARNING: Using this module with a version of
+-MySQL < 4.1 could have unexpected results. To use the MySQL 4.1+
+-specific module set your bayes_store_module directive accordingly:
+-bayes_store_module Mail::SpamAssassin::BayesStore::MySQL
+-
+ Additional configuration directives provided by BayesSQL:
+
+ bayes_sql_dsn DBI:driver:database:hostname[:port]
+Index: sql/awl_mysql.sql
+===================================================================
+--- sql/awl_mysql.sql (revision 1139008)
++++ sql/awl_mysql.sql (working copy)
+@@ -1,9 +1,9 @@
+ CREATE TABLE awl (
+ username varchar(100) NOT NULL default '',
+- email varchar(255) NOT NULL default '',
++ email varbinary(255) NOT NULL default '',
+ ip varchar(40) NOT NULL default '',
+ count int(11) NOT NULL default '0',
+ totscore float NOT NULL default '0',
+ signedby varchar(255) NOT NULL default '',
+ PRIMARY KEY (username,email,signedby,ip)
+-) TYPE=MyISAM;
++) ENGINE=InnoDB;
+Index: sql/bayes_mysql.sql
+===================================================================
+--- sql/bayes_mysql.sql (revision 1139008)
++++ sql/bayes_mysql.sql (working copy)
+@@ -3,13 +3,13 @@
+ id int(11) NOT NULL default '0',
+ runtime int(11) NOT NULL default '0',
+ KEY bayes_expire_idx1 (id)
+-) TYPE=MyISAM;
++) ENGINE=InnoDB;
+
+ CREATE TABLE bayes_global_vars (
+ variable varchar(30) NOT NULL default '',
+ value varchar(200) NOT NULL default '',
+ PRIMARY KEY (variable)
+-) TYPE=MyISAM;
++) ENGINE=InnoDB;
+
+ INSERT INTO bayes_global_vars VALUES ('VERSION','3');
+
+@@ -18,7 +18,7 @@
+ msgid varchar(200) binary NOT NULL default '',
+ flag char(1) NOT NULL default '',
+ PRIMARY KEY (id,msgid)
+-) TYPE=MyISAM;
++) ENGINE=InnoDB;
+
+ CREATE TABLE bayes_token (
+ id int(11) NOT NULL default '0',
+@@ -28,7 +28,7 @@
+ atime int(11) NOT NULL default '0',
+ PRIMARY KEY (id, token),
+ INDEX bayes_token_idx1 (id, atime)
+-) TYPE=MyISAM;
++) ENGINE=InnoDB;
+
+ CREATE TABLE bayes_vars (
+ id int(11) NOT NULL AUTO_INCREMENT,
+@@ -43,4 +43,4 @@
+ newest_token_age int(11) NOT NULL default '0',
+ PRIMARY KEY (id),
+ UNIQUE bayes_vars_idx1 (username)
+-) TYPE=MyISAM;
++) ENGINE=InnoDB;
diff --git a/mail-filter/spamassassin/files/spamassassin-3.3.2-mysql_count_rows.patch b/mail-filter/spamassassin/files/spamassassin-3.3.2-mysql_count_rows.patch
new file mode 100644
index 00000000..54ee5573
--- /dev/null
+++ b/mail-filter/spamassassin/files/spamassassin-3.3.2-mysql_count_rows.patch
@@ -0,0 +1,88 @@
+--- lib/Mail/SpamAssassin/BayesStore/MySQL.pm (revision 1138970)
++++ lib/Mail/SpamAssassin/BayesStore/MySQL.pm (working copy)
+@@ -840,14 +840,28 @@
+ return 0;
+ }
+
++ # With ON DUPLICATE KEY UPDATE, the affected-rows value per row is 1 if
++ # the row is inserted as a new row and 2 if an existing row is updated.
++ #
++ # Due to a MySQL server bug a value of 3 can be seen.
++ # See: http://bugs.mysql.com/bug.php?id=46675
++ # When executing the INSERT ... ON DUPLICATE KEY UPDATE statement
++ # and checking the rows return count:
++ # mysql_client_found_rows = 0: The second INSERT returns a row count
++ # of 2 in all MySQL versions.
++ # mysql_client_found_rows = 1: The second INSERT returns this row count:
++ # Before MySQL 5.1.20: 2
++ # MySQL 5.1.20: undef on Mac OS X, 139775481 on Linux (garbage?)
++ # MySQL 5.1.21 and up: 3
++ #
+ my $num_rows = $rc;
+
+ $sth->finish();
+
+- if ($num_rows == 1 || $num_rows == 2) {
++ if ($num_rows == 1 || $num_rows == 2 || $num_rows == 3) {
+ my $token_count_update = '';
+
+- $token_count_update = "token_count = token_count + 1," if ($num_rows == 1);
++ $token_count_update = "token_count = token_count + 1," if $num_rows == 1;
+ $sql = "UPDATE bayes_vars SET
+ $token_count_update
+ newest_token_age = GREATEST(newest_token_age, ?),
+@@ -872,7 +886,11 @@
+ }
+ else {
+ # $num_rows was not what we expected
+- dbg("bayes: _put_token: Updated an unexpected number of rows.");
++ my $token_displ = $token;
++ $token_displ =~ s/(.)/sprintf('%02x',ord($1))/egs;
++ dbg("bayes: _put_token: Updated an unexpected number of rows: %s, ".
++ "id: %s, token (hex): %s",
++ $num_rows, $self->{_userid}, $token_displ);
+ $self->{_dbh}->rollback();
+ return 0;
+ }
+@@ -987,8 +1005,24 @@
+ else {
+ my $num_rows = $rc;
+
+- $need_atime_update_p = 1 if ($num_rows == 1 || $num_rows == 2);
+- $new_tokens++ if ($num_rows == 1);
++ # With ON DUPLICATE KEY UPDATE, the affected-rows value per row is 1 if
++ # the row is inserted as a new row and 2 if an existing row is updated.
++ # But see MySQL bug (as above): http://bugs.mysql.com/bug.php?id=46675
++
++ if ($num_rows == 1) {
++ $new_tokens++;
++ $need_atime_update_p = 1;
++ } elsif ($num_rows == 2 || $num_rows == 3) {
++ $need_atime_update_p = 1;
++ } else {
++ # $num_rows was not what we expected
++ my $token_displ = $token;
++ $token_displ =~ s/(.)/sprintf('%02x',ord($1))/egs;
++ dbg("bayes: _put_tokens: Updated an unexpected number of rows: %s, ".
++ "id: %s, token (hex): %s",
++ $num_rows, $self->{_userid}, $token_displ);
++ $error_p = 1;
++ }
+ }
+ }
+
+@@ -1026,10 +1060,10 @@
+ }
+ }
+ else {
+- # $num_rows was not what we expected
+- dbg("bayes: _put_tokens: Updated an unexpected number of rows.");
+- $self->{_dbh}->rollback();
+- return 0;
++ info("bayes: _put_tokens: no atime updates needed? Num of tokens: %d",
++ scalar keys %{$tokens});
++# $self->{_dbh}->rollback();
++# return 0;
+ }
+ }
+
diff --git a/mail-filter/spamassassin/files/spamassassin.service b/mail-filter/spamassassin/files/spamassassin.service
new file mode 100644
index 00000000..5c9e9edc
--- /dev/null
+++ b/mail-filter/spamassassin/files/spamassassin.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Spamassassin daemon
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/spamd.pid
+ExecStart=/usr/sbin/spamd -d --pidfile /var/run/spamd.pid -m 5 -c -H
+StandardOutput=syslog
+StandardError=syslog
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/mail-filter/spamassassin/files/spamassassin.service-r1 b/mail-filter/spamassassin/files/spamassassin.service-r1
new file mode 100644
index 00000000..17817f4b
--- /dev/null
+++ b/mail-filter/spamassassin/files/spamassassin.service-r1
@@ -0,0 +1,14 @@
+[Unit]
+Description=Spamassassin daemon
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/spamd.pid
+ExecStart=/usr/sbin/spamd -d --pidfile /var/run/spamd.pid -m 5 -c -H $SPAMD_OPTS
+StandardOutput=syslog
+StandardError=syslog
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/mail-filter/spamassassin/files/spamassassin.service.conf b/mail-filter/spamassassin/files/spamassassin.service.conf
new file mode 100644
index 00000000..c8dc2fe5
--- /dev/null
+++ b/mail-filter/spamassassin/files/spamassassin.service.conf
@@ -0,0 +1,5 @@
+# Here you can append some options to spamd process, please
+# double check that you make needed changes in service file if
+# you use options requiring it
+[Service]
+Environment="SPAMD_OPTS="
diff --git a/mail-filter/spamassassin/spamassassin-3.3.2-r1.ebuild b/mail-filter/spamassassin/spamassassin-3.3.2-r1.ebuild
new file mode 100644
index 00000000..973ef577
--- /dev/null
+++ b/mail-filter/spamassassin/spamassassin-3.3.2-r1.ebuild
@@ -0,0 +1,218 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin/spamassassin-3.3.2-r1.ebuild,v 1.13 2013/09/29 07:11:47 zlogene Exp $
+
+EAPI=4
+
+inherit perl-module toolchain-funcs eutils
+
+MY_P=Mail-SpamAssassin-${PV//_/-}
+S=${WORKDIR}/${MY_P}
+DESCRIPTION="SpamAssassin is an extensible email filter which is used to identify spam"
+HOMEPAGE="http://spamassassin.apache.org/"
+SRC_URI="mirror://apache/spamassassin/source/${MY_P}.tar.bz2"
+
+LICENSE="Apache-2.0 GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
+# need keyword request for Mail-SPF ppc ppc64
+IUSE="berkdb qmail ssl doc ldap mysql postgres sqlite ipv6"
+
+DEPEND=">=dev-lang/perl-5.8.8-r8
+ virtual/perl-MIME-Base64
+ >=virtual/perl-PodParser-1.32
+ virtual/perl-Storable
+ virtual/perl-Time-HiRes
+ >=dev-perl/HTML-Parser-3.43
+ >=dev-perl/Mail-DKIM-0.37
+ >=dev-perl/Net-DNS-0.53
+ dev-perl/Digest-SHA1
+ dev-perl/libwww-perl
+ >=virtual/perl-Archive-Tar-1.26
+ app-crypt/gnupg
+ >=virtual/perl-IO-Zlib-1.04
+ >=dev-util/re2c-0.12.0
+ dev-perl/Mail-SPF
+ dev-perl/NetAddr-IP
+ ssl? (
+ dev-perl/IO-Socket-SSL
+ dev-libs/openssl
+ )
+ berkdb? (
+ virtual/perl-DB_File
+ )
+ ldap? ( dev-perl/perl-ldap )
+ mysql? (
+ dev-perl/DBI
+ dev-perl/DBD-mysql
+ )
+ postgres? (
+ dev-perl/DBI
+ dev-perl/DBD-Pg
+ )
+ sqlite? (
+ dev-perl/DBI
+ dev-perl/DBD-SQLite
+ )
+ ipv6? (
+ dev-perl/IO-Socket-INET6
+ )"
+RDEPEND="${DEPEND}"
+
+SRC_TEST="do"
+
+src_prepare() {
+ # http://old.nabble.com/Migrating-bayes-to-mysql-fails-with-parsing-errors-td31889789i20.html
+
+ # https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6624
+ epatch "${FILESDIR}/${P}-mysql_count_rows.patch"
+
+ #https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6625
+ epatch "${FILESDIR}/${P}-binary_token.patch"
+
+ # https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6626
+ epatch "${FILESDIR}/${P}-innodb.patch"
+}
+
+src_configure() {
+ # - Set SYSCONFDIR explicitly so we can't get bitten by bug 48205 again
+ # (just to be sure, nobody knows how it could happen in the first place).
+ myconf="SYSCONFDIR=${EPREFIX}/etc DATADIR=${EPREFIX}/usr/share/spamassassin"
+
+ # If ssl is enabled, spamc can be built with ssl support
+ if use ssl; then
+ myconf+=" ENABLE_SSL=yes"
+ else
+ myconf+=" ENABLE_SSL=no"
+ fi
+
+ # Set the path to the Perl executable explictly. This will be used to
+ # create the initial sharpbang line in the scripts and might cause
+ # a versioned app name end in there, see
+ # <http://bugs.gentoo.org/show_bug.cgi?id=62276>
+ myconf+=" PERL_BIN=${EPREFIX}/usr/bin/perl"
+
+ # Add Gentoo tag to make it easy for the upstream devs to spot
+ # possible modifications or patches.
+ #version_tag="g${PV:6}${PR}"
+ #version_str="${PV//_/-}-${version_tag}"
+
+ # Create the Gentoo config file before Makefile.PL is called so it
+ # is copied later on.
+ #echo "version_tag ${version_tag}" > rules/11_gentoo.cf
+
+ # Setting the following env var ensures that no questions are asked.
+ perl-module_src_configure
+ # Configure spamc
+ emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}" spamc/Makefile
+}
+
+src_compile() {
+ export PERL_MM_USE_DEFAULT=1
+
+ # Now compile all the stuff selected.
+ perl-module_src_compile
+
+ if use qmail; then
+ emake spamc/qmail-spamc
+ fi
+
+}
+
+src_install () {
+ perl-module_src_install
+
+ # Create the stub dir used by sa-update and friends
+ dodir /var/lib/spamassassin
+
+ # Move spamd to sbin where it belongs.
+ dodir /usr/sbin
+ mv "${ED}"/usr/bin/spamd "${ED}"/usr/sbin/spamd || die "move spamd failed"
+
+ if use qmail; then
+ dobin spamc/qmail-spamc
+ fi
+
+ ln -s mail/spamassassin "${ED}"/etc/spamassassin || die
+
+ # Disable plugin by default
+ sed -i -e 's/^loadplugin/\#loadplugin/g' "${ED}"/etc/mail/spamassassin/init.pre || die
+
+ # Add the init and config scripts.
+ newinitd "${FILESDIR}"/3.3.1-spamd.init spamd
+ newconfd "${FILESDIR}"/3.0.0-spamd.conf spamd
+
+ if use postgres; then
+ sed -i -e 's:@USEPOSTGRES@::' "${ED}/etc/init.d/spamd"
+
+ dodoc sql/*_pg.sql
+ else
+ sed -i -e '/@USEPOSTGRES@/d' "${ED}/etc/init.d/spamd"
+ fi
+
+ if use mysql; then
+ sed -i -e 's:@USEMYSQL@::' "${ED}/etc/init.d/spamd"
+
+ dodoc sql/*_mysql.sql
+ else
+ sed -i -e '/@USEMYSQL@/d' "${ED}/etc/init.d/spamd"
+ fi
+
+ dodoc NOTICE TRADEMARK CREDITS INSTALL.VMS UPGRADE USAGE \
+ sql/README.bayes sql/README.awl procmailrc.example sample-nonspam.txt \
+ sample-spam.txt spamd/PROTOCOL spamd/README.vpopmail \
+ spamd-apache2/README.apache
+
+ # Rename some docu files so they don't clash with others
+ newdoc spamd/README README.spamd
+ newdoc sql/README README.sql
+ newdoc ldap/README README.ldap
+
+ if use qmail; then
+ dodoc spamc/README.qmail
+ fi
+
+ cp "${FILESDIR}"/secrets.cf "${ED}"/etc/mail/spamassassin/secrets.cf.example || die
+ fperms 0400 /etc/mail/spamassassin/secrets.cf.example
+
+ cat <<-EOF > "${T}/local.cf.example"
+ # Sensitive data, such as database connection info, should be stored in
+ # /etc/mail/spamassassin/secrets.cf with appropriate permissions
+EOF
+
+ insinto /etc/mail/spamassassin/
+ doins "${T}/local.cf.example"
+}
+
+pkg_postinst() {
+ perl-module_pkg_postinst
+ elog "If you plan on using the -u flag to spamd, please read the notes"
+ elog "in /etc/conf.d/spamd regarding the location of the pid file.\n"
+ elog "If you build ${PN} with optional dependancy support,"
+ elog "you can enable them in /etc/mail/spamassassin/init.pre\n"
+ elog "You need to configure your database to be able to use Bayes filter"
+ elog "with database backend, otherwise it will still use (and need) the"
+ elog "Berkeley DB support."
+ elog "Look at the sql/README.bayes file in the documentation directory"
+ elog "for how to configure it.\n"
+ elog "If you plan to use Vipul's Razor, note that versions up to and"
+ elog "including version 2.82 include a bug that will slow down the entire"
+ elog "perl interpreter. Version 2.83 or later fixes this."
+ elog "If you do not plan to use this plugin, be sure to comment out"
+ elog "its loadplugin line in /etc/mail/spamassassin/v310.pre.\n"
+ elog "The DKIM plugin is now enabled by default for new installs,"
+ elog "if the perl module Mail::DKIM is installed."
+ elog "However, installation of SpamAssassin will not overwrite existing"
+ elog ".pre configuration files, so to use DKIM when upgrading from a"
+ elog "previous release that did not use DKIM, a directive:\n"
+ elog "loadplugin Mail::SpamAssassin::Plugin::DKIM"
+ elog "will need to be uncommented in file 'v312.pre', or added"
+ elog "to some other .pre file, such as local.pre.\n"
+ ewarn "Rules are no longer included with SpamAssassin out of the box".
+ ewarn "You will need to immediately run sa-update, or download"
+ ewarn "the additional rules .tgz package and run sa-update --install"
+ ewarn "with it, to get a ruleset.\n"
+ elog "If when you run sa-update and receive a GPG validation error."
+ elog "Then you need to import an updated sa-update key."
+ elog "sa-update --import /usr/share/spamassassin/sa-update-pubkey.txt\n"
+}
diff --git a/mail-filter/spamassassin/spamassassin-3.3.2-r2.ebuild b/mail-filter/spamassassin/spamassassin-3.3.2-r2.ebuild
new file mode 100644
index 00000000..9eec294a
--- /dev/null
+++ b/mail-filter/spamassassin/spamassassin-3.3.2-r2.ebuild
@@ -0,0 +1,222 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin/spamassassin-3.3.2-r2.ebuild,v 1.9 2013/12/21 18:00:47 zlogene Exp $
+
+EAPI=4
+
+inherit perl-module toolchain-funcs eutils systemd
+
+MY_P=Mail-SpamAssassin-${PV//_/-}
+S=${WORKDIR}/${MY_P}
+DESCRIPTION="SpamAssassin is an extensible email filter which is used to identify spam"
+HOMEPAGE="http://spamassassin.apache.org/"
+SRC_URI="mirror://apache/spamassassin/source/${MY_P}.tar.bz2"
+
+LICENSE="Apache-2.0 GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
+# need keyword request for Mail-SPF ppc ppc64
+IUSE="berkdb doc ipv6 ldap mysql postgres qmail sqlite ssl systemd"
+
+DEPEND=">=dev-lang/perl-5.8.8-r8
+ virtual/perl-MIME-Base64
+ >=virtual/perl-PodParser-1.32
+ virtual/perl-Storable
+ virtual/perl-Time-HiRes
+ >=dev-perl/HTML-Parser-3.43
+ >=dev-perl/Mail-DKIM-0.37
+ >=dev-perl/Net-DNS-0.53
+ dev-perl/Digest-SHA1
+ dev-perl/libwww-perl
+ >=virtual/perl-Archive-Tar-1.26
+ app-crypt/gnupg
+ >=virtual/perl-IO-Zlib-1.04
+ >=dev-util/re2c-0.12.0
+ dev-perl/Mail-SPF
+ dev-perl/NetAddr-IP
+ ssl? (
+ dev-perl/IO-Socket-SSL
+ dev-libs/openssl
+ )
+ berkdb? (
+ virtual/perl-DB_File
+ )
+ ldap? ( dev-perl/perl-ldap )
+ mysql? (
+ dev-perl/DBI
+ dev-perl/DBD-mysql
+ )
+ postgres? (
+ dev-perl/DBI
+ dev-perl/DBD-Pg
+ )
+ sqlite? (
+ dev-perl/DBI
+ dev-perl/DBD-SQLite
+ )
+ ipv6? (
+ dev-perl/IO-Socket-INET6
+ )"
+RDEPEND="${DEPEND}"
+
+SRC_TEST="do"
+
+src_prepare() {
+ # http://old.nabble.com/Migrating-bayes-to-mysql-fails-with-parsing-errors-td31889789i20.html
+
+ # https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6624
+ epatch "${FILESDIR}/${P}-mysql_count_rows.patch"
+
+ #https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6625
+ epatch "${FILESDIR}/${P}-binary_token.patch"
+
+ # https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6626
+ epatch "${FILESDIR}/${P}-innodb.patch"
+}
+
+src_configure() {
+ # - Set SYSCONFDIR explicitly so we can't get bitten by bug 48205 again
+ # (just to be sure, nobody knows how it could happen in the first place).
+ myconf="SYSCONFDIR=${EPREFIX}/etc DATADIR=${EPREFIX}/usr/share/spamassassin"
+
+ # If ssl is enabled, spamc can be built with ssl support
+ if use ssl; then
+ myconf+=" ENABLE_SSL=yes"
+ else
+ myconf+=" ENABLE_SSL=no"
+ fi
+
+ # Set the path to the Perl executable explictly. This will be used to
+ # create the initial sharpbang line in the scripts and might cause
+ # a versioned app name end in there, see
+ # <http://bugs.gentoo.org/show_bug.cgi?id=62276>
+ myconf+=" PERL_BIN=${EPREFIX}/usr/bin/perl"
+
+ # Add Gentoo tag to make it easy for the upstream devs to spot
+ # possible modifications or patches.
+ #version_tag="g${PV:6}${PR}"
+ #version_str="${PV//_/-}-${version_tag}"
+
+ # Create the Gentoo config file before Makefile.PL is called so it
+ # is copied later on.
+ #echo "version_tag ${version_tag}" > rules/11_gentoo.cf
+
+ # Setting the following env var ensures that no questions are asked.
+ perl-module_src_configure
+ # Configure spamc
+ emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}" spamc/Makefile
+}
+
+src_compile() {
+ export PERL_MM_USE_DEFAULT=1
+
+ # Now compile all the stuff selected.
+ perl-module_src_compile
+
+ if use qmail; then
+ emake spamc/qmail-spamc
+ fi
+
+}
+
+src_install () {
+ perl-module_src_install
+
+ # Create the stub dir used by sa-update and friends
+ keepdir /var/lib/spamassassin
+
+ # Move spamd to sbin where it belongs.
+ dodir /usr/sbin
+ mv "${ED}"/usr/bin/spamd "${ED}"/usr/sbin/spamd || die "move spamd failed"
+
+ if use qmail; then
+ dobin spamc/qmail-spamc
+ fi
+
+ ln -s mail/spamassassin "${ED}"/etc/spamassassin || die
+
+ # Disable plugin by default
+ sed -i -e 's/^loadplugin/\#loadplugin/g' "${ED}"/etc/mail/spamassassin/init.pre || die
+
+ # Add the init and config scripts.
+ newinitd "${FILESDIR}"/3.3.1-spamd.init spamd
+ newconfd "${FILESDIR}"/3.0.0-spamd.conf spamd
+
+ if use systemd; then
+ systemd_dounit "${FILESDIR}"/${PN}.service
+ fi
+
+ if use postgres; then
+ sed -i -e 's:@USEPOSTGRES@::' "${ED}/etc/init.d/spamd"
+
+ dodoc sql/*_pg.sql
+ else
+ sed -i -e '/@USEPOSTGRES@/d' "${ED}/etc/init.d/spamd"
+ fi
+
+ if use mysql; then
+ sed -i -e 's:@USEMYSQL@::' "${ED}/etc/init.d/spamd"
+
+ dodoc sql/*_mysql.sql
+ else
+ sed -i -e '/@USEMYSQL@/d' "${ED}/etc/init.d/spamd"
+ fi
+
+ dodoc NOTICE TRADEMARK CREDITS INSTALL.VMS UPGRADE USAGE \
+ sql/README.bayes sql/README.awl procmailrc.example sample-nonspam.txt \
+ sample-spam.txt spamd/PROTOCOL spamd/README.vpopmail \
+ spamd-apache2/README.apache
+
+ # Rename some docu files so they don't clash with others
+ newdoc spamd/README README.spamd
+ newdoc sql/README README.sql
+ newdoc ldap/README README.ldap
+
+ if use qmail; then
+ dodoc spamc/README.qmail
+ fi
+
+ cp "${FILESDIR}"/secrets.cf "${ED}"/etc/mail/spamassassin/secrets.cf.example || die
+ fperms 0400 /etc/mail/spamassassin/secrets.cf.example
+
+ cat <<-EOF > "${T}/local.cf.example"
+ # Sensitive data, such as database connection info, should be stored in
+ # /etc/mail/spamassassin/secrets.cf with appropriate permissions
+EOF
+
+ insinto /etc/mail/spamassassin/
+ doins "${T}/local.cf.example"
+}
+
+pkg_postinst() {
+ perl-module_pkg_postinst
+ elog "If you plan on using the -u flag to spamd, please read the notes"
+ elog "in /etc/conf.d/spamd regarding the location of the pid file.\n"
+ elog "If you build ${PN} with optional dependancy support,"
+ elog "you can enable them in /etc/mail/spamassassin/init.pre\n"
+ elog "You need to configure your database to be able to use Bayes filter"
+ elog "with database backend, otherwise it will still use (and need) the"
+ elog "Berkeley DB support."
+ elog "Look at the sql/README.bayes file in the documentation directory"
+ elog "for how to configure it.\n"
+ elog "If you plan to use Vipul's Razor, note that versions up to and"
+ elog "including version 2.82 include a bug that will slow down the entire"
+ elog "perl interpreter. Version 2.83 or later fixes this."
+ elog "If you do not plan to use this plugin, be sure to comment out"
+ elog "its loadplugin line in /etc/mail/spamassassin/v310.pre.\n"
+ elog "The DKIM plugin is now enabled by default for new installs,"
+ elog "if the perl module Mail::DKIM is installed."
+ elog "However, installation of SpamAssassin will not overwrite existing"
+ elog ".pre configuration files, so to use DKIM when upgrading from a"
+ elog "previous release that did not use DKIM, a directive:\n"
+ elog "loadplugin Mail::SpamAssassin::Plugin::DKIM"
+ elog "will need to be uncommented in file 'v312.pre', or added"
+ elog "to some other .pre file, such as local.pre.\n"
+ ewarn "Rules are no longer included with SpamAssassin out of the box".
+ ewarn "You will need to immediately run sa-update, or download"
+ ewarn "the additional rules .tgz package and run sa-update --install"
+ ewarn "with it, to get a ruleset.\n"
+ elog "If when you run sa-update and receive a GPG validation error."
+ elog "Then you need to import an updated sa-update key."
+ elog "sa-update --import /usr/share/spamassassin/sa-update-pubkey.txt\n"
+}
diff --git a/mail-filter/spamassassin/spamassassin-3.3.2-r3.ebuild b/mail-filter/spamassassin/spamassassin-3.3.2-r3.ebuild
new file mode 100644
index 00000000..a8091c90
--- /dev/null
+++ b/mail-filter/spamassassin/spamassassin-3.3.2-r3.ebuild
@@ -0,0 +1,222 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin/spamassassin-3.3.2-r3.ebuild,v 1.1 2013/10/17 11:44:13 zlogene Exp $
+
+EAPI=4
+
+inherit perl-module toolchain-funcs eutils systemd
+
+MY_P=Mail-SpamAssassin-${PV//_/-}
+S=${WORKDIR}/${MY_P}
+DESCRIPTION="SpamAssassin is an extensible email filter which is used to identify spam"
+HOMEPAGE="http://spamassassin.apache.org/"
+SRC_URI="mirror://apache/spamassassin/source/${MY_P}.tar.bz2"
+
+LICENSE="Apache-2.0 GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
+# need keyword request for Mail-SPF ppc ppc64
+IUSE="berkdb doc ipv6 ldap mysql postgres qmail sqlite ssl systemd"
+
+DEPEND=">=dev-lang/perl-5.8.8-r8
+ virtual/perl-MIME-Base64
+ >=virtual/perl-PodParser-1.32
+ virtual/perl-Storable
+ virtual/perl-Time-HiRes
+ >=dev-perl/HTML-Parser-3.43
+ >=dev-perl/Mail-DKIM-0.37
+ >=dev-perl/Net-DNS-0.53
+ dev-perl/Digest-SHA1
+ dev-perl/libwww-perl
+ >=virtual/perl-Archive-Tar-1.26
+ app-crypt/gnupg
+ >=virtual/perl-IO-Zlib-1.04
+ >=dev-util/re2c-0.12.0
+ dev-perl/Mail-SPF
+ dev-perl/NetAddr-IP
+ ssl? (
+ dev-perl/IO-Socket-SSL
+ dev-libs/openssl
+ )
+ berkdb? (
+ virtual/perl-DB_File
+ )
+ ldap? ( dev-perl/perl-ldap )
+ mysql? (
+ dev-perl/DBI
+ dev-perl/DBD-mysql
+ )
+ postgres? (
+ dev-perl/DBI
+ dev-perl/DBD-Pg
+ )
+ sqlite? (
+ dev-perl/DBI
+ dev-perl/DBD-SQLite
+ )
+ ipv6? (
+ dev-perl/IO-Socket-INET6
+ )"
+RDEPEND="${DEPEND}"
+
+SRC_TEST="do"
+
+src_prepare() {
+ # http://old.nabble.com/Migrating-bayes-to-mysql-fails-with-parsing-errors-td31889789i20.html
+
+ # https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6624
+ epatch "${FILESDIR}/${P}-mysql_count_rows.patch"
+
+ #https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6625
+ epatch "${FILESDIR}/${P}-binary_token.patch"
+
+ # https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6626
+ epatch "${FILESDIR}/${P}-innodb.patch"
+}
+
+src_configure() {
+ # - Set SYSCONFDIR explicitly so we can't get bitten by bug 48205 again
+ # (just to be sure, nobody knows how it could happen in the first place).
+ myconf="SYSCONFDIR=${EPREFIX}/etc DATADIR=${EPREFIX}/usr/share/spamassassin"
+
+ # If ssl is enabled, spamc can be built with ssl support
+ if use ssl; then
+ myconf+=" ENABLE_SSL=yes"
+ else
+ myconf+=" ENABLE_SSL=no"
+ fi
+
+ # Set the path to the Perl executable explictly. This will be used to
+ # create the initial sharpbang line in the scripts and might cause
+ # a versioned app name end in there, see
+ # <http://bugs.gentoo.org/show_bug.cgi?id=62276>
+ myconf+=" PERL_BIN=${EPREFIX}/usr/bin/perl"
+
+ # Add Gentoo tag to make it easy for the upstream devs to spot
+ # possible modifications or patches.
+ #version_tag="g${PV:6}${PR}"
+ #version_str="${PV//_/-}-${version_tag}"
+
+ # Create the Gentoo config file before Makefile.PL is called so it
+ # is copied later on.
+ #echo "version_tag ${version_tag}" > rules/11_gentoo.cf
+
+ # Setting the following env var ensures that no questions are asked.
+ perl-module_src_configure
+ # Configure spamc
+ emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}" spamc/Makefile
+}
+
+src_compile() {
+ export PERL_MM_USE_DEFAULT=1
+
+ # Now compile all the stuff selected.
+ perl-module_src_compile
+
+ if use qmail; then
+ emake spamc/qmail-spamc
+ fi
+
+}
+
+src_install () {
+ perl-module_src_install
+
+ # Create the stub dir used by sa-update and friends
+ keepdir /var/lib/spamassassin
+
+ # Move spamd to sbin where it belongs.
+ dodir /usr/sbin
+ mv "${ED}"/usr/bin/spamd "${ED}"/usr/sbin/spamd || die "move spamd failed"
+
+ if use qmail; then
+ dobin spamc/qmail-spamc
+ fi
+
+ ln -s mail/spamassassin "${ED}"/etc/spamassassin || die
+
+ # Disable plugin by default
+ sed -i -e 's/^loadplugin/\#loadplugin/g' "${ED}"/etc/mail/spamassassin/init.pre || die
+
+ # Add the init and config scripts.
+ newinitd "${FILESDIR}"/3.3.1-spamd.init spamd
+ newconfd "${FILESDIR}"/3.0.0-spamd.conf spamd
+
+ if use systemd; then
+ systemd_dounit "${FILESDIR}"/${PN}.service
+ fi
+
+ if use postgres; then
+ sed -i -e 's:@USEPOSTGRES@::' "${ED}/etc/init.d/spamd"
+
+ dodoc sql/*_pg.sql
+ else
+ sed -i -e '/@USEPOSTGRES@/d' "${ED}/etc/init.d/spamd"
+ fi
+
+ if use mysql; then
+ sed -i -e 's:@USEMYSQL@::' "${ED}/etc/init.d/spamd"
+
+ dodoc sql/*_mysql.sql
+ else
+ sed -i -e '/@USEMYSQL@/d' "${ED}/etc/init.d/spamd"
+ fi
+
+ dodoc NOTICE TRADEMARK CREDITS INSTALL.VMS UPGRADE USAGE \
+ sql/README.bayes sql/README.awl procmailrc.example sample-nonspam.txt \
+ sample-spam.txt spamd/PROTOCOL spamd/README.vpopmail \
+ spamd-apache2/README.apache
+
+ # Rename some docu files so they don't clash with others
+ newdoc spamd/README README.spamd
+ newdoc sql/README README.sql
+ newdoc ldap/README README.ldap
+
+ if use qmail; then
+ dodoc spamc/README.qmail
+ fi
+
+ cp "${FILESDIR}"/secrets.cf "${ED}"/etc/mail/spamassassin/secrets.cf.example || die
+ fperms 0400 /etc/mail/spamassassin/secrets.cf.example
+
+ cat <<-EOF > "${T}/local.cf.example"
+ # Sensitive data, such as database connection info, should be stored in
+ # /etc/mail/spamassassin/secrets.cf with appropriate permissions
+EOF
+
+ insinto /etc/mail/spamassassin/
+ doins "${T}/local.cf.example"
+}
+
+pkg_postinst() {
+ perl-module_pkg_postinst
+ elog "If you plan on using the -u flag to spamd, please read the notes"
+ elog "in /etc/conf.d/spamd regarding the location of the pid file.\n"
+ elog "If you build ${PN} with optional dependancy support,"
+ elog "you can enable them in /etc/mail/spamassassin/init.pre\n"
+ elog "You need to configure your database to be able to use Bayes filter"
+ elog "with database backend, otherwise it will still use (and need) the"
+ elog "Berkeley DB support."
+ elog "Look at the sql/README.bayes file in the documentation directory"
+ elog "for how to configure it.\n"
+ elog "If you plan to use Vipul's Razor, note that versions up to and"
+ elog "including version 2.82 include a bug that will slow down the entire"
+ elog "perl interpreter. Version 2.83 or later fixes this."
+ elog "If you do not plan to use this plugin, be sure to comment out"
+ elog "its loadplugin line in /etc/mail/spamassassin/v310.pre.\n"
+ elog "The DKIM plugin is now enabled by default for new installs,"
+ elog "if the perl module Mail::DKIM is installed."
+ elog "However, installation of SpamAssassin will not overwrite existing"
+ elog ".pre configuration files, so to use DKIM when upgrading from a"
+ elog "previous release that did not use DKIM, a directive:\n"
+ elog "loadplugin Mail::SpamAssassin::Plugin::DKIM"
+ elog "will need to be uncommented in file 'v312.pre', or added"
+ elog "to some other .pre file, such as local.pre.\n"
+ ewarn "Rules are no longer included with SpamAssassin out of the box".
+ ewarn "You will need to immediately run sa-update, or download"
+ ewarn "the additional rules .tgz package and run sa-update --install"
+ ewarn "with it, to get a ruleset.\n"
+ elog "If when you run sa-update and receive a GPG validation error."
+ elog "Then you need to import an updated sa-update key."
+ elog "sa-update --import /usr/share/spamassassin/sa-update-pubkey.txt\n"
+}
diff --git a/mail-filter/spamassassin/spamassassin-3.3.2-r4.ebuild b/mail-filter/spamassassin/spamassassin-3.3.2-r4.ebuild
new file mode 100644
index 00000000..50782fef
--- /dev/null
+++ b/mail-filter/spamassassin/spamassassin-3.3.2-r4.ebuild
@@ -0,0 +1,223 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin/spamassassin-3.3.2-r4.ebuild,v 1.1 2013/12/28 13:56:06 pacho Exp $
+
+EAPI=4
+
+inherit perl-module toolchain-funcs eutils systemd
+
+MY_P=Mail-SpamAssassin-${PV//_/-}
+S=${WORKDIR}/${MY_P}
+DESCRIPTION="SpamAssassin is an extensible email filter which is used to identify spam"
+HOMEPAGE="http://spamassassin.apache.org/"
+SRC_URI="mirror://apache/spamassassin/source/${MY_P}.tar.bz2"
+
+LICENSE="Apache-2.0 GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
+# need keyword request for Mail-SPF ppc ppc64
+IUSE="berkdb doc ipv6 ldap mysql postgres qmail sqlite ssl systemd"
+
+DEPEND=">=dev-lang/perl-5.8.8-r8
+ virtual/perl-MIME-Base64
+ >=virtual/perl-PodParser-1.32
+ virtual/perl-Storable
+ virtual/perl-Time-HiRes
+ >=dev-perl/HTML-Parser-3.43
+ >=dev-perl/Mail-DKIM-0.37
+ >=dev-perl/Net-DNS-0.53
+ dev-perl/Digest-SHA1
+ dev-perl/libwww-perl
+ >=virtual/perl-Archive-Tar-1.26
+ app-crypt/gnupg
+ >=virtual/perl-IO-Zlib-1.04
+ >=dev-util/re2c-0.12.0
+ dev-perl/Mail-SPF
+ dev-perl/NetAddr-IP
+ ssl? (
+ dev-perl/IO-Socket-SSL
+ dev-libs/openssl
+ )
+ berkdb? (
+ virtual/perl-DB_File
+ )
+ ldap? ( dev-perl/perl-ldap )
+ mysql? (
+ dev-perl/DBI
+ dev-perl/DBD-mysql
+ )
+ postgres? (
+ dev-perl/DBI
+ dev-perl/DBD-Pg
+ )
+ sqlite? (
+ dev-perl/DBI
+ dev-perl/DBD-SQLite
+ )
+ ipv6? (
+ dev-perl/IO-Socket-INET6
+ )"
+RDEPEND="${DEPEND}"
+
+SRC_TEST="do"
+
+src_prepare() {
+ # http://old.nabble.com/Migrating-bayes-to-mysql-fails-with-parsing-errors-td31889789i20.html
+
+ # https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6624
+ epatch "${FILESDIR}/${P}-mysql_count_rows.patch"
+
+ #https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6625
+ epatch "${FILESDIR}/${P}-binary_token.patch"
+
+ # https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6626
+ epatch "${FILESDIR}/${P}-innodb.patch"
+}
+
+src_configure() {
+ # - Set SYSCONFDIR explicitly so we can't get bitten by bug 48205 again
+ # (just to be sure, nobody knows how it could happen in the first place).
+ myconf="SYSCONFDIR=${EPREFIX}/etc DATADIR=${EPREFIX}/usr/share/spamassassin"
+
+ # If ssl is enabled, spamc can be built with ssl support
+ if use ssl; then
+ myconf+=" ENABLE_SSL=yes"
+ else
+ myconf+=" ENABLE_SSL=no"
+ fi
+
+ # Set the path to the Perl executable explictly. This will be used to
+ # create the initial sharpbang line in the scripts and might cause
+ # a versioned app name end in there, see
+ # <http://bugs.gentoo.org/show_bug.cgi?id=62276>
+ myconf+=" PERL_BIN=${EPREFIX}/usr/bin/perl"
+
+ # Add Gentoo tag to make it easy for the upstream devs to spot
+ # possible modifications or patches.
+ #version_tag="g${PV:6}${PR}"
+ #version_str="${PV//_/-}-${version_tag}"
+
+ # Create the Gentoo config file before Makefile.PL is called so it
+ # is copied later on.
+ #echo "version_tag ${version_tag}" > rules/11_gentoo.cf
+
+ # Setting the following env var ensures that no questions are asked.
+ perl-module_src_configure
+ # Configure spamc
+ emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}" spamc/Makefile
+}
+
+src_compile() {
+ export PERL_MM_USE_DEFAULT=1
+
+ # Now compile all the stuff selected.
+ perl-module_src_compile
+
+ if use qmail; then
+ emake spamc/qmail-spamc
+ fi
+
+}
+
+src_install () {
+ perl-module_src_install
+
+ # Create the stub dir used by sa-update and friends
+ keepdir /var/lib/spamassassin
+
+ # Move spamd to sbin where it belongs.
+ dodir /usr/sbin
+ mv "${ED}"/usr/bin/spamd "${ED}"/usr/sbin/spamd || die "move spamd failed"
+
+ if use qmail; then
+ dobin spamc/qmail-spamc
+ fi
+
+ ln -s mail/spamassassin "${ED}"/etc/spamassassin || die
+
+ # Disable plugin by default
+ sed -i -e 's/^loadplugin/\#loadplugin/g' "${ED}"/etc/mail/spamassassin/init.pre || die
+
+ # Add the init and config scripts.
+ newinitd "${FILESDIR}"/3.3.1-spamd.init spamd
+ newconfd "${FILESDIR}"/3.0.0-spamd.conf spamd
+
+ if use systemd; then
+ systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service
+ systemd_install_serviced "${FILESDIR}"/${PN}.service.conf
+ fi
+
+ if use postgres; then
+ sed -i -e 's:@USEPOSTGRES@::' "${ED}/etc/init.d/spamd"
+
+ dodoc sql/*_pg.sql
+ else
+ sed -i -e '/@USEPOSTGRES@/d' "${ED}/etc/init.d/spamd"
+ fi
+
+ if use mysql; then
+ sed -i -e 's:@USEMYSQL@::' "${ED}/etc/init.d/spamd"
+
+ dodoc sql/*_mysql.sql
+ else
+ sed -i -e '/@USEMYSQL@/d' "${ED}/etc/init.d/spamd"
+ fi
+
+ dodoc NOTICE TRADEMARK CREDITS INSTALL.VMS UPGRADE USAGE \
+ sql/README.bayes sql/README.awl procmailrc.example sample-nonspam.txt \
+ sample-spam.txt spamd/PROTOCOL spamd/README.vpopmail \
+ spamd-apache2/README.apache
+
+ # Rename some docu files so they don't clash with others
+ newdoc spamd/README README.spamd
+ newdoc sql/README README.sql
+ newdoc ldap/README README.ldap
+
+ if use qmail; then
+ dodoc spamc/README.qmail
+ fi
+
+ cp "${FILESDIR}"/secrets.cf "${ED}"/etc/mail/spamassassin/secrets.cf.example || die
+ fperms 0400 /etc/mail/spamassassin/secrets.cf.example
+
+ cat <<-EOF > "${T}/local.cf.example"
+ # Sensitive data, such as database connection info, should be stored in
+ # /etc/mail/spamassassin/secrets.cf with appropriate permissions
+EOF
+
+ insinto /etc/mail/spamassassin/
+ doins "${T}/local.cf.example"
+}
+
+pkg_postinst() {
+ perl-module_pkg_postinst
+ elog "If you plan on using the -u flag to spamd, please read the notes"
+ elog "in /etc/conf.d/spamd regarding the location of the pid file.\n"
+ elog "If you build ${PN} with optional dependancy support,"
+ elog "you can enable them in /etc/mail/spamassassin/init.pre\n"
+ elog "You need to configure your database to be able to use Bayes filter"
+ elog "with database backend, otherwise it will still use (and need) the"
+ elog "Berkeley DB support."
+ elog "Look at the sql/README.bayes file in the documentation directory"
+ elog "for how to configure it.\n"
+ elog "If you plan to use Vipul's Razor, note that versions up to and"
+ elog "including version 2.82 include a bug that will slow down the entire"
+ elog "perl interpreter. Version 2.83 or later fixes this."
+ elog "If you do not plan to use this plugin, be sure to comment out"
+ elog "its loadplugin line in /etc/mail/spamassassin/v310.pre.\n"
+ elog "The DKIM plugin is now enabled by default for new installs,"
+ elog "if the perl module Mail::DKIM is installed."
+ elog "However, installation of SpamAssassin will not overwrite existing"
+ elog ".pre configuration files, so to use DKIM when upgrading from a"
+ elog "previous release that did not use DKIM, a directive:\n"
+ elog "loadplugin Mail::SpamAssassin::Plugin::DKIM"
+ elog "will need to be uncommented in file 'v312.pre', or added"
+ elog "to some other .pre file, such as local.pre.\n"
+ ewarn "Rules are no longer included with SpamAssassin out of the box".
+ ewarn "You will need to immediately run sa-update, or download"
+ ewarn "the additional rules .tgz package and run sa-update --install"
+ ewarn "with it, to get a ruleset.\n"
+ elog "If when you run sa-update and receive a GPG validation error."
+ elog "Then you need to import an updated sa-update key."
+ elog "sa-update --import /usr/share/spamassassin/sa-update-pubkey.txt\n"
+}