diff options
Diffstat (limited to 'mail-filter')
-rw-r--r-- | mail-filter/Manifest.gz | bin | 9385 -> 9393 bytes | |||
-rw-r--r-- | mail-filter/amavisd-new/Manifest | 2 | ||||
-rw-r--r-- | mail-filter/amavisd-new/amavisd-new-2.12.0-r3.ebuild | 2 | ||||
-rw-r--r-- | mail-filter/postsrsd/Manifest | 2 | ||||
-rw-r--r-- | mail-filter/postsrsd/postsrsd-1.6.ebuild | 2 | ||||
-rw-r--r-- | mail-filter/spamassassin/Manifest | 3 | ||||
-rw-r--r-- | mail-filter/spamassassin/files/geoip.cf | 70 | ||||
-rw-r--r-- | mail-filter/spamassassin/files/mention-geoip.cf-in-init.pre.patch | 11 | ||||
-rw-r--r-- | mail-filter/spamassassin/spamassassin-3.4.4-r4.ebuild | 315 |
9 files changed, 403 insertions, 4 deletions
diff --git a/mail-filter/Manifest.gz b/mail-filter/Manifest.gz Binary files differindex 8dd7f9d3ec23..18829ace0edb 100644 --- a/mail-filter/Manifest.gz +++ b/mail-filter/Manifest.gz diff --git a/mail-filter/amavisd-new/Manifest b/mail-filter/amavisd-new/Manifest index 78dd10e8a0d4..77bac048cc5c 100644 --- a/mail-filter/amavisd-new/Manifest +++ b/mail-filter/amavisd-new/Manifest @@ -7,6 +7,6 @@ AUX amavisd.service-r1 433 BLAKE2B 8e61e95cfdadb37afec0040f87eb67745ea6aae766ca0 DIST amavis-amavisd-new-2.11.1.tar.gz 1093467 BLAKE2B 1e43ddea86ff269b02cbbcd125d913c51b66728b1063cde6ca3f3f24f1bd36f9f3c7f51a8baf509d2aca0d41a07a00bb9abe08dd70724391c552634715d01a75 SHA512 6ef291868908bd13d6ce913f5c8c3898b35eba490877e8eded3951a32be7549145df5db1409f124a3631ec88dd7eeb9457ce2b063ae3e3bccd76cc2a9b8741ae DIST amavis-v2.12.0.tar.bz2 873702 BLAKE2B cae44bb9cfa9125f44b1ef548947a5f826e91fc349b12a52f0267933e65c450a708c7a18e5ae90ee1a0d452d0b3d30a6c1cabcc310e3609de1eda8c35f222306 SHA512 f8d2dfb6e7d694c76c0ebca7592a3c85ff9b4911cbe43b3eb6d5002541bf036adfbf47c18df4b10c72bcceee0d8701b8c474e6432c5c136ca25170e42098d844 EBUILD amavisd-new-2.11.1-r3.ebuild 5214 BLAKE2B 87ad69414234780a535697ce54b84669c1c28b51053c5c4e7e927742ec6387afe10573278e2825c71812f2f0dbdeec1af5efb7530a7863460b0cd974bed59146 SHA512 50f1fe496433a34a86d0e02fac8ae28655543ba25653b6066f9f6d1184632ddf78665e99218ecd191cbab80ec8115654ad3a0de39f2787a324ed1c19b776bb2f -EBUILD amavisd-new-2.12.0-r3.ebuild 5334 BLAKE2B 091a11961cf8513fcfccb349e8bfa37401c9470e9cfd12a0501d731f621aeacaa5efb387b3ea3cb287f98c9d97af6522be81cbc6d8fb4b9cf8c3eaef65b314f0 SHA512 616891a57b51e5f984343b12862284404cde54ec4c2144e0c9cf1ff6df02d31c5188f2cc25f04dcfb230c4fbb8957806fa143a5bfbd31d441671c6bc53fd0d06 +EBUILD amavisd-new-2.12.0-r3.ebuild 5333 BLAKE2B e2feb10cc2b5423c3a5e485a72addad76548e0a7abdbbc47cace2540b68f95a31b147e07e8878bb924d1f3a77ff2fec78176f57b83495ae47325b0acfd888e35 SHA512 e4aa09a5b556a921e9b851cb63b0a61c29c4b3054587ee6ab9fdb4d0a02ca6cad650e4758e4995cf342bd5004df60d4bf72b045ffab5440c67550a6222bfa928 EBUILD amavisd-new-2.12.0.ebuild 5264 BLAKE2B 7cf639a83ebf1b384b07d32276224781d3b22ed056d98e22c357686b3afb2a09f5997b71bd75fe204e3f951344d06c06a339900cdc3520601b2d9a90fe2f33e4 SHA512 c77aa8a8a652d18f37c9a9702eba93bcbeda4c613e143f8088e7c495f8269d7f41e59105aad2b014319f2e7c1e98b5cbba2110b29c934914df4ff5652c28b78f MISC metadata.xml 925 BLAKE2B b75aca7f3afff0d320516d293b6c88b34be4599a0233675f3bdeb3881a857a1b6316dba66cff118667d0c455650c0b23da3f471dbab9f9710cdc3dcf23b55aae SHA512 27cbf8cebfe1e2611193a954edad5fce81cf27f2a4f7d1746d975529317ee45b94b250c47c013856e18f339c3ea234b59fc3990aac5176bffec67786e67f8d1f diff --git a/mail-filter/amavisd-new/amavisd-new-2.12.0-r3.ebuild b/mail-filter/amavisd-new/amavisd-new-2.12.0-r3.ebuild index 0f4143d9a4d0..19b811676bb3 100644 --- a/mail-filter/amavisd-new/amavisd-new-2.12.0-r3.ebuild +++ b/mail-filter/amavisd-new/amavisd-new-2.12.0-r3.ebuild @@ -11,7 +11,7 @@ SRC_URI="https://gitlab.com/amavis/amavis/-/archive/v${PV}/amavis-v${PV}.tar.bz2 LICENSE="GPL-2 BSD-2" SLOT="0" -KEYWORDS="~amd64 ppc ppc64 sparc ~x86" +KEYWORDS="~amd64 ppc ppc64 sparc x86" IUSE="clamav courier dkim ldap mysql postgres qmail razor rspamd rspamd-https snmp spamassassin zmq" MY_RSPAMD_DEPEND="dev-perl/HTTP-Message diff --git a/mail-filter/postsrsd/Manifest b/mail-filter/postsrsd/Manifest index 17f1fa39513b..ca09d27f577a 100644 --- a/mail-filter/postsrsd/Manifest +++ b/mail-filter/postsrsd/Manifest @@ -4,5 +4,5 @@ DIST postsrsd-1.4.tar.gz 26555 BLAKE2B acdfb3c8a1ca5172ac7727913ad6c1f9cf0450996 DIST postsrsd-1.6.tar.gz 32111 BLAKE2B 5b4e562aa9c9b5faf0e45c035a71d76dc2b6e9b3d4399108f06e6d0ad3e4f7abfcb8c18c818f3b4787bab155bf7895caaf127a97b861b26525ad5a27f2ee4dc7 SHA512 b2df4cdec41361e15cd8c9207fb16564d607559bcb36dd73c9347b90e4f3c2414b88434ef1ffe6a18783f38c5960383516e40e4ffa28802a03539e52ca723aa1 EBUILD postsrsd-1.4-r1.ebuild 550 BLAKE2B fe9d47ec65943344ceaa1000fbda08367aa3f17febdca670f7ce8d4f768ac9469f4e7bbed9b71fe5bb02a555ff7bff6a00a2b0bc7c467050c4b828708a3fb91d SHA512 9e395c93a416b5cc81cd5295d287f871c225ec3bb49445b94e34ddfe9bd768bccacfe8189015e3e9d53092c615b90f8287e9afae69dd9f516cf16197570437d6 EBUILD postsrsd-1.4.ebuild 547 BLAKE2B c74dc06204c8e865fbda696ec43c14adc5f57e0a942435b0a1bafc0f5836ea51e70eb0b51a87bd7f98e3239b816069ba015ccf1fd5493b41333e81e75f8499b3 SHA512 3e3c21cc922a540d5bc4af336678588f463afaca5109e4ba977d042e7ac6010f8f4b1f9fe10cbabbbc81ce9b3f28dc5f368887186315c6e343e5d4846501ea4c -EBUILD postsrsd-1.6.ebuild 773 BLAKE2B d6c819693865f82e2282552a6adf7e6c5a8f41f34d217ff2d64b795a18893f63f8034536eeb110504e5c9016e9f2d06259f18969159c656e542d44190a3473e0 SHA512 e03de005aa024efd034ecf9cf80934d9a3522826fb769e119c6618871c8b82fc6fd1ac4d91a825888d3ad620c016f7301561d8e8fbb755b463d03afc06de1513 +EBUILD postsrsd-1.6.ebuild 771 BLAKE2B 63cdc5cc1f67a499b8c96a27c788f0fb565834184100268afa722d46a91e534257c6a24c1b28c2f7fa3201ff40500a1a7ca14e8ecd96262cb6e8dc73d0c58ce9 SHA512 90f45343c349513fbcbb4af3fc8b1cc19be465e53dda7dd086758fd28bca469db30d30b3f980c8aa3fe2c1a384397310846357f5c8ab26b9fc9aa976de9dc461 MISC metadata.xml 337 BLAKE2B caac016ab1be7bad01670321e5aae7cf8c3699a394f4911350b4104d313e5b921071cb3406a47f976f16d1fc6879a16b2d6be03e0765a02f0e1e65de5703df0f SHA512 9093270e1a174ca6c5e1316015b3e9605f247bcd4fccf1e1c9595f5b94e3e182e532dced5c483a0be24c053fd453a5b9ba272c1004fbc54fe95cc3069dfe7d59 diff --git a/mail-filter/postsrsd/postsrsd-1.6.ebuild b/mail-filter/postsrsd/postsrsd-1.6.ebuild index ec90ac1a91ad..5b7fe63b27e0 100644 --- a/mail-filter/postsrsd/postsrsd-1.6.ebuild +++ b/mail-filter/postsrsd/postsrsd-1.6.ebuild @@ -11,7 +11,7 @@ HOMEPAGE="https://github.com/roehling/postsrsd" LICENSE="GPL-2" SLOT="0" -KEYWORDS="~amd64 ~x86" +KEYWORDS="amd64 x86" IUSE="" DEPEND=">=dev-util/cmake-2.4" diff --git a/mail-filter/spamassassin/Manifest b/mail-filter/spamassassin/Manifest index 649ce1b32b2d..32a2b522b1c4 100644 --- a/mail-filter/spamassassin/Manifest +++ b/mail-filter/spamassassin/Manifest @@ -1,5 +1,7 @@ AUX 3.4.1-spamd.conf-r1 1257 BLAKE2B bbdeeda731965dcd863c2a9bc615295b7d48e0110994dac66bfccb4ee1d84c9c50e6c2fd6649b09b7206e16120ed7e55b387ba76afdf0fe7e629bc767d87a80c SHA512 b2233d9330fa06d13dc8d222fa16198a1f81dcb9c87ca93961db54d9f2514cdabd824d0f25c0cca678495f271f48f601ee14363c2a2f833100facae307226beb AUX 3.4.1-spamd.init-r3 1180 BLAKE2B c7290e6016b27247610b050f77368fcbf3dd3f4ab0a72a933b3819f35dfe9f9085f13f73be95b1169e04d3a09bc4cec6284e87963059ac047d5908df3458fb2b SHA512 2c968750da3252e8dcce4cebf105a26a9dbc471e39bda7d66180e0fbf930b11dd3a98337d7c387026375918b660768c637c2f2031d6624ce3237d9cc8cd88a02 +AUX geoip.cf 2228 BLAKE2B 71d525f3f2abb9372cb1be7bb2698cf3d6495c142acaa96d69083d44108c8d514d23afc4f106c51e00704e24567465eaa76404cf5d586a6117afbe2e3f017eda SHA512 624b90487c426ffc46ca5b091b5a0591c0db8378820dee0cb684fd365336f4cef2c388d51c74bf284ed0a39b16c3cbca4aaf8dbc2dcf43b3dbea175185609aa4 +AUX mention-geoip.cf-in-init.pre.patch 438 BLAKE2B 1ddce693e1df24632b2cfd6f8309bc66b1ee1420f84e253e7a68934ab532c3aecd31fd62d88d679ad688bec559cc58faabbc625238c26d92a15e3b71c0ca6a63 SHA512 b62abc243b46757fc7277227e5d15a5455f21416bef16a3beaccdc5887e8957e7fec821779fc1b1fb86f22aa030b355f45087e568768df80790cfd9fb067422e AUX secrets.cf 664 BLAKE2B a501fb93369743e3c9139cc780f166168313613c840857bc0e72def5b3e168f235afc16a1dc34afa0e839ffa9da6c0c360c9a93a126d9dd711b4473e0a19ebcc SHA512 bb6992098a44e16147be46b75b70e3fb81672285dd71a30719606e2cab556720fc9dd318c7a80832ceaf2e6d9c98c2dd7434f48242feede1922c3e1073559edb AUX spamassassin.service-r4 182 BLAKE2B c5813612e78602d6e67b527f07a8a38171422a638bf419135b34f950a036e899ee6d6a129413ab52ca737f18258265cad971a0b84057561b7012fbc390efd7e9 SHA512 35da6ed8baa1cfc13546b409ed65d18334410ee497f9609c89cd4993dc8084ed479ddc7658e72a52a9b79f1a73d4efba42148b7238678c17a2965f9ff6a608e9 AUX spamassassin.service.conf-r2 120 BLAKE2B cdefa5d73234be5331f7ff7cc646f10365adf515b85bf0d9912d240105579747f3834b7f72402a31b5be9b8ed0faf2545ae0a4ed46ebd3c7a90962f764fb5e8a SHA512 55b93ce1636505beabba21cd208541750ef448e952658b65d6e1447f92cec3a35e3d489d014a0229765117168cc03b4675652709f7ed9973be8fba84c10786dd @@ -8,5 +10,6 @@ DIST Mail-SpamAssassin-3.4.4.tar.bz2 2741290 BLAKE2B 03dec6c71a43ad7d288a96de32f EBUILD spamassassin-3.4.4-r1.ebuild 9768 BLAKE2B b7f7c59ff8f13b2702ae54dc97084a04ba971b317402a1916bc3edc06491feefe48d7dd06ad0f03d2680783ebd77bab62cf42195a36a5dca6b82955a9d72855f SHA512 cdcd621b39e9d7f53a3e3f3e5bf4e80fdcd1edbcc440cfe43d4c0b525f58489021433d0892f7e1c8405cf073768860c4d0605fbcd8c94a6e3d19905b736b003d EBUILD spamassassin-3.4.4-r2.ebuild 9643 BLAKE2B 2cd5f87c164d2c56be84e533196e0a1f99f3955135540bb9f47dbd34f51fa1897f2508a8230c7e5c2d3a2c24da263f67c9e78b7855e1c15887d91627a65c12ec SHA512 d9c93a7a071b3a16ad38fd1c6c879ee82b80b1c8bb25689d4abea30c640ac4a90d423378f52bb80df666586ce35575039337f69077dbf87b4a8de8127dc50e54 EBUILD spamassassin-3.4.4-r3.ebuild 9523 BLAKE2B fbe004494b8c1f7f506807643a308fa4bfeaeb869f3996b60296651670c74a7ebaff634b648686605f909499066bc7652f33b67c50d12bdded560f57c43b1e53 SHA512 4c5608e0f01d79d77d2b91e0db83dd5465d77b141d3a76863ea1c8be01a7075232c08df6769d86a173f23c90970a6891fdc3cdb9243c6bc6b7e2f449cef2980a +EBUILD spamassassin-3.4.4-r4.ebuild 9616 BLAKE2B 1acaed575bc1fd53c61cdd26daf64f5e3e3324201b5d01ea1f6c14746ea5a14ce09d0c00ba6bee82e1e02c43551a3e6ce0104a5f79f4b6d67693797d7684605f SHA512 e3d693aee5108152736b6d7b7fb154b6dec4a98f7cd79219bd8339e4108aedb134aea81bae50abf267968226aeb0c4203589fae6dc9d4619342f7016d6a94957 EBUILD spamassassin-3.4.4.ebuild 8499 BLAKE2B 592546b060b152316a579e6f6d201590d4081c7eb1bea2ba8957f954fbda514051f14fc51bba7ffa2a6359a4551d806634b0219daba7ce98356b080192b20027 SHA512 ac9c0eb2934a33df010046706267ad58c4e12a3c8c07d6d43e51aa013f9c8031ccf9160e82f6bde5fef895430dec22016eb61daa8ce2c149ad426e3d3e6bc9e3 MISC metadata.xml 693 BLAKE2B 57b8a079ed95858b27fb567e1c3b77389e8141315fcf69e34e2b80dab13e5b0f88c9f50f2387f7537cedd5a3cd56adcb611932a641e31a7f875914bb847708d3 SHA512 991a54ec305b6b4c4e9fd27ba77abf2ad7e72647776e0acc0e29a058566d0045e31df8ceebee6e320f758f10fb12973239d1650e469e910ac77a887656fcff3e diff --git a/mail-filter/spamassassin/files/geoip.cf b/mail-filter/spamassassin/files/geoip.cf new file mode 100644 index 000000000000..733cba09ebc8 --- /dev/null +++ b/mail-filter/spamassassin/files/geoip.cf @@ -0,0 +1,70 @@ +# GeoIP / RelayCountry Config +# +# The RelayCountry SpamAssassin plugin needs to be enabled +# in init.pre, but it's suggested that you make configuration +# changes here. +# +# See Also: +# - https://wiki.apache.org/spamassassin/RelayCountryPlugin +# - man Mail::SpamAssassin::Plugin::RelayCountry +# +# NOTE: This is a Gentoo supplied config file. +# + +############################################################### +# +# CONFIGURATION +# + +# Which type of Geo database to use. Valid database types are +# GeoIP, GeoIP2, DB_File and Fast. Defaults to Fast, GeoIP2 is +# the suggested backend which uses dev-perl/GeoIP2. +# +#country_db_type GeoIP2 + +# Where to find MaxMind GeoIP2 or IP::Country::DB_File database. +# The default is to search several paths, see the RelayCountry +# man page referenced at the top for details. +# +# It's suggested you use net-misc/geoipupdate to install and +# update your GeoIP2 databases. +# +#country_db_path /usr/share/GeoIP/GeoLite2-Country.mmdb + +# The following will add a separate MIME header that shows all +# the message's relay countries, independent of any site- +# specific rules. +# +# It will show up in your MIME headers as: +# X-Spam-Relay-Country: US CN RU +# +#add_header all Relay-Country _RELAYCOUNTRY_ + +############################################################### +# +# SITE SPECIFIC RULES +# + +# Country metadata will also be added to the Bayesian filtering +# process, allowing it to learn information based on countries. +# This will occur even if you don't define any site specific +# rules. + +# NOTE: Many prefer placing custom rules in local.cf. + +# The following is an example of a rule that penalizes mail +# that passed through China by increasing the spam score +# of the message by 3 points. +# +#header RELAYCOUNTRY_BAD X-Relay-Countries =~ /CN/ +#describe RELAYCOUNTRY_BAD Relayed through China at some point +#score RELAYCOUNTRY_BAD 3.0 + +# And this is an example of a rule that rewards mail that +# has first went through Finland or Sweden by reducing the +# spam score of the message by 0.2 points. +# +#header RELAYCOUNTRY_GOOD X-Relay-Countries =~ /^(FI|SE)/ +#describe RELAYCOUNTRY_GOOD First untrusted relay is Finland or Sweden :-) +#score RELAYCOUNTRY_GOOD -0.2 + diff --git a/mail-filter/spamassassin/files/mention-geoip.cf-in-init.pre.patch b/mail-filter/spamassassin/files/mention-geoip.cf-in-init.pre.patch new file mode 100644 index 000000000000..13921dc6eb93 --- /dev/null +++ b/mail-filter/spamassassin/files/mention-geoip.cf-in-init.pre.patch @@ -0,0 +1,11 @@ +--- Mail-SpamAssassin-3.4.4/rules/init.pre 2019-10-23 20:22:15.000000000 -0400 ++++ Mail-SpamAssassin-3.4.4/rules/init.pre 2020-05-20 19:59:42.239544414 -0400 +@@ -17,7 +17,7 @@ + # RelayCountry - add metadata for Bayes learning, marking the countries + # a message was relayed through + # +-# Note: This requires the Geo::IP Perl module ++# Note: This requires geoip.cf to be edited. + # + # loadplugin Mail::SpamAssassin::Plugin::RelayCountry + diff --git a/mail-filter/spamassassin/spamassassin-3.4.4-r4.ebuild b/mail-filter/spamassassin/spamassassin-3.4.4-r4.ebuild new file mode 100644 index 000000000000..46ed9deca0b9 --- /dev/null +++ b/mail-filter/spamassassin/spamassassin-3.4.4-r4.ebuild @@ -0,0 +1,315 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit perl-functions systemd toolchain-funcs + +MY_P="Mail-SpamAssassin-${PV//_/-}" +S="${WORKDIR}/${MY_P}" +DESCRIPTION="An extensible mail filter which can identify and tag spam" +HOMEPAGE="https://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 ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-macos" +IUSE="berkdb cron ipv6 ldap libressl mysql postgres qmail sqlite ssl test" +RESTRICT="!test? ( test )" + +# The Makefile.PL script checks for dependencies, but only fails if a +# required (i.e. not optional) dependency is missing. We therefore +# require most of the optional modules only at runtime. +REQDEPEND="acct-user/spamd + acct-group/spamd + dev-lang/perl:= + dev-perl/HTML-Parser + dev-perl/Net-DNS + dev-perl/NetAddr-IP + virtual/perl-Archive-Tar + virtual/perl-Digest-SHA + virtual/perl-IO-Zlib + virtual/perl-Time-HiRes + ssl? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl ) + )" + +# SpamAssassin doesn't use libwww-perl except as a fallback for when +# curl/wget are missing, so we depend on one of those instead. Some +# mirrors use https, so we need those utilities to support SSL. +# +# re2c is needed to compile the rules (sa-compile). +# +# We still need the old Digest-SHA1 because razor2 has not been ported +# to Digest-SHA. +OPTDEPEND="app-crypt/gnupg + dev-perl/BSD-Resource + dev-perl/Digest-SHA1 + dev-perl/Encode-Detect + || ( dev-perl/GeoIP2 dev-perl/Geo-IP ) + dev-perl/HTTP-Date + dev-perl/Mail-DKIM + dev-perl/Mail-SPF + dev-perl/Net-Patricia + dev-perl/Net-CIDR-Lite + dev-util/re2c + || ( net-misc/wget[ssl] net-misc/curl[ssl] ) + virtual/perl-MIME-Base64 + virtual/perl-Pod-Parser + berkdb? ( virtual/perl-DB_File ) + ipv6? ( dev-perl/IO-Socket-INET6 ) + 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 + ) + ssl? ( dev-perl/IO-Socket-SSL )" + +DEPEND="${REQDEPEND} + test? ( + ${OPTDEPEND} + virtual/perl-Test-Harness + )" +RDEPEND="${REQDEPEND} ${OPTDEPEND}" + +PATCHES=( + "${FILESDIR}/mention-geoip.cf-in-init.pre.patch" +) + +# There are a few renames and use-dependent ones in src_istall as well. +DOCS=( + NOTICE TRADEMARK CREDITS 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 +) + +src_prepare() { + default + + # The sa_compile test does some weird stuff like hopping around in + # the directory tree and calling "make" to create a dist tarball + # from ${S}. It fails, and is more trouble than it's worth... + perl_rm_files t/sa_compile.t + + # The spamc tests (which need the networked spamd daemon) fail for + # irrelevant reasons. It's too hard to disable them (unlike the + # spamd tests themselves -- see src_test), so use a crude + # workaround. + perl_rm_files t/spamc_*.t + + # Disable plugin by default + sed -i -e 's/^loadplugin/\#loadplugin/g' \ + "rules/init.pre" \ + || die "failed to disable plugins by default" +} + +src_configure() { + # This is how and where the perl-module eclass disables the + # MakeMaker interactive prompt. + export PERL_MM_USE_DEFAULT=1 + + # 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). + # + # We also set the path to the perl executable explictly. This will be + # used to create the initial shebang line in the scripts (bug 62276). + perl Makefile.PL \ + PREFIX="${EPREFIX}/usr" \ + INSTALLDIRS=vendor \ + SYSCONFDIR="${EPREFIX}/etc" \ + DATADIR="${EPREFIX}/usr/share/spamassassin" \ + PERL_BIN="${EPREFIX}/usr/bin/perl" \ + ENABLE_SSL="$(usex ssl)" \ + DESTDIR="${D}" \ + || die 'failed to create a Makefile using Makefile.PL' + + # Now configure spamc. + emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}" spamc/Makefile +} + +src_compile() { + emake + use qmail && emake spamc/qmail-spamc +} + +src_install () { + default + + # 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 + + dosym mail/spamassassin /etc/spamassassin + + # Add the init and config scripts. + newinitd "${FILESDIR}/3.4.1-spamd.init-r3" spamd + newconfd "${FILESDIR}/3.4.1-spamd.conf-r1" spamd + + systemd_newunit "${FILESDIR}/${PN}.service-r4" "${PN}.service" + systemd_install_serviced "${FILESDIR}/${PN}.service.conf-r2" \ + "${PN}.service" + + use postgres && dodoc sql/*_pg.sql + use mysql && dodoc sql/*_mysql.sql + use qmail && dodoc spamc/README.qmail + + # Rename some files so that they don't clash with others. + newdoc spamd/README README.spamd + newdoc sql/README README.sql + newdoc ldap/README README.ldap + + insinto /etc/mail/spamassassin/ + doins "${FILESDIR}"/geoip.cf + insopts -m0400 + newins "${FILESDIR}"/secrets.cf secrets.cf.example + + # Create the directory where sa-update stores its GPG key (if you + # choose to import one). If this directory does not exist, the + # import will fail. This is bug 396307. We expect that the import + # will be performed as root, and making the directory accessible + # only to root prevents a warning on the command-line. + diropts -m0700 + dodir /etc/mail/spamassassin/sa-update-keys + + if use cron; then + # Install the cron job if they want it. + exeinto /etc/cron.daily + newexe "${FILESDIR}/update-spamassassin-rules-r1.cron" \ + update-spamassassin-rules + fi + + # Remove perllocal.pod to avoid file collisions (bug #603338). + perl_delete_localpod + + # The perl-module eclass calls three other functions to clean + # up in src_install. The first fixes references to ${D} in the + # packlist, and is useful to us, too. The other two functions, + # perl_delete_emptybsdir and perl_remove_temppath, don't seem + # to be needed: there are no empty directories, *.bs files, or + # ${D} paths remaining in our installed image. + perl_fix_packlist +} + +src_test() { + # Trick the test suite into skipping the spamd tests. Setting + # SPAMD_HOST to a non-localhost value causes SKIP_SPAMD_TESTS to be + # set in SATest.pm. + export SPAMD_HOST=disabled + default +} + +pkg_preinst() { + if use mysql || use postgres ; then + local _awlwarn=0 + local _v + for _v in ${REPLACING_VERSIONS}; do + if ver_test "${_v}" -lt "3.4.3"; then + _awlwarn=1 + break + fi + done + if [[ ${_awlwarn} == 1 ]] ; then + ewarn 'If you used AWL before 3.4.3, the SQL schema has changed.' + ewarn 'You will need to manually ALTER your tables for them to' + ewarn 'continue working. See the UPGRADE documentation for' + ewarn 'details.' + ewarn + fi + fi +} + +pkg_postinst() { + elog + elog 'No rules are installed by default. You will need to run sa-update' + elog 'at least once, and most likely configure SpamAssassin before it' + elog 'will work.' + + if ! use cron; then + elog + elog 'You should consider a cron job for sa-update. One is provided' + elog 'for daily updates if you enable the "cron" USE flag.' + fi + elog + elog 'Configuration and update help can be found on the wiki:' + elog + elog ' https://wiki.gentoo.org/wiki/SpamAssassin' + elog + + if use mysql || use postgres ; then + local _v + for _v in ${REPLACING_VERSIONS}; do + if ver_test "${_v}" -lt "3.4.3"; then + ewarn + ewarn 'If you used AWL before 3.4.3, the SQL schema has changed.' + ewarn 'You will need to manually ALTER your tables for them to' + ewarn 'continue working. See the UPGRADE documentation for' + ewarn 'details.' + ewarn + + # show this only once + break + fi + done + fi + + ewarn 'If this version of SpamAssassin causes permissions issues' + ewarn 'with your user configurations or bayes databases, then you' + ewarn 'may need to set SPAMD_RUN_AS_ROOT=true in your OpenRC service' + ewarn 'configuration file, or remove the --username and --groupname' + ewarn 'flags from the SPAMD_OPTS variable in your systemd service' + ewarn 'configuration file.' + + if [[ ! ~spamd -ef "${ROOT}/var/lib/spamd" ]] ; then + ewarn "The spamd user's home folder has been moved to a new location." + elog + elog "The acct-user/spamd package should have relocated it for you," + elog "but may have failed because your spamd daemon was running." + elog + elog "To fix this:" + elog " - Stop your spamd daemon" + elog " - emerge -1 acct-user/spamd" + elog " - Restart your spamd daemon" + elog " - Remove the old home folder if you want" + elog " rm -rf \"${ROOT}/home/spamd\"" + fi + if [[ -e "${ROOT}/home/spamd" ]] ; then + ewarn + ewarn "The spamd user's home folder has been moved to a new location." + elog + elog " Old Home: ${ROOT}/home/spamd" + elog " New Home: ${ROOT}/var/lib/spamd" + elog + elog "You may wish to migrate your data to the new location:" + elog " - Stop your spamd daemon" + elog " - Re-emerge acct-user/spamd to ensure the home folder has been" + elog " updated to the new location, now that the daemon isn't running:" + elog " # emerge -1 acct-user/spamd" + elog " # echo ~spamd" + elog " - Migrate the contents from the old location to the new home" + elog " For example:" + elog " # cp -Rpi \"${ROOT}/home/spamd/\" \"${ROOT}/var/lib/\"" + elog " - Remove the old home folder" + elog " # rm -rf \"${ROOT}/home/spamd\"" + elog " - Restart your spamd daemon" + elog + elog "If you do not wish to migrate data, you should remove the old" + elog "home folder from your system as it is not used." + fi +} |