summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /mail-filter
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'mail-filter')
-rw-r--r--mail-filter/MailScanner/MailScanner-4.84.5.2.ebuild321
-rw-r--r--mail-filter/MailScanner/Manifest1
-rw-r--r--mail-filter/MailScanner/files/confd.mailscanner4
-rw-r--r--mail-filter/MailScanner/files/initd.mailscanner48
-rw-r--r--mail-filter/MailScanner/metadata.xml14
-rw-r--r--mail-filter/amavisd-milter/Manifest2
-rw-r--r--mail-filter/amavisd-milter/amavisd-milter-1.5.0-r1.ebuild33
-rw-r--r--mail-filter/amavisd-milter/amavisd-milter-1.5.0.ebuild27
-rw-r--r--mail-filter/amavisd-milter/amavisd-milter-1.6.0-r1.ebuild34
-rw-r--r--mail-filter/amavisd-milter/amavisd-milter-1.6.0.ebuild33
-rw-r--r--mail-filter/amavisd-milter/files/amavisd-milter-1.6.0-policybank.patch20
-rw-r--r--mail-filter/amavisd-milter/files/amavisd-milter.confd14
-rw-r--r--mail-filter/amavisd-milter/files/amavisd-milter.initd30
-rw-r--r--mail-filter/amavisd-milter/metadata.xml10
-rw-r--r--mail-filter/amavisd-new/Manifest4
-rw-r--r--mail-filter/amavisd-new/amavisd-new-2.10.1-r1.ebuild181
-rw-r--r--mail-filter/amavisd-new/amavisd-new-2.10.1.ebuild181
-rw-r--r--mail-filter/amavisd-new/amavisd-new-2.7.2.ebuild168
-rw-r--r--mail-filter/amavisd-new/amavisd-new-2.8.1-r1.ebuild189
-rw-r--r--mail-filter/amavisd-new/amavisd-new-2.9.1.ebuild180
-rw-r--r--mail-filter/amavisd-new/files/amavis-mc.initd24
-rw-r--r--mail-filter/amavisd-new/files/amavisd.initd46
-rw-r--r--mail-filter/amavisd-new/files/amavisd.initd-r145
-rw-r--r--mail-filter/amavisd-new/files/amavisd.service13
-rw-r--r--mail-filter/amavisd-new/metadata.xml14
-rw-r--r--mail-filter/anomy-sanitizer/Manifest3
-rw-r--r--mail-filter/anomy-sanitizer/anomy-sanitizer-1.76-r1.ebuild107
-rw-r--r--mail-filter/anomy-sanitizer/files/anomy.conf207
-rw-r--r--mail-filter/anomy-sanitizer/files/sample2_mailfilter.sh83
-rw-r--r--mail-filter/anomy-sanitizer/files/sample_mailfiler.sh76
-rw-r--r--mail-filter/anomy-sanitizer/metadata.xml7
-rw-r--r--mail-filter/anubis/Manifest1
-rw-r--r--mail-filter/anubis/anubis-4.1.1-r1.ebuild95
-rw-r--r--mail-filter/anubis/anubis-4.1.1.ebuild94
-rw-r--r--mail-filter/anubis/files/4.1.1-gnutls.patch11
-rw-r--r--mail-filter/anubis/files/4.1.1-gnutls3.patch14
-rw-r--r--mail-filter/anubis/files/4.1.1-gpgme.patch32
-rw-r--r--mail-filter/anubis/files/4.1.1-testsuite.patch14
-rw-r--r--mail-filter/anubis/metadata.xml5
-rw-r--r--mail-filter/ask/Manifest2
-rw-r--r--mail-filter/ask/ask-2.4.1.ebuild57
-rw-r--r--mail-filter/ask/ask-2.5.3.ebuild42
-rw-r--r--mail-filter/ask/metadata.xml12
-rw-r--r--mail-filter/assp/Manifest5
-rw-r--r--mail-filter/assp/assp-1.8.5.9.ebuild177
-rw-r--r--mail-filter/assp/assp-1.9.4.7.ebuild178
-rw-r--r--mail-filter/assp/assp-1.9.4.8.ebuild178
-rw-r--r--mail-filter/assp/assp-1.9.4.9.ebuild178
-rw-r--r--mail-filter/assp/assp-1.9.8.13030.ebuild178
-rw-r--r--mail-filter/assp/files/assp-1.2.6.patch364
-rw-r--r--mail-filter/assp/files/asspd.init22
-rw-r--r--mail-filter/assp/files/base.patch15
-rw-r--r--mail-filter/assp/metadata.xml25
-rw-r--r--mail-filter/bmf/Manifest1
-rw-r--r--mail-filter/bmf/bmf-0.9.4-r2.ebuild56
-rw-r--r--mail-filter/bmf/files/bmf-0.9.4_QA.patch19
-rw-r--r--mail-filter/bmf/metadata.xml8
-rw-r--r--mail-filter/bogofilter/Manifest1
-rw-r--r--mail-filter/bogofilter/bogofilter-1.2.4-r1.ebuild125
-rw-r--r--mail-filter/bogofilter/files/bogofilter-1.2.2-gcc34.patch24
-rw-r--r--mail-filter/bogofilter/files/bogofilter-1.2.4-test-env.patch11
-rw-r--r--mail-filter/bogofilter/metadata.xml19
-rw-r--r--mail-filter/clamassassin/Manifest1
-rw-r--r--mail-filter/clamassassin/clamassassin-1.2.4.ebuild39
-rw-r--r--mail-filter/clamassassin/metadata.xml10
-rw-r--r--mail-filter/clamsmtp/Manifest1
-rw-r--r--mail-filter/clamsmtp/clamsmtp-1.10.ebuild38
-rw-r--r--mail-filter/clamsmtp/files/clamsmtpd.init20
-rw-r--r--mail-filter/clamsmtp/metadata.xml6
-rw-r--r--mail-filter/couriersrs/Manifest1
-rw-r--r--mail-filter/couriersrs/couriersrs-0.1.2.ebuild29
-rw-r--r--mail-filter/couriersrs/files/couriersrs-0.1.2-automake-fixes.diff36
-rw-r--r--mail-filter/couriersrs/metadata.xml6
-rw-r--r--mail-filter/dcc/Manifest2
-rw-r--r--mail-filter/dcc/dcc-1.3.140-r1.ebuild147
-rw-r--r--mail-filter/dcc/dcc-1.3.154.ebuild133
-rw-r--r--mail-filter/dcc/files/dcc-1.3.140-configure-fix.patch17
-rw-r--r--mail-filter/dcc/files/dcc-1.3.140-freebsd.patch13
-rw-r--r--mail-filter/dcc/files/dcc-1.3.86.patch41
-rw-r--r--mail-filter/dcc/files/dcc.confd14
-rw-r--r--mail-filter/dcc/files/dcc.initd136
-rw-r--r--mail-filter/dcc/files/dcc.initd-1.3.140101
-rw-r--r--mail-filter/dcc/files/dcc.initd-1.3.154103
-rw-r--r--mail-filter/dcc/metadata.xml12
-rw-r--r--mail-filter/disspam/Manifest1
-rw-r--r--mail-filter/disspam/disspam-0.14.ebuild33
-rw-r--r--mail-filter/disspam/files/0.12-sa302fix.patch22
-rw-r--r--mail-filter/disspam/metadata.xml5
-rw-r--r--mail-filter/dkimproxy/Manifest1
-rw-r--r--mail-filter/dkimproxy/dkimproxy-1.4.1.ebuild28
-rw-r--r--mail-filter/dkimproxy/files/dkimproxy.in.initd20
-rw-r--r--mail-filter/dkimproxy/files/dkimproxy.out.initd20
-rw-r--r--mail-filter/dkimproxy/metadata.xml11
-rw-r--r--mail-filter/dovecot-antispam/Manifest1
-rw-r--r--mail-filter/dovecot-antispam/dovecot-antispam-2.0_pre20130429.ebuild33
-rw-r--r--mail-filter/dovecot-antispam/metadata.xml8
-rw-r--r--mail-filter/dovecot_deleted_to_trash/Manifest1
-rw-r--r--mail-filter/dovecot_deleted_to_trash/dovecot_deleted_to_trash-0.6.ebuild36
-rw-r--r--mail-filter/dovecot_deleted_to_trash/files/29-delete-to-trash.conf13
-rw-r--r--mail-filter/dovecot_deleted_to_trash/metadata.xml16
-rw-r--r--mail-filter/dspam/Manifest1
-rw-r--r--mail-filter/dspam/dspam-3.10.2-r1.ebuild222
-rw-r--r--mail-filter/dspam/files/dspam.confd7
-rw-r--r--mail-filter/dspam/files/dspam.cron-r45
-rw-r--r--mail-filter/dspam/files/dspam.initd45
-rw-r--r--mail-filter/dspam/files/dspam.logrotate10
-rw-r--r--mail-filter/dspam/metadata.xml35
-rw-r--r--mail-filter/exim-geoip/Manifest1
-rw-r--r--mail-filter/exim-geoip/exim-geoip-0.1.ebuild30
-rw-r--r--mail-filter/exim-geoip/metadata.xml14
-rw-r--r--mail-filter/exim-p0f/Manifest1
-rw-r--r--mail-filter/exim-p0f/exim-p0f-0.1.ebuild30
-rw-r--r--mail-filter/exim-p0f/metadata.xml14
-rw-r--r--mail-filter/gld/Manifest1
-rw-r--r--mail-filter/gld/files/gld.rc23
-rw-r--r--mail-filter/gld/files/tables.sql15
-rw-r--r--mail-filter/gld/gld-1.7-r2.ebuild77
-rw-r--r--mail-filter/gld/metadata.xml5
-rw-r--r--mail-filter/imapfilter/Manifest3
-rw-r--r--mail-filter/imapfilter/imapfilter-2.5.4.ebuild39
-rw-r--r--mail-filter/imapfilter/imapfilter-2.5.6.ebuild39
-rw-r--r--mail-filter/imapfilter/imapfilter-2.5.7.ebuild39
-rw-r--r--mail-filter/imapfilter/metadata.xml8
-rw-r--r--mail-filter/isbg/Manifest1
-rw-r--r--mail-filter/isbg/isbg-0.99-r1.ebuild39
-rw-r--r--mail-filter/isbg/metadata.xml11
-rw-r--r--mail-filter/libdkim/Manifest1
-rw-r--r--mail-filter/libdkim/files/debianize/Makefile.in93
-rw-r--r--mail-filter/libdkim/files/debianize/aclocal.m4171
-rw-r--r--mail-filter/libdkim/files/debianize/configure.ac39
-rw-r--r--mail-filter/libdkim/files/debianize/libdkim.pc.in12
-rw-r--r--mail-filter/libdkim/files/debianize/libdkim.ver4
-rw-r--r--mail-filter/libdkim/files/libdkim-extra-options.patch87
-rw-r--r--mail-filter/libdkim/files/patches/fix_warnings.patch293
-rw-r--r--mail-filter/libdkim/files/patches/series2
-rw-r--r--mail-filter/libdkim/files/patches/strtok_r.patch119
-rw-r--r--mail-filter/libdkim/libdkim-1.0.21-r1.ebuild40
-rw-r--r--mail-filter/libdkim/libdkim-1.0.21-r2.ebuild51
-rw-r--r--mail-filter/libdkim/metadata.xml19
-rw-r--r--mail-filter/libmilter/Manifest1
-rw-r--r--mail-filter/libmilter/files/gentoo.config.m45
-rw-r--r--mail-filter/libmilter/files/libmilter-build-system.patch89
-rw-r--r--mail-filter/libmilter/files/libmilter-sharedlib.patch55
-rw-r--r--mail-filter/libmilter/libmilter-1.0.2.ebuild67
-rw-r--r--mail-filter/libmilter/metadata.xml9
-rw-r--r--mail-filter/libsieve/Manifest1
-rw-r--r--mail-filter/libsieve/libsieve-2.2.7.ebuild26
-rw-r--r--mail-filter/libsieve/metadata.xml16
-rw-r--r--mail-filter/libspf2/Manifest2
-rw-r--r--mail-filter/libspf2/files/libspf2-1.2.9-ipv6.patch61
-rw-r--r--mail-filter/libspf2/libspf2-1.2.10.ebuild45
-rw-r--r--mail-filter/libspf2/libspf2-1.2.9-r3.ebuild43
-rw-r--r--mail-filter/libspf2/metadata.xml6
-rw-r--r--mail-filter/libsrs2/Manifest1
-rw-r--r--mail-filter/libsrs2/files/libsrs2-1.0.18-parallel-make.diff13
-rw-r--r--mail-filter/libsrs2/libsrs2-1.0.18.ebuild34
-rw-r--r--mail-filter/libsrs2/metadata.xml14
-rw-r--r--mail-filter/libsrs_alt/Manifest1
-rw-r--r--mail-filter/libsrs_alt/files/libsrs_alt-1.0-ftime.patch12
-rw-r--r--mail-filter/libsrs_alt/libsrs_alt-1.0.ebuild44
-rw-r--r--mail-filter/libsrs_alt/metadata.xml11
-rw-r--r--mail-filter/maildrop/Manifest1
-rw-r--r--mail-filter/maildrop/files/maildrop-1.8.1-disable-fam.patch56
-rw-r--r--mail-filter/maildrop/files/maildrop-2.5.1-db.patch63
-rw-r--r--mail-filter/maildrop/files/maildrop-testsuite.patch67
-rw-r--r--mail-filter/maildrop/files/maildroprc3
-rw-r--r--mail-filter/maildrop/maildrop-2.6.0.ebuild141
-rw-r--r--mail-filter/maildrop/metadata.xml13
-rw-r--r--mail-filter/mailfilter/Manifest1
-rw-r--r--mail-filter/mailfilter/files/0.8.2-gcc44.patch26
-rw-r--r--mail-filter/mailfilter/files/0.8.2-gcc46.patch20
-rw-r--r--mail-filter/mailfilter/files/0.8.2-openssl-1.patch16
-rw-r--r--mail-filter/mailfilter/files/rcfile.example1127
-rw-r--r--mail-filter/mailfilter/files/rcfile.example2133
-rw-r--r--mail-filter/mailfilter/mailfilter-0.8.2.ebuild34
-rw-r--r--mail-filter/mailfilter/metadata.xml8
-rw-r--r--mail-filter/mapson/Manifest1
-rw-r--r--mail-filter/mapson/mapson-3.3.ebuild38
-rw-r--r--mail-filter/mapson/metadata.xml8
-rw-r--r--mail-filter/metadata.xml40
-rw-r--r--mail-filter/milter-regex/Manifest1
-rw-r--r--mail-filter/milter-regex/files/milter-regex-1.7-gentoo.patch52
-rw-r--r--mail-filter/milter-regex/files/milter-regex-1.7-rules.patch11
-rw-r--r--mail-filter/milter-regex/files/milter-regex-1.7-yacc.patch12
-rw-r--r--mail-filter/milter-regex/files/milter-regex-1.8-gentoo.patch129
-rw-r--r--mail-filter/milter-regex/files/milter-regex-1.8-rules.patch12
-rw-r--r--mail-filter/milter-regex/files/milter-regex-1.9-gentoo.patch38
-rw-r--r--mail-filter/milter-regex/files/milter-regex-conf8
-rw-r--r--mail-filter/milter-regex/files/milter-regex-init42
-rw-r--r--mail-filter/milter-regex/metadata.xml7
-rw-r--r--mail-filter/milter-regex/milter-regex-1.9.ebuild61
-rw-r--r--mail-filter/mimedefang/Manifest3
-rw-r--r--mail-filter/mimedefang/files/mimedefang-2.72-ldflags.patch38
-rw-r--r--mail-filter/mimedefang/files/mimedefang.conf131
-rw-r--r--mail-filter/mimedefang/files/mimedefang.init102
-rw-r--r--mail-filter/mimedefang/metadata.xml9
-rw-r--r--mail-filter/mimedefang/mimedefang-2.73.ebuild65
-rw-r--r--mail-filter/mimedefang/mimedefang-2.74.ebuild63
-rw-r--r--mail-filter/mimedefang/mimedefang-2.75.ebuild63
-rw-r--r--mail-filter/normalizemime/Manifest1
-rw-r--r--mail-filter/normalizemime/metadata.xml5
-rw-r--r--mail-filter/normalizemime/normalizemime-1.19.ebuild23
-rw-r--r--mail-filter/opendkim/Manifest5
-rw-r--r--mail-filter/opendkim/files/opendkim.init.r356
-rw-r--r--mail-filter/opendkim/files/opendkim.service11
-rw-r--r--mail-filter/opendkim/metadata.xml31
-rw-r--r--mail-filter/opendkim/opendkim-2.10.0.ebuild196
-rw-r--r--mail-filter/opendkim/opendkim-2.10.2.ebuild196
-rw-r--r--mail-filter/opendkim/opendkim-2.10.3.ebuild196
-rw-r--r--mail-filter/opendkim/opendkim-2.9.2-r1.ebuild197
-rw-r--r--mail-filter/opendkim/opendkim-2.9.3.ebuild197
-rw-r--r--mail-filter/opendmarc/Manifest3
-rw-r--r--mail-filter/opendmarc/files/opendmarc.confd3
-rw-r--r--mail-filter/opendmarc/files/opendmarc.initd51
-rw-r--r--mail-filter/opendmarc/metadata.xml15
-rw-r--r--mail-filter/opendmarc/opendmarc-1.1.3.ebuild25
-rw-r--r--mail-filter/opendmarc/opendmarc-1.3.0.ebuild54
-rw-r--r--mail-filter/opendmarc/opendmarc-1.3.1.ebuild54
-rw-r--r--mail-filter/opensmtpd-extras/Manifest1
-rw-r--r--mail-filter/opensmtpd-extras/metadata.xml46
-rw-r--r--mail-filter/opensmtpd-extras/opensmtpd-extras-5.4.5.201506020835.ebuild91
-rw-r--r--mail-filter/p3scan/Manifest2
-rw-r--r--mail-filter/p3scan/files/p3scan-ocreat.patch11
-rw-r--r--mail-filter/p3scan/files/p3scan.init28
-rw-r--r--mail-filter/p3scan/files/p3scan.init-r135
-rw-r--r--mail-filter/p3scan/metadata.xml9
-rw-r--r--mail-filter/p3scan/p3scan-2.3.1.ebuild78
-rw-r--r--mail-filter/p3scan/p3scan-2.3.2-r1.ebuild101
-rw-r--r--mail-filter/p3scan/p3scan-2.3.2-r2.ebuild94
-rw-r--r--mail-filter/policyd-weight/Manifest1
-rw-r--r--mail-filter/policyd-weight/files/policyd-weight.init.d-r129
-rw-r--r--mail-filter/policyd-weight/metadata.xml15
-rw-r--r--mail-filter/policyd-weight/policyd-weight-0.1.15.2-r1.ebuild43
-rw-r--r--mail-filter/policyd/Manifest1
-rw-r--r--mail-filter/policyd/files/policyd-cleanup.cron2
-rw-r--r--mail-filter/policyd/files/policyd-makefile.patch39
-rw-r--r--mail-filter/policyd/files/policyd-post182.patch52
-rw-r--r--mail-filter/policyd/files/policyd.confd2
-rw-r--r--mail-filter/policyd/files/policyd.rc22
-rw-r--r--mail-filter/policyd/metadata.xml5
-rw-r--r--mail-filter/policyd/policyd-1.82-r1.ebuild75
-rw-r--r--mail-filter/popfile/Manifest1
-rw-r--r--mail-filter/popfile/files/popfile33
-rw-r--r--mail-filter/popfile/metadata.xml8
-rw-r--r--mail-filter/popfile/popfile-1.1.3.ebuild55
-rw-r--r--mail-filter/postfwd/Manifest1
-rw-r--r--mail-filter/postfwd/files/postfwd.conf18
-rw-r--r--mail-filter/postfwd/files/postfwd.init28
-rw-r--r--mail-filter/postfwd/files/postfwd2.example.cf154
-rw-r--r--mail-filter/postfwd/metadata.xml32
-rw-r--r--mail-filter/postfwd/postfwd-1.35-r2.ebuild87
-rw-r--r--mail-filter/postgrey/Manifest2
-rw-r--r--mail-filter/postgrey/files/postgrey-1.34-perl-5.18.patch33
-rw-r--r--mail-filter/postgrey/files/postgrey-1.34-r3.rc.new101
-rw-r--r--mail-filter/postgrey/files/postgrey.conf.new55
-rw-r--r--mail-filter/postgrey/files/postgrey.rc.new101
-rw-r--r--mail-filter/postgrey/files/targrey-0.31-postgrey-1.34.patch202
-rw-r--r--mail-filter/postgrey/metadata.xml18
-rw-r--r--mail-filter/postgrey/postgrey-1.34-r1.ebuild68
-rw-r--r--mail-filter/postgrey/postgrey-1.34-r2.ebuild69
-rw-r--r--mail-filter/postgrey/postgrey-1.34-r3.ebuild71
-rw-r--r--mail-filter/postgrey/postgrey-1.34.ebuild62
-rw-r--r--mail-filter/postgrey/postgrey-1.35-r1.ebuild71
-rw-r--r--mail-filter/postgrey/postgrey-1.35.ebuild70
-rw-r--r--mail-filter/procmail-lib/Manifest2
-rw-r--r--mail-filter/procmail-lib/metadata.xml8
-rw-r--r--mail-filter/procmail-lib/procmail-lib-20081108.ebuild24
-rw-r--r--mail-filter/procmail-lib/procmail-lib-20091202.ebuild24
-rw-r--r--mail-filter/procmail/Manifest1
-rw-r--r--mail-filter/procmail/files/gentoo-maildir3.diff12
-rw-r--r--mail-filter/procmail/files/procmail-3.22-glibc-2.10.patch70
-rw-r--r--mail-filter/procmail/files/procmail-3.22-interix.patch16
-rw-r--r--mail-filter/procmail/files/procmail-comsat-segfault.diff20
-rw-r--r--mail-filter/procmail/files/procmail-lazy-bindings.diff16
-rw-r--r--mail-filter/procmail/files/procmail-maxprocs-fix.diff11
-rw-r--r--mail-filter/procmail/files/procmail-pipealloc.diff21
-rw-r--r--mail-filter/procmail/files/procmail-prefix.patch155
-rw-r--r--mail-filter/procmail/metadata.xml5
-rw-r--r--mail-filter/procmail/procmail-3.22-r10.ebuild111
-rw-r--r--mail-filter/pypolicyd-spf/Manifest4
-rw-r--r--mail-filter/pypolicyd-spf/metadata.xml10
-rw-r--r--mail-filter/pypolicyd-spf/pypolicyd-spf-1.1.2.ebuild22
-rw-r--r--mail-filter/pypolicyd-spf/pypolicyd-spf-1.1.ebuild25
-rw-r--r--mail-filter/pypolicyd-spf/pypolicyd-spf-1.2-r1.ebuild56
-rw-r--r--mail-filter/pypolicyd-spf/pypolicyd-spf-1.3.1.ebuild59
-rw-r--r--mail-filter/qmail-scanner/Manifest8
-rw-r--r--mail-filter/qmail-scanner/files/qmail-scanner-2.05.logrotate4
-rw-r--r--mail-filter/qmail-scanner/files/qmail-scanner-2.06.logrotate4
-rw-r--r--mail-filter/qmail-scanner/files/qmail-scanner-2.08-disable-suid-check.patch17
-rw-r--r--mail-filter/qmail-scanner/files/qmail-scanner-2.08.logrotate4
-rw-r--r--mail-filter/qmail-scanner/files/qmail-scanner-queue.pl.patch8
-rw-r--r--mail-filter/qmail-scanner/files/qmailscanner.cronjob2
-rw-r--r--mail-filter/qmail-scanner/files/qmailscanner.logrotate4
-rw-r--r--mail-filter/qmail-scanner/metadata.xml12
-rw-r--r--mail-filter/qmail-scanner/qmail-scanner-1.25-r1.ebuild164
-rw-r--r--mail-filter/qmail-scanner/qmail-scanner-2.05.ebuild191
-rw-r--r--mail-filter/qmail-scanner/qmail-scanner-2.06.ebuild193
-rw-r--r--mail-filter/qmail-scanner/qmail-scanner-2.08.ebuild194
-rw-r--r--mail-filter/razor/Manifest1
-rw-r--r--mail-filter/razor/files/no-install-razor-agents.patch11
-rw-r--r--mail-filter/razor/files/razor-2.85-cosmetic-pv-fix.patch22
-rw-r--r--mail-filter/razor/files/razor-2.85-use-sha-not-sha1.patch119
-rw-r--r--mail-filter/razor/metadata.xml17
-rw-r--r--mail-filter/razor/razor-2.85-r2.ebuild79
-rw-r--r--mail-filter/rblcheck/Manifest1
-rw-r--r--mail-filter/rblcheck/files/rblcheck-1.5-configure.patch20
-rw-r--r--mail-filter/rblcheck/metadata.xml8
-rw-r--r--mail-filter/rblcheck/rblcheck-1.5-r1.ebuild30
-rw-r--r--mail-filter/rblcheck/rblcheck-1.5-r2.ebuild30
-rw-r--r--mail-filter/scmail/Manifest1
-rw-r--r--mail-filter/scmail/files/scmail-doc-encoding.diff28
-rw-r--r--mail-filter/scmail/files/scmail-gauche-0.9.diff35
-rw-r--r--mail-filter/scmail/metadata.xml7
-rw-r--r--mail-filter/scmail/scmail-1.3.ebuild35
-rw-r--r--mail-filter/sid-milter/Manifest1
-rw-r--r--mail-filter/sid-milter/files/gentoo-config.m46
-rw-r--r--mail-filter/sid-milter/files/sid-filter.conf5
-rwxr-xr-xmail-filter/sid-milter/files/sid-filter.init-r189
-rw-r--r--mail-filter/sid-milter/files/sid-milter-1.0.0-as-needed.patch21
-rw-r--r--mail-filter/sid-milter/files/sid-milter-1.0.0-nopra_on_spf1.patch57
-rw-r--r--mail-filter/sid-milter/metadata.xml11
-rw-r--r--mail-filter/sid-milter/sid-milter-1.0.0-r6.ebuild65
-rw-r--r--mail-filter/sieve-connect/Manifest1
-rw-r--r--mail-filter/sieve-connect/metadata.xml44
-rw-r--r--mail-filter/sieve-connect/sieve-connect-0.87.ebuild34
-rw-r--r--mail-filter/spamass-milter/Manifest1
-rw-r--r--mail-filter/spamass-milter/files/README.gentoo52
-rw-r--r--mail-filter/spamass-milter/files/spamass-milter-auth_users.patch92
-rw-r--r--mail-filter/spamass-milter/files/spamass-milter.conf330
-rw-r--r--mail-filter/spamass-milter/files/spamass-milter.rc455
-rw-r--r--mail-filter/spamass-milter/metadata.xml5
-rw-r--r--mail-filter/spamass-milter/spamass-milter-0.3.2.ebuild42
-rw-r--r--mail-filter/spamassassin-botnet/Manifest1
-rw-r--r--mail-filter/spamassassin-botnet/metadata.xml17
-rw-r--r--mail-filter/spamassassin-botnet/spamassassin-botnet-0.8-r1.ebuild50
-rw-r--r--mail-filter/spamassassin/Manifest2
-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.service14
-rw-r--r--mail-filter/spamassassin/files/spamassassin.service-r115
-rw-r--r--mail-filter/spamassassin/files/spamassassin.service.conf10
-rw-r--r--mail-filter/spamassassin/metadata.xml14
-rw-r--r--mail-filter/spamassassin/spamassassin-3.4.0.ebuild212
-rw-r--r--mail-filter/spamassassin/spamassassin-3.4.1.ebuild221
-rw-r--r--mail-filter/spambayes/Manifest3
-rw-r--r--mail-filter/spambayes/files/bayescustomize.ini171
-rw-r--r--mail-filter/spambayes/files/spambayespop3proxy.rc23
-rw-r--r--mail-filter/spambayes/metadata.xml12
-rw-r--r--mail-filter/spambayes/spambayes-1.1_alpha6-r2.ebuild41
-rw-r--r--mail-filter/spambayes/spambayes-1.1_beta1.ebuild41
-rw-r--r--mail-filter/spambayes/spambayes-1.1_beta2.ebuild43
-rw-r--r--mail-filter/spamdyke/Manifest1
-rw-r--r--mail-filter/spamdyke/files/spamdyke-4.3.0-gcc46.patch10
-rw-r--r--mail-filter/spamdyke/metadata.xml18
-rw-r--r--mail-filter/spamdyke/spamdyke-4.3.0.ebuild77
-rw-r--r--mail-filter/spampd/Manifest2
-rw-r--r--mail-filter/spampd/files/conf15
-rw-r--r--mail-filter/spampd/files/init24
-rwxr-xr-xmail-filter/spampd/files/init-r124
-rw-r--r--mail-filter/spampd/metadata.xml8
-rw-r--r--mail-filter/spampd/spampd-2.30.ebuild24
-rw-r--r--mail-filter/spampd/spampd-2.42.ebuild26
-rw-r--r--mail-filter/spamprobe/Manifest1
-rw-r--r--mail-filter/spamprobe/files/spamprobe-1.4b-gcc43.patch150
-rw-r--r--mail-filter/spamprobe/files/spamprobe-1.4d+db-5.0.patch13
-rw-r--r--mail-filter/spamprobe/files/spamprobe-1.4d-gcc47.patch28
-rw-r--r--mail-filter/spamprobe/files/spamprobe-1.4d-libpng14.patch23
-rw-r--r--mail-filter/spamprobe/metadata.xml8
-rw-r--r--mail-filter/spamprobe/spamprobe-1.4d.ebuild42
-rw-r--r--mail-filter/sqlgrey/Manifest1
-rw-r--r--mail-filter/sqlgrey/files/sqlgrey-1.7.6-init.patch18
-rw-r--r--mail-filter/sqlgrey/files/sqlgrey.service9
-rw-r--r--mail-filter/sqlgrey/metadata.xml10
-rw-r--r--mail-filter/sqlgrey/sqlgrey-1.7.6-r1.ebuild255
-rw-r--r--mail-filter/tmda/Manifest1
-rw-r--r--mail-filter/tmda/files/tmda-1.0-non-interactive-tty.patch31
-rw-r--r--mail-filter/tmda/metadata.xml8
-rw-r--r--mail-filter/tmda/tmda-1.1.12.ebuild73
-rw-r--r--mail-filter/zdkimfilter/Manifest1
-rw-r--r--mail-filter/zdkimfilter/metadata.xml20
-rw-r--r--mail-filter/zdkimfilter/zdkimfilter-1.1.ebuild48
382 files changed, 17020 insertions, 0 deletions
diff --git a/mail-filter/MailScanner/MailScanner-4.84.5.2.ebuild b/mail-filter/MailScanner/MailScanner-4.84.5.2.ebuild
new file mode 100644
index 00000000000..701bb3ba3e2
--- /dev/null
+++ b/mail-filter/MailScanner/MailScanner-4.84.5.2.ebuild
@@ -0,0 +1,321 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils versionator multilib
+
+MY_PV=$(get_version_component_range 1-3 )
+MY_PVR=$(replace_version_separator 3 '-' )
+
+DESCRIPTION="Free Anti-Virus and Anti-Spam Filter"
+HOMEPAGE="http://www.mailscanner.info/"
+SRC_URI="http://www.mailscanner.info/files/4/tar/${PN}-install-${MY_PVR}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="clamav doc exim postfix spamassassin"
+
+DEPEND="dev-lang/perl"
+RDEPEND="${DEPEND}
+ dev-perl/Archive-Zip
+ virtual/perl-IO-Compress
+ dev-perl/Convert-BinHex
+ dev-perl/Convert-TNEF
+ dev-perl/DBD-SQLite
+ dev-perl/DBI
+ dev-perl/Filesys-Df
+ dev-perl/HTML-Parser
+ dev-perl/HTML-Tagset
+ dev-perl/IO-stringy
+ dev-perl/MIME-tools
+ dev-perl/MailTools
+ dev-perl/Net-CIDR
+ dev-perl/Net-DNS
+ dev-perl/OLE-StorageLite
+ dev-perl/Sys-Hostname-Long
+ dev-perl/TimeDate
+ net-mail/tnef
+ dev-perl/Sys-SigAction
+ virtual/perl-File-Spec
+ virtual/perl-File-Temp
+ virtual/perl-Getopt-Long
+ virtual/perl-Sys-Syslog
+ virtual/perl-MIME-Base64
+ postfix? ( mail-mta/postfix )
+ exim? ( !postfix? ( mail-mta/exim ) )
+ !postfix? ( !exim? ( mail-mta/sendmail ) )
+ clamav? ( app-antivirus/clamav )
+ spamassassin? ( mail-filter/spamassassin )"
+
+S="${WORKDIR}/${PN}-${MY_PVR}"
+BASE="/usr"
+
+src_unpack() {
+ unpack ${A}
+ unpack ./${PN}-install-${MY_PV}/perl-tar/${PN}-${MY_PVR}.tar.gz
+
+ # setup MTA
+ if use postfix ; then
+ RUNASUSER='postfix'
+ RUNASGROUP='postfix'
+ INQUEUE='/var/spool/postfix.in/deferred'
+ OUTQUEUE='/var/spool/postfix/incoming'
+ MTA='postfix'
+ SENDMAIL='/usr/lib/sendmail'
+ SENDMAIL2='/usr/lib/sendmail'
+ elif use exim ; then
+ RUNASUSER='mail'
+ RUNASGROUP='mail'
+ INQUEUE='/var/spool/exim.in/input'
+ OUTQUEUE='/var/spool/exim/input'
+ MTA='exim'
+ SENDMAIL='/usr/sbin/exim -oMr MailScanner'
+ SENDMAIL2='/usr/sbin/exim -C /etc/exim/exim_out.conf -oMr MailScanner'
+ else
+ # use sendmail as default, but we should add more as needed
+ # RUNASUSER='mail'
+ # RUNASGROUP='mail'
+ INQUEUE='/var/spool/mqueue.in'
+ OUTQUEUE='/var/spool/mqueue'
+ MTA='sendmail'
+ SENDMAIL='/usr/lib/sendmail'
+ SENDMAIL2='/usr/lib/sendmail'
+ fi
+
+ # setup virus scanner(s)
+ VIRUS_SCANNERS=""
+ use clamav && VIRUS_SCANNERS="clamav ${VIRUS_SCANNERS}"
+
+ if [ "$VIRUS_SCANNERS" == "" ]; then
+ VIRUS_SCANNERS="none"
+ VIRUS_SCANNING="no"
+ else
+ VIRUS_SCANNING="yes"
+ fi
+
+ sed -i \
+ -e "s/^\(Virus Scanning[ \t]*=\).*/\1 ${VIRUS_SCANNING}/" \
+ -e "s/^\(Virus Scanners[ \t]*=\).*/\1 ${VIRUS_SCANNERS}/" \
+ "${S}/etc/MailScanner.conf"
+
+ # setup spamassassin
+ if use spamassassin ; then
+ sed -i \
+ -e "s/^\(Use SpamAssassin[ \t]*=\).*$/\1 yes/" \
+ "${S}/etc/MailScanner.conf"
+ else
+ sed -i \
+ -e "s/^\(Use SpamAssassin[ \t]*=\).*$/\1 no/" \
+ "${S}/etc/MailScanner.conf"
+ fi
+
+ # update bin files
+ sed -i \
+ -e "s#msbindir=/opt/MailScanner/bin#msbindir=/usr/sbin#g" \
+ -e "s#config=/opt/MailScanner/etc/MailScanner.conf#config=/etc/MailScanner/MailScanner.conf#g" \
+ "${S}/bin/check_mailscanner"
+ for each in update_virus_scanners update_phishing_sites update_bad_phishing_sites ; do
+ sed -i \
+ -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
+ "${S}"/bin/${each}
+ done
+ sed -i \
+ -e "s#/etc/sysconfig/MailScanner#/etc/conf.d/MailScanner#g" \
+ "${S}"/bin/update_spamassassin
+ sed -i \
+ -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
+ -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
+ "${S}"/bin/MailScanner
+
+ # update cron files
+ sed -i \
+ -e "s#/opt/MailScanner/bin/check_mailscanner#/usr/sbin/check_MailScanner#g" \
+ "${S}"/bin/cron/check_MailScanner.cron
+ for cronfile in update_virus_scanners.cron update_{,bad_}phishing_sites.cron; do
+ sed -i \
+ -e "s#/etc/sysconfig/MailScanner#/etc/conf.d/mailscanner#g" \
+ -e "s#/opt/MailScanner/bin#/usr/sbin#g" \
+ "${S}"/bin/cron/${cronfile}
+ done
+
+ # Determine some things that may need to be changed in conf file
+ # (need to arrive at sensible replacement for yoursite)
+ YOURSITE=`dnsdomainname | sed -e "s/\./-/g"`
+ BASEBIN="${BASE}/sbin"
+
+ # ClamAV requires some specific changes to MailScanner.conf
+ # when mailscanner is running as root (i.e. sendmail)
+ if use clamav ; then
+ if [ "$MTA" == "sendmail" ] ; then
+ WORKGRP="clamav"
+ WORKPERM="0640"
+ else
+ WORKGRP=""
+ WORKPERM="0600"
+ fi
+ else
+ WORKGRP=""
+ WORKPERM="0600"
+ fi
+
+ # update conf files
+ sed -i \
+ -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
+ -e "s#/opt/MailScanner/bin#$BASEBIN#g" \
+ -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
+ -e "s#^\(Run As User[ \t]*=\).*#\1 $RUNASUSER#" \
+ -e "s#^\(Run As Group[ \t]*=\).*#\1 $RUNASGROUP#" \
+ -e "s#^\(Incoming Queue Dir[ \t]*=\).*#\1 $INQUEUE#" \
+ -e "s#^\(Outgoing Queue Dir[ \t]*=\).*#\1 $OUTQUEUE#" \
+ -e "s#^\(MTA[ \t]*=\).*#\1 $MTA#" \
+ -e "s/^#\(TNEF.*internal\)$/\1/" \
+ -e "s/^\(TNEF.*0000\)$/#\1/" \
+ -e "s#^\(PID file[ \t]=\).*#\1 /var/run/mailscanner.pid#" \
+ -e "s#^\(%org-name%\)[ \t]*=.*#\1 = ${YOURSITE}#" \
+ -e "s#^\(Sendmail[ \t]*=\).*#\1 ${SENDMAIL}#" \
+ -e "s#^\(Sendmail2[ \t]*=\).*#\1 ${SENDMAIL2}#" \
+ -e "s#^\(Incoming Work Group[ \t]*=\).*#\1 ${WORKGRP}#" \
+ -e "s#^\(Incoming Work Permissions[ \t]*=\).*#\1 ${WORKPERM}#" \
+ "${S}/etc/MailScanner.conf"
+
+ # update spam.assassin.prefs.conf
+ sed -i -e "s#YOURDOMAIN-COM#${YOURSITE}#" "${S}/etc/spam.assassin.prefs.conf"
+
+ # net-mail/clamav net-mail/f-prot package compatibility
+ sed -i \
+ -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#" \
+ -e 's#^\(clamav\t.*/usr\)/local$#\1#' \
+ -e 's#^\(f-prot.*\)/usr/local/f-prot$#\1/opt/f-prot#' \
+ "${S}/etc/virus.scanners.conf"
+
+ # update lib files
+ sed -i \
+ -e "s#/opt/MailScanner/bin#$BASEBIN#g" \
+ -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
+ -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
+ "${S}/lib/MailScanner/ConfigDefs.pl"
+ sed -i \
+ -e "s#/opt/MailScanner/bin#$BASEBIN#g" \
+ -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
+ -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
+ "${S}/bin/MailScanner"
+ sed -i \
+ -e "s#/opt/MailScanner/bin#$BASEBIN#g" \
+ -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
+ -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
+ "${S}/bin/update_virus_scanners"
+ sed -i \
+ -e "s#/opt/MailScanner/bin#$BASEBIN#g" \
+ -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
+ -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
+ "${S}/bin/mailscanner_create_locks"
+ sed -i \
+ -e "s#/etc/MailScanner#/etc/MailScanner#g" \
+ "${S}/lib/MailScanner/CustomConfig.pm"
+
+ # finally, change MailScanner.conf into MailScanner.conf.sample
+ cp "${S}/etc/MailScanner.conf" "${S}/etc/MailScanner.conf.${MY_PV}"
+ mv "${S}/etc/MailScanner.conf" "${S}/etc/MailScanner.conf.sample"
+
+}
+
+src_install() {
+ exeinto ${BASE}/sbin
+ doexe bin/MailScanner
+ newexe bin/check_mailscanner check_MailScanner
+ doexe bin/d2mbox bin/df2mbox
+ doexe bin/update_virus_scanners
+ doexe bin/upgrade_MailScanner_conf
+ doexe bin/mailscanner_create_locks
+ doexe bin/Quick.Peek
+ doexe bin/update_bad_phishing_sites bin/update_phishing_sites
+ newexe bin/Sophos.install.linux Sophos.install
+
+ insinto /etc/MailScanner/conf.d
+ doins etc/conf.d/*
+
+ insinto /etc/MailScanner
+ doins etc/*.conf
+ doins etc/mailscanner.conf.with.mcp
+ doins etc/MailScanner.conf.${MY_PV}
+ doins etc/MailScanner.conf.sample
+
+ insinto /etc/MailScanner/rules
+ doins etc/rules/*
+ insinto /etc/MailScanner/mcp
+ doins etc/mcp/*
+
+ insinto /etc/MailScanner
+ doins -r etc/reports
+
+ insinto ${BASE}/$(get_libdir)/MailScanner
+ doins lib/*.prf
+
+ exeinto ${BASE}/$(get_libdir)/MailScanner
+ doexe lib/*-wrapper
+ doexe lib/*-autoupdate
+ doexe lib/*-autoupdate.old
+ doexe lib/*.pm
+
+ exeinto ${BASE}/$(get_libdir)/MailScanner/MailScanner
+ doexe lib/MailScanner/*.pm
+ doexe lib/MailScanner/*.pl
+
+ exeinto ${BASE}/$(get_libdir)/MailScanner/MailScanner/CustomFunctions
+ doexe lib/MailScanner/CustomFunctions/MyExample.pm
+
+ newinitd "${FILESDIR}"/initd.mailscanner MailScanner
+ newconfd "${FILESDIR}"/confd.mailscanner MailScanner
+
+ #Set up cron jobs
+ exeinto /etc/cron.hourly
+ newexe "${S}/bin/cron/check_MailScanner.cron" check_MailScanner
+ for cronfile in update_{virus_scanners,{bad_,}phishing_sites}; do
+ newexe "${S}/bin/cron/${cronfile}.cron" ${cronfile}
+ done
+
+ exeinto /etc/cron.daily
+ newexe "${S}/bin/cron/clean.quarantine.cron" clean.quarantine
+
+ dodoc README
+ insinto /usr/share/doc/${PF}
+ doins MailScanner.conf.index.html
+
+ keepdir /var/spool/MailScanner/incoming
+ keepdir /var/spool/MailScanner/quarantine
+ keepdir /var/spool/MailScanner/spamassassin
+ keepdir /var/spool/MailScanner/archive
+ keepdir ${BASE}/var
+
+ if use postfix ; then
+ chown -R postfix:postfix "${D}/var/spool/MailScanner/"
+ elif use exim ; then
+ chown -R mail:mail "${D}/var/spool/MailScanner/"
+ else
+ keepdir /var/spool/mqueue.in
+ fi
+ use spamassassin && dosym /etc/MailScanner/spam.assassin.prefs.conf /etc/mail/spamassassin/mailscanner.cf
+
+}
+
+pkg_postinst() {
+ if use postfix; then
+ elog "Note that postfix 2.4 now supports HOLD of messages"
+ elog "and reinjection without second postfix instance"
+ elog "Inbound path is now ${ROOT}var/spool/postfix/hold"
+ elog
+ elog "See http://mailscanner.info/postfix.html for details"
+ fi
+
+ if [ -f "/etc/MailScanner/MailScanner.conf" ]; then
+ einfo "Upgrading the MailScanner.conf file"
+ cp /etc/MailScanner/MailScanner.conf /etc/MailScanner/MailScanner.conf.pre_upgrade.${MY_PV}
+ /usr/sbin/upgrade_MailScanner_conf \
+ /etc/MailScanner/MailScanner.conf.pre_upgrade.${MY_PV} \
+ /etc/MailScanner/MailScanner.conf.${MY_PV} \
+ > /etc/MailScanner/MailScanner.conf 2> /dev/null
+ else
+ cp /etc/MailScanner/MailScanner.conf.sample /etc/MailScanner/MailScanner.conf
+ fi
+}
diff --git a/mail-filter/MailScanner/Manifest b/mail-filter/MailScanner/Manifest
new file mode 100644
index 00000000000..75678dd092e
--- /dev/null
+++ b/mail-filter/MailScanner/Manifest
@@ -0,0 +1 @@
+DIST MailScanner-install-4.84.5-2.tar.gz 9510489 SHA256 3467a53159cc95a8b4f93a326a59e2d3acc0ad6f90f048f048742fe13ac741f1 SHA512 d9d082e29ddb6eae4f30069298507805a7674c264bf8edad3db3322fa0f2c2ad4539c0c2213c6fcbee11b7c57a36218c1d24243077358bac98e7ae07f7ee506f WHIRLPOOL a253706f33dbc3925e49d7bb0740fab39f87c690240c043eb10cf8d57ea938fd1e002fcec9d8f1c026003e07df01b724d2b696a6224a6cf52e8afc0e1d175d59
diff --git a/mail-filter/MailScanner/files/confd.mailscanner b/mail-filter/MailScanner/files/confd.mailscanner
new file mode 100644
index 00000000000..144d0d478fc
--- /dev/null
+++ b/mail-filter/MailScanner/files/confd.mailscanner
@@ -0,0 +1,4 @@
+#
+
+UPDATEMAXDELAY=600 # Maximum delay before running cron job to avoid server peaks
+RESTART_DELAY=10 # time to wait before restarting mailscanner
diff --git a/mail-filter/MailScanner/files/initd.mailscanner b/mail-filter/MailScanner/files/initd.mailscanner
new file mode 100644
index 00000000000..accda9ef26f
--- /dev/null
+++ b/mail-filter/MailScanner/files/initd.mailscanner
@@ -0,0 +1,48 @@
+#!/sbin/runscript
+
+opts="${opts} reload"
+
+depend() {
+ need net mta
+ use logger dns
+}
+
+start() {
+ ebegin "Starting MailScanner"
+ #/usr/sbin/check_MailScanner >/dev/null
+ start-stop-daemon --start --pidfile /var/run/${SVCNAME}.pid \
+ --exec /usr/sbin/MailScanner -- /etc/MailScanner/MailScanner.conf ${OPT} > /var/run/${SVCNAME}.pid
+ eend $?
+
+ RETVAL=$?
+ [ ${RETVAL} -eq 0 ] && touch /var/lock/subsys/MailScanner
+ [ ${RETVAL} -eq 0 ] && rm -f /var/lock/subsys/MailScanner.off
+ eend ${RETVAL}
+}
+
+stop() {
+ ebegin "Stopping MailScanner"
+ start-stop-daemon --stop --quiet --pidfile /var/run/${SVCNAME}.pid
+ RETVAL=$?
+ [ ${RETVAL} -eq 0 ] && rm -f /var/lock/subsys/MailScanner
+ [ ${RETVAL} -eq 0 ] && touch /var/lock/subsys/MailScanner.off
+ eend ${RETVAL}
+}
+
+reload() {
+ ebegin "Reloading MailScanner workers:"
+ pid=`pidof -x MailScanner`
+ if [ -n "$pid" ] ;
+ then
+ /bin/kill -HUP $pid
+ eend $?
+ else
+ eend 1
+ fi
+}
+
+restart() {
+ svc_stop
+ sleep ${RESTART_DELAY}
+ svc_start
+}
diff --git a/mail-filter/MailScanner/metadata.xml b/mail-filter/MailScanner/metadata.xml
new file mode 100644
index 00000000000..c7e2a08a0fe
--- /dev/null
+++ b/mail-filter/MailScanner/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+</maintainer>
+<use>
+ <flag name='exim'>Set <pkg>mail-mta</pkg> to used MTA</flag>
+ <flag name='postfix'>Set <pkg>mail-mta/postfix</pkg> to used MTA</flag>
+ <flag name='spamassassin'>Enable usage of
+ <pkg>mail-filter/spamassassin</pkg> for spam protection</flag>
+</use>
+</pkgmetadata>
diff --git a/mail-filter/amavisd-milter/Manifest b/mail-filter/amavisd-milter/Manifest
new file mode 100644
index 00000000000..c70da09fd37
--- /dev/null
+++ b/mail-filter/amavisd-milter/Manifest
@@ -0,0 +1,2 @@
+DIST amavisd-milter-1.5.0.tar.gz 175759 SHA256 cef897e2c172272d52a6e5d9415b25252bf669f0481f9bdf24e95d3071c5a2c5 SHA512 ef206cd2c64cf48edb8a679b92a960451e0edbec11e0c207942bf6f435f7d14538a409d8197774ea4bbf63f27ed73d52a7c51531155be6d8724981b5dd9e0037 WHIRLPOOL d48dfd540fdcae728425f0209f6fe2601a1bdbac9299d346ccc06f56da00f10b6c506b15129d93df1bf670a861afc25d40d1344369377f1ff0ee23cf90f40f39
+DIST amavisd-milter-1.6.0.tar.gz 187994 SHA256 c195750d42df41f4642a26b020fec1ba5752a997bcb366c70cd384bc560a98cd SHA512 2e0b39b733f88742fcb2f4e884e528b70731ad5950bd56d3af1391d666dc018d2f6c1ad4212e787872a503bccbc65c52d55ae195c384e9333e4f39d25b1d1a34 WHIRLPOOL ab1c0aee71597b0c5ccd3375a0df3ffd81ee24a69946b02d8e37a376ef1dca259c519338d5d7a391dd0947de907192d740ce8797f3a58b546461564dcc238d95
diff --git a/mail-filter/amavisd-milter/amavisd-milter-1.5.0-r1.ebuild b/mail-filter/amavisd-milter/amavisd-milter-1.5.0-r1.ebuild
new file mode 100644
index 00000000000..0725afd9dd4
--- /dev/null
+++ b/mail-filter/amavisd-milter/amavisd-milter-1.5.0-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="sendmail milter for amavisd-new"
+HOMEPAGE="http://amavisd-milter.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail )
+ mail-filter/amavisd-new"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch_user
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc AUTHORS CHANGES INSTALL README TODO
+
+ newinitd "${FILESDIR}/amavisd-milter.initd" amavisd-milter
+ newconfd "${FILESDIR}/amavisd-milter.confd" amavisd-milter
+}
diff --git a/mail-filter/amavisd-milter/amavisd-milter-1.5.0.ebuild b/mail-filter/amavisd-milter/amavisd-milter-1.5.0.ebuild
new file mode 100644
index 00000000000..78a48363cbb
--- /dev/null
+++ b/mail-filter/amavisd-milter/amavisd-milter-1.5.0.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="sendmail milter for amavisd-new"
+HOMEPAGE="http://amavisd-milter.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail )
+ mail-filter/amavisd-new"
+RDEPEND="${DEPEND}"
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc AUTHORS CHANGES INSTALL README TODO
+
+ newinitd "${FILESDIR}/amavisd-milter.initd" amavisd-milter
+ newconfd "${FILESDIR}/amavisd-milter.confd" amavisd-milter
+}
diff --git a/mail-filter/amavisd-milter/amavisd-milter-1.6.0-r1.ebuild b/mail-filter/amavisd-milter/amavisd-milter-1.6.0-r1.ebuild
new file mode 100644
index 00000000000..d4553d734ae
--- /dev/null
+++ b/mail-filter/amavisd-milter/amavisd-milter-1.6.0-r1.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="sendmail milter for amavisd-new"
+HOMEPAGE="http://amavisd-milter.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail )
+ mail-filter/amavisd-new"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-policybank.patch"
+ epatch_user
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc AUTHORS CHANGES INSTALL README TODO
+
+ newinitd "${FILESDIR}/amavisd-milter.initd" amavisd-milter
+ newconfd "${FILESDIR}/amavisd-milter.confd" amavisd-milter
+}
diff --git a/mail-filter/amavisd-milter/amavisd-milter-1.6.0.ebuild b/mail-filter/amavisd-milter/amavisd-milter-1.6.0.ebuild
new file mode 100644
index 00000000000..f581076f55e
--- /dev/null
+++ b/mail-filter/amavisd-milter/amavisd-milter-1.6.0.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="sendmail milter for amavisd-new"
+HOMEPAGE="http://amavisd-milter.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail )
+ mail-filter/amavisd-new"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch_user
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc AUTHORS CHANGES INSTALL README TODO
+
+ newinitd "${FILESDIR}/amavisd-milter.initd" amavisd-milter
+ newconfd "${FILESDIR}/amavisd-milter.confd" amavisd-milter
+}
diff --git a/mail-filter/amavisd-milter/files/amavisd-milter-1.6.0-policybank.patch b/mail-filter/amavisd-milter/files/amavisd-milter-1.6.0-policybank.patch
new file mode 100644
index 00000000000..afbdefc55c8
--- /dev/null
+++ b/mail-filter/amavisd-milter/files/amavisd-milter-1.6.0-policybank.patch
@@ -0,0 +1,20 @@
+--- amavisd-milter/mlfi.c 22 Apr 2013 00:36:12 -0000 1.60
++++ amavisd-milter/mlfi.c 13 Jan 2015 17:00:47 -0000
+@@ -695,14 +695,14 @@
+ l = 0;
+ *mlfi->mlfi_amabuf = '\0';
+ if ((policybank_from_daemon_name == 1) && (mlfi->mlfi_daemon_name != NULL)) {
+- l += snprintfcat(0, mlfi->mlfi_amabuf, mlfi->mlfi_amabuf_length,
++ l += snprintfcat(l, mlfi->mlfi_amabuf, mlfi->mlfi_amabuf_length,
+ "%s", mlfi->mlfi_daemon_name);
+ }
+ if (auth_type != NULL) {
+ if (l > 0) {
+- l += snprintfcat(0, mlfi->mlfi_amabuf, mlfi->mlfi_amabuf_length, ",");
++ l += snprintfcat(l, mlfi->mlfi_amabuf, mlfi->mlfi_amabuf_length, ",");
+ }
+- l += snprintfcat(0, mlfi->mlfi_amabuf, mlfi->mlfi_amabuf_length,
++ l += snprintfcat(l, mlfi->mlfi_amabuf, mlfi->mlfi_amabuf_length,
+ "SMTP_AUTH,SMTP_AUTH_%s", auth_type);
+ if (auth_ssf != NULL && *auth_ssf != '\0') {
+ l += snprintfcat(l, mlfi->mlfi_amabuf, mlfi->mlfi_amabuf_length,
diff --git a/mail-filter/amavisd-milter/files/amavisd-milter.confd b/mail-filter/amavisd-milter/files/amavisd-milter.confd
new file mode 100644
index 00000000000..f2b0736851a
--- /dev/null
+++ b/mail-filter/amavisd-milter/files/amavisd-milter.confd
@@ -0,0 +1,14 @@
+# /etc/conf.d/amavisd-milter
+# Check amavisd-milter man page for more options.
+
+# Unix domain socket locations
+SOCKET="/var/amavis/amavisd-milter.sock"
+AM_SOCKET="/var/amavis/amavisd.sock"
+
+# Working directory
+AM_TMP="/var/amavis/tmp"
+
+# Pid file location
+PIDFILE="/var/amavis/amavisd-milter.pid"
+
+DOPTIONS="-s $SOCKET -p $PIDFILE -S $AM_SOCKET -w $AM_TMP"
diff --git a/mail-filter/amavisd-milter/files/amavisd-milter.initd b/mail-filter/amavisd-milter/files/amavisd-milter.initd
new file mode 100644
index 00000000000..726e84a6317
--- /dev/null
+++ b/mail-filter/amavisd-milter/files/amavisd-milter.initd
@@ -0,0 +1,30 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+NAME="amavisd-milter"
+DAEMON="/usr/sbin/${NAME}"
+
+depend() {
+ use logger dns amavis sendmail
+}
+
+start() {
+ ebegin "Starting ${NAME}"
+ start-stop-daemon --start --quiet --exec "${DAEMON}" -p "${PIDFILE}" --user amavis -- ${DOPTIONS}
+ eend $? "Failed to start ${NAME}"
+}
+
+stop() {
+ ebegin "Stopping ${NAME}"
+ start-stop-daemon --stop --name "${NAME}"
+ eend $? "Failed to stop ${NAME}"
+}
+
+restart() {
+ svc_stop
+ # needed to avoid potential mi_stop errors
+ sleep 4
+ svc_start
+}
diff --git a/mail-filter/amavisd-milter/metadata.xml b/mail-filter/amavisd-milter/metadata.xml
new file mode 100644
index 00000000000..00715a1e10f
--- /dev/null
+++ b/mail-filter/amavisd-milter/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <longdescription lang="en">
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">amavisd-milter</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/amavisd-new/Manifest b/mail-filter/amavisd-new/Manifest
new file mode 100644
index 00000000000..9967179f2f9
--- /dev/null
+++ b/mail-filter/amavisd-new/Manifest
@@ -0,0 +1,4 @@
+DIST amavisd-new-2.10.1.tar.xz 767716 SHA256 1d3d3f372d0888018b950ee19704c298b5d02e2c287ca2d5f1a785a078b6038f SHA512 1939cc60136fe37a078ebd6117a774bcc7ee34b68807472eb08ab15414749300925f74898131299fb051c539cc59d264003439a6307c9d0fa16971d02dab1ff9 WHIRLPOOL 81a7ed98075f9286516487b69dc011ec13a49b6aea1671aa46085c21373bd7cf8c9257999e61517fbf6f6d3f0aeade6748f4f20a31ef63a8f20df06b489a6274
+DIST amavisd-new-2.7.2.tar.gz 945448 SHA256 4665e0fb9a71f483f1123113a006291e37f744a5880f945ccf9fd34d51cb9275 SHA512 f707a5ac9d6acee2f9d144fda86fed92bbf33693858262ab0a95663da50f78a023102d9d50dd5a6a256ef6302a241f9c28d2b190e3efe2110c0eea15557ae756 WHIRLPOOL c0422d80b9dc11a7a2e9cb10092b7c97c02536aa852f70c566ab6e2e6a865b901ad24caf626b8b02ee64979bced7c25f03888827fd47ffbc4e733bb733e08c9e
+DIST amavisd-new-2.8.1.tar.xz 731816 SHA256 6e333a70adbd24ec52202700059fbf133e20b3c3bf5ec6f4bb10f9a2f25ea82e SHA512 a840b57513b8a7b18e15085016c273ba2fba5cceb76ef52c52aa2ca34e9257be78f8bb8ea350dbdac3b26d2aba8f5aae821c1c45f2d37bc6be04ff2efb9f3ade WHIRLPOOL 0d0ce9a1e8adae101d0aace45251c02118c8f4481e67ab1af7fb32843010ac9e0b9f8ab88f0769a27c1e74e297507efe53c3a6e8ce84c616e1beeaf281027044
+DIST amavisd-new-2.9.1.tar.xz 753076 SHA256 442d6c185c19fd1d3288ee7eb2ac102a7d541c4d6e1724cdaf369df6ca629ba0 SHA512 6829a769f50498aaec4fd5c198059f828e9ba90223083e439caa9d2bd19006e0cff8ae7b1e2416009bd2514aae4428598142e86a63260b5292c15b515792a7af WHIRLPOOL 82c8630323e718b5fe9eccf38d592f6539cc56616f2eb0bea590e4d0b8ad70f30cfb2a7c13afddd1f838a26cd82cc6338199c3f9e2a402f1c67e1fe240deaed1
diff --git a/mail-filter/amavisd-new/amavisd-new-2.10.1-r1.ebuild b/mail-filter/amavisd-new/amavisd-new-2.10.1-r1.ebuild
new file mode 100644
index 00000000000..cd552ed48c4
--- /dev/null
+++ b/mail-filter/amavisd-new/amavisd-new-2.10.1-r1.ebuild
@@ -0,0 +1,181 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils systemd user
+
+MY_P="${P/_/-}"
+DESCRIPTION="High-performance interface between the MTA and content checkers"
+HOMEPAGE="http://www.ijs.si/software/amavisd/"
+SRC_URI="http://www.ijs.si/software/amavisd/${MY_P}.tar.xz"
+
+LICENSE="GPL-2 BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc64 ~sparc ~x86"
+IUSE="clamav courier dkim ldap mysql postgres qmail razor snmp spamassassin zmq"
+
+DEPEND=">=sys-apps/sed-4
+ >=dev-lang/perl-5.8.2"
+
+RDEPEND="${DEPEND}
+ >=sys-apps/coreutils-5.0-r3
+ app-arch/cpio
+ app-arch/gzip
+ app-arch/bzip2
+ app-arch/arc
+ app-arch/cabextract
+ app-arch/freeze
+ app-arch/lha
+ app-arch/lrzip
+ app-arch/lzop
+ app-arch/ncompress
+ app-arch/p7zip
+ app-arch/pax
+ app-arch/unarj
+ app-arch/unrar
+ app-arch/xz-utils
+ app-arch/zoo
+ net-mail/ripole
+ >=dev-perl/Archive-Zip-1.14
+ >=virtual/perl-IO-Compress-1.35
+ >=virtual/perl-Compress-Raw-Zlib-2.017
+ net-mail/tnef
+ virtual/perl-MIME-Base64
+ >=dev-perl/MIME-tools-5.415
+ >=dev-perl/MailTools-1.58
+ >=dev-perl/net-server-0.91
+ virtual/perl-Digest-MD5
+ dev-perl/IO-stringy
+ virtual/perl-IO-Socket-IP
+ >=virtual/perl-Time-HiRes-1.49
+ dev-perl/Unix-Syslog
+ dev-perl/Net-LibIDN
+ sys-apps/file
+ >=sys-libs/db-4.4.20
+ dev-perl/BerkeleyDB
+ dev-perl/Convert-BinHex
+ >=dev-perl/Mail-DKIM-0.31
+ virtual/mta
+ clamav? ( app-antivirus/clamav )
+ ldap? ( >=dev-perl/perl-ldap-0.33 )
+ mysql? ( dev-perl/DBD-mysql )
+ postgres? ( dev-perl/DBD-Pg )
+ razor? ( mail-filter/razor )
+ snmp? ( net-analyzer/net-snmp[perl] )
+ spamassassin? ( mail-filter/spamassassin )
+ zmq? ( dev-perl/ZMQ-LibZMQ3 )"
+
+AMAVIS_ROOT="/var/amavis"
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ if use courier ; then
+ epatch amavisd-new-courier.patch
+ fi
+
+ if use qmail ; then
+ epatch amavisd-new-qmqpqq.patch
+ fi
+
+ sed -i \
+ -e '/daemon/s/vscan/amavis/' \
+ -e "s:'/var/virusmails':\"\$MYHOME/quarantine\":" \
+ "${S}/amavisd.conf" "${S}/amavis-mc" || die "missing conf file"
+
+ if ! use dkim ; then
+ sed -i -e '/enable_dkim/s/1/0/' "${S}/amavisd.conf" \
+ || die "missing conf file - dkim"
+ fi
+
+ if use zmq ; then
+ sed -i -e '/enable_zmq/s/# //' "${S}/amavisd.conf" \
+ || die "missing conf file - zmq"
+ fi
+
+ if ! use spamassassin ; then
+ sed -i -e \
+ "/^#[[:space:]]*@bypass_spam_checks_maps[[:space:]]*=[[:space:]]*(1)/s/^#//" \
+ "${S}/amavisd.conf" || die "missing conf file - sa"
+ fi
+}
+
+src_install() {
+ dosbin amavisd amavisd-agent amavisd-nanny amavisd-release \
+ amavisd-signer amavisd-status
+ dobin p0f-analyzer.pl amavisd-submit
+
+ if use snmp ; then
+ dosbin amavisd-snmp-subagent
+ use zmq && dosbin amavisd-snmp-subagent-zmq
+ dodoc AMAVIS-MIB.txt
+ fi
+
+ if use zmq ; then
+ dosbin amavis-services amavis-mc
+ newinitd "${FILESDIR}"/amavis-mc.initd amavis-mc
+ fi
+
+ insinto /etc
+ insopts -m0640
+ doins amavisd.conf
+
+ newinitd "${FILESDIR}/amavisd.initd-r1" amavisd
+
+ systemd_dounit "${FILESDIR}/amavisd.service"
+ use clamav || sed -i -e '/Wants=clamd/d' "${ED}"/usr/lib/systemd/system/amavisd.service
+ use spamassassin || sed -i -e '/Wants=spamassassin/d' "${ED}"/usr/lib/systemd/system/amavisd.service
+
+ keepdir "${AMAVIS_ROOT}"
+ keepdir "${AMAVIS_ROOT}/db"
+ keepdir "${AMAVIS_ROOT}/quarantine"
+ keepdir "${AMAVIS_ROOT}/tmp"
+ keepdir "${AMAVIS_ROOT}/var"
+
+ dodoc AAAREADME.first INSTALL MANIFEST RELEASE_NOTES TODO \
+ amavisd.conf-default amavisd-custom.conf
+
+ docinto README_FILES
+ dodoc README_FILES/README*
+ dohtml README_FILES/*.{html,css}
+ docinto README_FILES/images
+ dodoc README_FILES/images/*.png
+ docinto README_FILES/images/callouts
+ dodoc README_FILES/images/callouts/*.png
+
+ docinto test-messages
+ dodoc test-messages/README
+ dodoc test-messages/sample.tar.gz.compl
+
+ if use ldap ; then
+ dodir /etc/openldap/schema
+ insinto /etc/openldap/schema
+ insopts -o root -g root -m 644
+ newins LDAP.schema ${PN}.schema || die
+ fi
+}
+
+pkg_preinst() {
+ enewgroup amavis
+ enewuser amavis -1 -1 "${AMAVIS_ROOT}" amavis
+ if use razor ; then
+ if [ ! -d "${ROOT}${AMAVIS_ROOT}/.razor" ] ; then
+ elog "Setting up initial razor config files..."
+
+ razor-admin -create -home="${D}/${AMAVIS_ROOT}/.razor"
+ sed -i -e "s:debuglevel\([ ]*\)= .:debuglevel\1= 0:g" \
+ "${D}/${AMAVIS_ROOT}/.razor/razor-agent.conf" || die
+ fi
+ fi
+
+ if has_version "<${CATEGORY}/${PN}-2.7.0" ; then
+ elog "Amavisd-new ships with a short and condensed config file now."
+ elog "Transferring your current settings to the new format is"
+ elog "recommended for ease of future upgrades."
+ fi
+}
+
+pkg_postinst() {
+ chown root:amavis "${ROOT}/etc/amavisd.conf"
+ chown -R amavis:amavis "${ROOT}/${AMAVIS_ROOT}"
+}
diff --git a/mail-filter/amavisd-new/amavisd-new-2.10.1.ebuild b/mail-filter/amavisd-new/amavisd-new-2.10.1.ebuild
new file mode 100644
index 00000000000..a7255e277f6
--- /dev/null
+++ b/mail-filter/amavisd-new/amavisd-new-2.10.1.ebuild
@@ -0,0 +1,181 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils systemd user
+
+MY_P="${P/_/-}"
+DESCRIPTION="High-performance interface between the MTA and content checkers"
+HOMEPAGE="http://www.ijs.si/software/amavisd/"
+SRC_URI="http://www.ijs.si/software/amavisd/${MY_P}.tar.xz"
+
+LICENSE="GPL-2 BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE="clamav courier dkim ldap mysql postgres qmail razor snmp spamassassin zmq"
+
+DEPEND=">=sys-apps/sed-4
+ >=dev-lang/perl-5.8.2"
+
+RDEPEND="${DEPEND}
+ >=sys-apps/coreutils-5.0-r3
+ app-arch/cpio
+ app-arch/gzip
+ app-arch/bzip2
+ app-arch/arc
+ app-arch/cabextract
+ app-arch/freeze
+ app-arch/lha
+ app-arch/lrzip
+ app-arch/lzop
+ app-arch/ncompress
+ app-arch/p7zip
+ app-arch/pax
+ app-arch/unarj
+ app-arch/unrar
+ app-arch/xz-utils
+ app-arch/zoo
+ net-mail/ripole
+ >=dev-perl/Archive-Zip-1.14
+ >=virtual/perl-IO-Compress-1.35
+ >=virtual/perl-Compress-Raw-Zlib-2.017
+ net-mail/tnef
+ virtual/perl-MIME-Base64
+ >=dev-perl/MIME-tools-5.415
+ >=dev-perl/MailTools-1.58
+ >=dev-perl/net-server-0.91
+ virtual/perl-Digest-MD5
+ dev-perl/IO-stringy
+ virtual/perl-IO-Socket-IP
+ >=virtual/perl-Time-HiRes-1.49
+ dev-perl/Unix-Syslog
+ dev-perl/Net-LibIDN
+ sys-apps/file
+ >=sys-libs/db-4.4.20
+ dev-perl/BerkeleyDB
+ dev-perl/Convert-BinHex
+ >=dev-perl/Mail-DKIM-0.31
+ virtual/mta
+ clamav? ( app-antivirus/clamav )
+ ldap? ( >=dev-perl/perl-ldap-0.33 )
+ mysql? ( dev-perl/DBD-mysql )
+ postgres? ( dev-perl/DBD-Pg )
+ razor? ( mail-filter/razor )
+ snmp? ( net-analyzer/net-snmp[perl] )
+ spamassassin? ( mail-filter/spamassassin )
+ zmq? ( dev-perl/ZMQ-LibZMQ2 )"
+
+AMAVIS_ROOT="/var/amavis"
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ if use courier ; then
+ epatch amavisd-new-courier.patch
+ fi
+
+ if use qmail ; then
+ epatch amavisd-new-qmqpqq.patch
+ fi
+
+ sed -i \
+ -e '/daemon/s/vscan/amavis/' \
+ -e "s:'/var/virusmails':\"\$MYHOME/quarantine\":" \
+ "${S}/amavisd.conf" "${S}/amavis-mc" || die "missing conf file"
+
+ if ! use dkim ; then
+ sed -i -e '/enable_dkim/s/1/0/' "${S}/amavisd.conf" \
+ || die "missing conf file - dkim"
+ fi
+
+ if use zmq ; then
+ sed -i -e '/enable_zmq/s/# //' "${S}/amavisd.conf" \
+ || die "missing conf file - zmq"
+ fi
+
+ if ! use spamassassin ; then
+ sed -i -e \
+ "/^#[[:space:]]*@bypass_spam_checks_maps[[:space:]]*=[[:space:]]*(1)/s/^#//" \
+ "${S}/amavisd.conf" || die "missing conf file - sa"
+ fi
+}
+
+src_install() {
+ dosbin amavisd amavisd-agent amavisd-nanny amavisd-release \
+ amavisd-signer amavisd-status
+ dobin p0f-analyzer.pl amavisd-submit
+
+ if use snmp ; then
+ dosbin amavisd-snmp-subagent
+ use zmq && dosbin amavisd-snmp-subagent-zmq
+ dodoc AMAVIS-MIB.txt
+ fi
+
+ if use zmq ; then
+ dosbin amavis-services amavis-mc
+ newinitd "${FILESDIR}"/amavis-mc.initd amavis-mc
+ fi
+
+ insinto /etc
+ insopts -m0640
+ doins amavisd.conf
+
+ newinitd "${FILESDIR}/amavisd.initd-r1" amavisd
+
+ systemd_dounit "${FILESDIR}/amavisd.service"
+ use clamav || sed -i -e '/Wants=clamd/d' "${ED}"/usr/lib/systemd/system/amavisd.service
+ use spamassassin || sed -i -e '/Wants=spamassassin/d' "${ED}"/usr/lib/systemd/system/amavisd.service
+
+ keepdir "${AMAVIS_ROOT}"
+ keepdir "${AMAVIS_ROOT}/db"
+ keepdir "${AMAVIS_ROOT}/quarantine"
+ keepdir "${AMAVIS_ROOT}/tmp"
+ keepdir "${AMAVIS_ROOT}/var"
+
+ dodoc AAAREADME.first INSTALL MANIFEST RELEASE_NOTES TODO \
+ amavisd.conf-default amavisd-custom.conf
+
+ docinto README_FILES
+ dodoc README_FILES/README*
+ dohtml README_FILES/*.{html,css}
+ docinto README_FILES/images
+ dodoc README_FILES/images/*.png
+ docinto README_FILES/images/callouts
+ dodoc README_FILES/images/callouts/*.png
+
+ docinto test-messages
+ dodoc test-messages/README
+ dodoc test-messages/sample.tar.gz.compl
+
+ if use ldap ; then
+ dodir /etc/openldap/schema
+ insinto /etc/openldap/schema
+ insopts -o root -g root -m 644
+ newins LDAP.schema ${PN}.schema || die
+ fi
+}
+
+pkg_preinst() {
+ enewgroup amavis
+ enewuser amavis -1 -1 "${AMAVIS_ROOT}" amavis
+ if use razor ; then
+ if [ ! -d "${ROOT}${AMAVIS_ROOT}/.razor" ] ; then
+ elog "Setting up initial razor config files..."
+
+ razor-admin -create -home="${D}/${AMAVIS_ROOT}/.razor"
+ sed -i -e "s:debuglevel\([ ]*\)= .:debuglevel\1= 0:g" \
+ "${D}/${AMAVIS_ROOT}/.razor/razor-agent.conf" || die
+ fi
+ fi
+
+ if has_version "<${CATEGORY}/${PN}-2.7.0" ; then
+ elog "Amavisd-new ships with a short and condensed config file now."
+ elog "Transferring your current settings to the new format is"
+ elog "recommended for ease of future upgrades."
+ fi
+}
+
+pkg_postinst() {
+ chown root:amavis "${ROOT}/etc/amavisd.conf"
+ chown -R amavis:amavis "${ROOT}/${AMAVIS_ROOT}"
+}
diff --git a/mail-filter/amavisd-new/amavisd-new-2.7.2.ebuild b/mail-filter/amavisd-new/amavisd-new-2.7.2.ebuild
new file mode 100644
index 00000000000..b65388cb114
--- /dev/null
+++ b/mail-filter/amavisd-new/amavisd-new-2.7.2.ebuild
@@ -0,0 +1,168 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils user
+
+MY_P="${P/_/-}"
+DESCRIPTION="High-performance interface between the MTA and content checkers"
+HOMEPAGE="http://www.ijs.si/software/amavisd/"
+SRC_URI="http://www.ijs.si/software/amavisd/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 hppa ~ppc ~ppc64 sparc x86"
+IUSE="courier dkim ldap mysql postgres qmail razor snmp spamassassin"
+
+DEPEND=">=sys-apps/sed-4
+ >=dev-lang/perl-5.8.2"
+
+RDEPEND="${DEPEND}
+ >=sys-apps/coreutils-5.0-r3
+ app-arch/cpio
+ app-arch/gzip
+ app-arch/bzip2
+ app-arch/arc
+ app-arch/cabextract
+ app-arch/freeze
+ app-arch/lha
+ app-arch/ncompress
+ app-arch/pax
+ app-arch/unarj
+ app-arch/xz-utils
+ || ( app-arch/unrar app-arch/rar )
+ app-arch/zoo
+ >=dev-perl/Archive-Zip-1.14
+ >=virtual/perl-IO-Compress-1.35
+ >=virtual/perl-Compress-Raw-Zlib-2.017
+ dev-perl/Convert-TNEF
+ >=dev-perl/Convert-UUlib-1.08
+ virtual/perl-MIME-Base64
+ >=dev-perl/MIME-tools-5.415
+ >=dev-perl/MailTools-1.58
+ >=dev-perl/net-server-0.91
+ virtual/perl-Digest-MD5
+ dev-perl/IO-stringy
+ >=virtual/perl-Time-HiRes-1.49
+ dev-perl/Unix-Syslog
+ sys-apps/file
+ >=sys-libs/db-4.4.20
+ dev-perl/BerkeleyDB
+ dev-perl/Convert-BinHex
+ >=dev-perl/Mail-DKIM-0.31
+ virtual/mta
+ ldap? ( >=dev-perl/perl-ldap-0.33 )
+ mysql? ( dev-perl/DBD-mysql )
+ postgres? ( dev-perl/DBD-Pg )
+ razor? ( mail-filter/razor )
+ snmp? ( net-analyzer/net-snmp[perl] )
+ spamassassin? ( mail-filter/spamassassin )"
+
+AMAVIS_ROOT="/var/amavis"
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ if use courier ; then
+ epatch amavisd-new-courier.patch
+ fi
+
+ if use qmail ; then
+ epatch amavisd-new-qmqpqq.patch
+ fi
+
+ sed -i \
+ -e '/daemon/s/vscan/amavis/' \
+ -e "s:'/var/virusmails':\"\$MYHOME/quarantine\":" \
+ "${S}/amavisd.conf" || die "missing conf file"
+
+ if ! use dkim ; then
+ sed -i -e '/enable_dkim/s/1/0/' "${S}/amavisd.conf" \
+ || die "missing conf file"
+ fi
+}
+
+src_install() {
+ dosbin amavisd amavisd-agent amavisd-nanny amavisd-release \
+ amavisd-signer
+ dobin p0f-analyzer.pl amavisd-submit
+
+ if use snmp ; then
+ dosbin amavisd-snmp-subagent
+ dodoc AMAVIS-MIB.txt
+ fi
+
+ insinto /etc
+ insopts -m0640
+ doins amavisd.conf
+
+ newinitd "${FILESDIR}/amavisd.initd" amavisd
+
+ keepdir "${AMAVIS_ROOT}"
+ keepdir "${AMAVIS_ROOT}/db"
+ keepdir "${AMAVIS_ROOT}/quarantine"
+ keepdir "${AMAVIS_ROOT}/tmp"
+ keepdir "${AMAVIS_ROOT}/var"
+
+ dodoc AAAREADME.first INSTALL MANIFEST RELEASE_NOTES TODO \
+ amavisd.conf-default amavisd-custom.conf
+
+ docinto README_FILES
+ dodoc README_FILES/README*
+ dohtml README_FILES/*.{html,css}
+ docinto README_FILES/images
+ dodoc README_FILES/images/*.png
+ docinto README_FILES/images/callouts
+ dodoc README_FILES/images/callouts/*.png
+
+ docinto test-messages
+ dodoc test-messages/README
+ dodoc test-messages/sample.tar.gz.compl
+
+ #for i in whitelist blacklist spam_lovers; do
+ # if [ -f ${AMAVIS_ROOT}/${i} ]; then
+ # cp "${AMAVIS_ROOT}/${i}" "${D}/${AMAVIS_ROOT}"
+ # else
+ # touch "${D}"/${AMAVIS_ROOT}/${i}
+ # fi
+ #done
+
+ if use ldap ; then
+ dodir /etc/openldap/schema
+ insinto /etc/openldap/schema
+ insopts -o root -g root -m 644
+ newins LDAP.schema ${PN}.schema || die
+ fi
+}
+
+pkg_preinst() {
+ enewgroup amavis
+ enewuser amavis -1 -1 "${AMAVIS_ROOT}" amavis
+ if use razor ; then
+ if [ ! -d "${ROOT}${AMAVIS_ROOT}/.razor" ] ; then
+ elog "Setting up initial razor config files..."
+
+ razor-admin -create -home="${D}/${AMAVIS_ROOT}/.razor"
+ sed -i -e "s:debuglevel\([ ]*\)= .:debuglevel\1= 0:g" \
+ "${D}/${AMAVIS_ROOT}/.razor/razor-agent.conf"
+ fi
+ fi
+
+ if ! use spamassassin ; then
+ elog "Disabling anti-spam code in amavisd.conf..."
+ sed -i -e \
+ "/^#[[:space:]]*@bypass_spam_checks_maps[[:space:]]*=[[:space:]]*(1)/s/^#//" \
+ "${D}/etc/amavisd.conf"
+ fi
+
+ if has_version "<${CATEGORY}/${PN}-2.7.0" ; then
+ elog "Amavisd-new ships with a short and condensed config file now."
+ elog "Transferring your current settings to the new format is"
+ elog "recommended for ease of future upgrades."
+ fi
+}
+
+pkg_postinst() {
+ chown root:amavis "${ROOT}/etc/amavisd.conf"
+ chown -R amavis:amavis "${ROOT}/${AMAVIS_ROOT}"
+}
diff --git a/mail-filter/amavisd-new/amavisd-new-2.8.1-r1.ebuild b/mail-filter/amavisd-new/amavisd-new-2.8.1-r1.ebuild
new file mode 100644
index 00000000000..d5cb776789a
--- /dev/null
+++ b/mail-filter/amavisd-new/amavisd-new-2.8.1-r1.ebuild
@@ -0,0 +1,189 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils systemd user
+
+MY_P="${P/_/-}"
+DESCRIPTION="High-performance interface between the MTA and content checkers"
+HOMEPAGE="http://www.ijs.si/software/amavisd/"
+SRC_URI="http://www.ijs.si/software/amavisd/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 hppa ~ppc ~ppc64 sparc x86"
+IUSE="clamav courier dkim ldap mysql postgres qmail razor snmp spamassassin zmq"
+
+DEPEND=">=sys-apps/sed-4
+ >=dev-lang/perl-5.8.2"
+
+RDEPEND="${DEPEND}
+ >=sys-apps/coreutils-5.0-r3
+ app-arch/cpio
+ app-arch/gzip
+ app-arch/bzip2
+ app-arch/arc
+ app-arch/cabextract
+ app-arch/freeze
+ app-arch/lha
+ app-arch/lrzip
+ app-arch/lzop
+ app-arch/ncompress
+ app-arch/p7zip
+ app-arch/pax
+ app-arch/unarj
+ app-arch/unrar
+ app-arch/xz-utils
+ app-arch/zoo
+ net-mail/ripole
+ >=dev-perl/Archive-Zip-1.14
+ >=virtual/perl-IO-Compress-1.35
+ >=virtual/perl-Compress-Raw-Zlib-2.017
+ dev-perl/Convert-TNEF
+ >=dev-perl/Convert-UUlib-1.08
+ virtual/perl-MIME-Base64
+ >=dev-perl/MIME-tools-5.415
+ >=dev-perl/MailTools-1.58
+ >=dev-perl/net-server-0.91
+ virtual/perl-Digest-MD5
+ dev-perl/IO-stringy
+ virtual/perl-IO-Socket-IP
+ >=virtual/perl-Time-HiRes-1.49
+ dev-perl/Unix-Syslog
+ sys-apps/file
+ >=sys-libs/db-4.4.20
+ dev-perl/BerkeleyDB
+ dev-perl/Convert-BinHex
+ >=dev-perl/Mail-DKIM-0.31
+ virtual/mta
+ clamav? ( app-antivirus/clamav )
+ ldap? ( >=dev-perl/perl-ldap-0.33 )
+ mysql? ( dev-perl/DBD-mysql )
+ postgres? ( dev-perl/DBD-Pg )
+ razor? ( mail-filter/razor )
+ snmp? ( net-analyzer/net-snmp[perl] )
+ spamassassin? ( mail-filter/spamassassin )
+ zmq? ( dev-perl/ZMQ-LibZMQ2 )"
+
+AMAVIS_ROOT="/var/amavis"
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ if use courier ; then
+ epatch amavisd-new-courier.patch
+ fi
+
+ if use qmail ; then
+ epatch amavisd-new-qmqpqq.patch
+ fi
+
+ sed -i \
+ -e '/daemon/s/vscan/amavis/' \
+ -e "s:'/var/virusmails':\"\$MYHOME/quarantine\":" \
+ "${S}/amavisd.conf" "${S}/amavis-mc" || die
+
+ if ! use dkim ; then
+ sed -i -e '/enable_dkim/s/1/0/' "${S}/amavisd.conf" \
+ || die "missing conf file"
+ fi
+
+ if use zmq ; then
+ sed -i -e '/enable_zmq/s/# //' "${S}/amavisd.conf"
+ fi
+}
+
+src_install() {
+ dosbin amavisd amavisd-agent amavisd-nanny amavisd-release \
+ amavisd-signer amavisd-status
+ dobin p0f-analyzer.pl amavisd-submit
+
+ if use snmp ; then
+ dosbin amavisd-snmp-subagent
+ use zmq && dosbin amavisd-snmp-subagent-zmq
+ dodoc AMAVIS-MIB.txt
+ fi
+
+ if use zmq ; then
+ dosbin amavis-services amavis-mc
+ newinitd "${FILESDIR}"/amavis-mc.initd amavis-mc
+ fi
+
+ insinto /etc
+ insopts -m0640
+ doins amavisd.conf
+
+ newinitd "${FILESDIR}/amavisd.initd-r1" amavisd
+
+ systemd_dounit "${FILESDIR}/amavisd.service"
+ use clamav || sed -i -e '/Wants=clamd/d' "${ED}"/usr/lib/systemd/system/amavisd.service
+ use spamassassin || sed -i -e '/Wants=spamassassin/d' "${ED}"/usr/lib/systemd/system/amavisd.service
+
+ keepdir "${AMAVIS_ROOT}"
+ keepdir "${AMAVIS_ROOT}/db"
+ keepdir "${AMAVIS_ROOT}/quarantine"
+ keepdir "${AMAVIS_ROOT}/tmp"
+ keepdir "${AMAVIS_ROOT}/var"
+
+ dodoc AAAREADME.first INSTALL MANIFEST RELEASE_NOTES TODO \
+ amavisd.conf-default amavisd-custom.conf
+
+ docinto README_FILES
+ dodoc README_FILES/README*
+ dohtml README_FILES/*.{html,css}
+ docinto README_FILES/images
+ dodoc README_FILES/images/*.png
+ docinto README_FILES/images/callouts
+ dodoc README_FILES/images/callouts/*.png
+
+ docinto test-messages
+ dodoc test-messages/README
+ dodoc test-messages/sample.tar.gz.compl
+
+ #for i in whitelist blacklist spam_lovers; do
+ # if [ -f ${AMAVIS_ROOT}/${i} ]; then
+ # cp "${AMAVIS_ROOT}/${i}" "${D}/${AMAVIS_ROOT}"
+ # else
+ # touch "${D}"/${AMAVIS_ROOT}/${i}
+ # fi
+ #done
+
+ if use ldap ; then
+ dodir /etc/openldap/schema
+ insinto /etc/openldap/schema
+ insopts -o root -g root -m 644
+ newins LDAP.schema ${PN}.schema || die
+ fi
+}
+
+pkg_preinst() {
+ enewgroup amavis
+ enewuser amavis -1 -1 "${AMAVIS_ROOT}" amavis
+ if use razor ; then
+ if [ ! -d "${ROOT}${AMAVIS_ROOT}/.razor" ] ; then
+ elog "Setting up initial razor config files..."
+
+ razor-admin -create -home="${D}/${AMAVIS_ROOT}/.razor"
+ sed -i -e "s:debuglevel\([ ]*\)= .:debuglevel\1= 0:g" \
+ "${D}/${AMAVIS_ROOT}/.razor/razor-agent.conf"
+ fi
+ fi
+
+ if ! use spamassassin ; then
+ elog "Disabling anti-spam code in amavisd.conf..."
+ sed -i -e \
+ "/^#[[:space:]]*@bypass_spam_checks_maps[[:space:]]*=[[:space:]]*(1)/s/^#//" \
+ "${D}/etc/amavisd.conf"
+ fi
+
+ if has_version "<${CATEGORY}/${PN}-2.7.0" ; then
+ elog "Amavisd-new ships with a short and condensed config file now."
+ elog "Transferring your current settings to the new format is"
+ elog "recommended for ease of future upgrades."
+ fi
+}
+
+pkg_postinst() {
+ chown root:amavis "${ROOT}/etc/amavisd.conf"
+ chown -R amavis:amavis "${ROOT}/${AMAVIS_ROOT}"
+}
diff --git a/mail-filter/amavisd-new/amavisd-new-2.9.1.ebuild b/mail-filter/amavisd-new/amavisd-new-2.9.1.ebuild
new file mode 100644
index 00000000000..83c2ccb8913
--- /dev/null
+++ b/mail-filter/amavisd-new/amavisd-new-2.9.1.ebuild
@@ -0,0 +1,180 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils systemd user
+
+MY_P="${P/_/-}"
+DESCRIPTION="High-performance interface between the MTA and content checkers"
+HOMEPAGE="http://www.ijs.si/software/amavisd/"
+SRC_URI="http://www.ijs.si/software/amavisd/${MY_P}.tar.xz"
+
+LICENSE="GPL-2 BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE="clamav courier dkim ldap mysql postgres qmail razor snmp spamassassin zmq"
+
+DEPEND=">=sys-apps/sed-4
+ >=dev-lang/perl-5.8.2"
+
+RDEPEND="${DEPEND}
+ >=sys-apps/coreutils-5.0-r3
+ app-arch/cpio
+ app-arch/gzip
+ app-arch/bzip2
+ app-arch/arc
+ app-arch/cabextract
+ app-arch/freeze
+ app-arch/lha
+ app-arch/lrzip
+ app-arch/lzop
+ app-arch/ncompress
+ app-arch/p7zip
+ app-arch/pax
+ app-arch/unarj
+ app-arch/unrar
+ app-arch/xz-utils
+ app-arch/zoo
+ net-mail/ripole
+ >=dev-perl/Archive-Zip-1.14
+ >=virtual/perl-IO-Compress-1.35
+ >=virtual/perl-Compress-Raw-Zlib-2.017
+ net-mail/tnef
+ virtual/perl-MIME-Base64
+ >=dev-perl/MIME-tools-5.415
+ >=dev-perl/MailTools-1.58
+ >=dev-perl/net-server-0.91
+ virtual/perl-Digest-MD5
+ dev-perl/IO-stringy
+ virtual/perl-IO-Socket-IP
+ >=virtual/perl-Time-HiRes-1.49
+ dev-perl/Unix-Syslog
+ sys-apps/file
+ >=sys-libs/db-4.4.20
+ dev-perl/BerkeleyDB
+ dev-perl/Convert-BinHex
+ >=dev-perl/Mail-DKIM-0.31
+ virtual/mta
+ clamav? ( app-antivirus/clamav )
+ ldap? ( >=dev-perl/perl-ldap-0.33 )
+ mysql? ( dev-perl/DBD-mysql )
+ postgres? ( dev-perl/DBD-Pg )
+ razor? ( mail-filter/razor )
+ snmp? ( net-analyzer/net-snmp[perl] )
+ spamassassin? ( mail-filter/spamassassin )
+ zmq? ( dev-perl/ZMQ-LibZMQ2 )"
+
+AMAVIS_ROOT="/var/amavis"
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ if use courier ; then
+ epatch amavisd-new-courier.patch
+ fi
+
+ if use qmail ; then
+ epatch amavisd-new-qmqpqq.patch
+ fi
+
+ sed -i \
+ -e '/daemon/s/vscan/amavis/' \
+ -e "s:'/var/virusmails':\"\$MYHOME/quarantine\":" \
+ "${S}/amavisd.conf" "${S}/amavis-mc" || die "missing conf file"
+
+ if ! use dkim ; then
+ sed -i -e '/enable_dkim/s/1/0/' "${S}/amavisd.conf" \
+ || die "missing conf file - dkim"
+ fi
+
+ if use zmq ; then
+ sed -i -e '/enable_zmq/s/# //' "${S}/amavisd.conf" \
+ || die "missing conf file - zmq"
+ fi
+
+ if ! use spamassassin ; then
+ sed -i -e \
+ "/^#[[:space:]]*@bypass_spam_checks_maps[[:space:]]*=[[:space:]]*(1)/s/^#//" \
+ "${S}/amavisd.conf" || die "missing conf file - sa"
+ fi
+}
+
+src_install() {
+ dosbin amavisd amavisd-agent amavisd-nanny amavisd-release \
+ amavisd-signer amavisd-status
+ dobin p0f-analyzer.pl amavisd-submit
+
+ if use snmp ; then
+ dosbin amavisd-snmp-subagent
+ use zmq && dosbin amavisd-snmp-subagent-zmq
+ dodoc AMAVIS-MIB.txt
+ fi
+
+ if use zmq ; then
+ dosbin amavis-services amavis-mc
+ newinitd "${FILESDIR}"/amavis-mc.initd amavis-mc
+ fi
+
+ insinto /etc
+ insopts -m0640
+ doins amavisd.conf
+
+ newinitd "${FILESDIR}/amavisd.initd-r1" amavisd
+
+ systemd_dounit "${FILESDIR}/amavisd.service"
+ use clamav || sed -i -e '/Wants=clamd/d' "${ED}"/usr/lib/systemd/system/amavisd.service
+ use spamassassin || sed -i -e '/Wants=spamassassin/d' "${ED}"/usr/lib/systemd/system/amavisd.service
+
+ keepdir "${AMAVIS_ROOT}"
+ keepdir "${AMAVIS_ROOT}/db"
+ keepdir "${AMAVIS_ROOT}/quarantine"
+ keepdir "${AMAVIS_ROOT}/tmp"
+ keepdir "${AMAVIS_ROOT}/var"
+
+ dodoc AAAREADME.first INSTALL MANIFEST RELEASE_NOTES TODO \
+ amavisd.conf-default amavisd-custom.conf
+
+ docinto README_FILES
+ dodoc README_FILES/README*
+ dohtml README_FILES/*.{html,css}
+ docinto README_FILES/images
+ dodoc README_FILES/images/*.png
+ docinto README_FILES/images/callouts
+ dodoc README_FILES/images/callouts/*.png
+
+ docinto test-messages
+ dodoc test-messages/README
+ dodoc test-messages/sample.tar.gz.compl
+
+ if use ldap ; then
+ dodir /etc/openldap/schema
+ insinto /etc/openldap/schema
+ insopts -o root -g root -m 644
+ newins LDAP.schema ${PN}.schema || die
+ fi
+}
+
+pkg_preinst() {
+ enewgroup amavis
+ enewuser amavis -1 -1 "${AMAVIS_ROOT}" amavis
+ if use razor ; then
+ if [ ! -d "${ROOT}${AMAVIS_ROOT}/.razor" ] ; then
+ elog "Setting up initial razor config files..."
+
+ razor-admin -create -home="${D}/${AMAVIS_ROOT}/.razor"
+ sed -i -e "s:debuglevel\([ ]*\)= .:debuglevel\1= 0:g" \
+ "${D}/${AMAVIS_ROOT}/.razor/razor-agent.conf" || die
+ fi
+ fi
+
+ if has_version "<${CATEGORY}/${PN}-2.7.0" ; then
+ elog "Amavisd-new ships with a short and condensed config file now."
+ elog "Transferring your current settings to the new format is"
+ elog "recommended for ease of future upgrades."
+ fi
+}
+
+pkg_postinst() {
+ chown root:amavis "${ROOT}/etc/amavisd.conf"
+ chown -R amavis:amavis "${ROOT}/${AMAVIS_ROOT}"
+}
diff --git a/mail-filter/amavisd-new/files/amavis-mc.initd b/mail-filter/amavisd-new/files/amavis-mc.initd
new file mode 100644
index 00000000000..d194139360a
--- /dev/null
+++ b/mail-filter/amavisd-new/files/amavis-mc.initd
@@ -0,0 +1,24 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+prog="/usr/sbin/amavis-mc"
+progname="amavis-mc"
+
+depend() {
+ use logger
+ before amavisd-new snmpd
+}
+
+start() {
+ ebegin "Starting ${progname}"
+ start-stop-daemon --start --exec ${prog}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${progname}"
+ start-stop-daemon --stop --interpreted --exec ${prog}
+ eend $?
+}
diff --git a/mail-filter/amavisd-new/files/amavisd.initd b/mail-filter/amavisd-new/files/amavisd.initd
new file mode 100644
index 00000000000..1c7a7cb8ec8
--- /dev/null
+++ b/mail-filter/amavisd-new/files/amavisd.initd
@@ -0,0 +1,46 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_started_commands="reload"
+extra_commands="debug debug_sa"
+
+prog="/usr/sbin/amavisd"
+progname="amavisd-new"
+
+depend() {
+ need net
+ use logger antivirus snmpd
+ before mta
+}
+
+start() {
+ ebegin "Starting ${progname}"
+ "${prog}" start
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${progname}"
+ "${prog}" stop 1>/dev/null
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading ${progname}"
+ "${prog}" reload 1>/dev/null
+ eend $?
+}
+
+debug() {
+ ebegin "Starting ${progname} in debug mode"
+ "${prog}" debug
+ eend $?
+}
+
+debug_sa() {
+ ebegin "Starting ${progname} in debug-sa mode"
+ "${prog}" debug-sa
+ eend $?
+}
diff --git a/mail-filter/amavisd-new/files/amavisd.initd-r1 b/mail-filter/amavisd-new/files/amavisd.initd-r1
new file mode 100644
index 00000000000..9c9e470b366
--- /dev/null
+++ b/mail-filter/amavisd-new/files/amavisd.initd-r1
@@ -0,0 +1,45 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_started_commands="reload"
+extra_commands="debug debug_sa"
+
+prog="/usr/sbin/amavisd"
+progname="amavisd-new"
+
+depend() {
+ use net logger antivirus snmpd
+ before mta
+}
+
+start() {
+ ebegin "Starting ${progname}"
+ "${prog}" start
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${progname}"
+ "${prog}" stop 1>/dev/null
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading ${progname}"
+ "${prog}" reload 1>/dev/null
+ eend $?
+}
+
+debug() {
+ ebegin "Starting ${progname} in debug mode"
+ "${prog}" debug
+ eend $?
+}
+
+debug_sa() {
+ ebegin "Starting ${progname} in debug-sa mode"
+ "${prog}" debug-sa
+ eend $?
+}
diff --git a/mail-filter/amavisd-new/files/amavisd.service b/mail-filter/amavisd-new/files/amavisd.service
new file mode 100644
index 00000000000..2a56e443eed
--- /dev/null
+++ b/mail-filter/amavisd-new/files/amavisd.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Amavisd Daemon
+Wants=postfix.service
+Wants=spamassassin.service
+Wants=clamd.service
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/amavisd -c /etc/amavisd.conf foreground
+ExecReload=/usr/sbin/amavisd -c /etc/amavisd.conf reload
+
+[Install]
+WantedBy=multi-user.target
diff --git a/mail-filter/amavisd-new/metadata.xml b/mail-filter/amavisd-new/metadata.xml
new file mode 100644
index 00000000000..ad94427b2e9
--- /dev/null
+++ b/mail-filter/amavisd-new/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <herd>antivirus</herd>
+ <use>
+ <flag name='courier'>Add courier support</flag>
+ <flag name='dkim'>Add DomainKeys Identified Mail support</flag>
+ <flag name='qmail'>Add qmail support</flag>
+ <flag name='razor'>Add support for mail-filter/razor</flag>
+ <flag name='spamassassin'>Add support for mail-filter/spamassassin</flag>
+ <flag name='zmq'>Add support for zeromq sockets</flag>
+ </use>
+</pkgmetadata>
diff --git a/mail-filter/anomy-sanitizer/Manifest b/mail-filter/anomy-sanitizer/Manifest
new file mode 100644
index 00000000000..8f786939b53
--- /dev/null
+++ b/mail-filter/anomy-sanitizer/Manifest
@@ -0,0 +1,3 @@
+DIST anomy-sanitizer-1.76.tar.gz 172722 SHA256 aece7173df7984a6b1b050e58e9e1aaef2393ff9a5f7b808e3176ba76a3347f4 SHA512 4ba805f733f291af71f6ec514274f27bedd132c8613ea5a96eb6bffce9ee6fed15eaf73562f69c77327174bb91e101ce36f2e24917af61efa1b88a8acb721b41 WHIRLPOOL fceeb9e69a982ea935b15577fcc871598bc9c27468860559d7274dfd2d5562776f4e627687ce558038ce06f1b0c374d950b19aa69fbdc315bebb8bd2f65cc071
+DIST sample_e-mail-architecture.png.tar 20480 SHA256 1ead0d73dac23611dc5162f0203414364b96cd1b436682f78507b9b2bef57d9d SHA512 8f2ea6fd8bda828479ad659ac5c87175eb822c7c239713103a650feac0c46ac55476b59bdf2c99ca94b23bebaa2247fc55517b31a73c96e85d9664d759b0f1e2 WHIRLPOOL 30e0254d2bbf920fca10cc3906cd9370877d175a243d8ce782bcce7036addba43412670f5cb14a7f6c7bbbb6c749f75a74aa9a3b16939631ec3036403cabce35
+DIST sample_e-mail-architektur.flw 7001 SHA256 eca14ee6bf771a824c698c47a701cef26f4f496d29b3602722bfb0164a8616f6 SHA512 7c45e3787f80a94f8dda26e9d7d980aa96ec0163fa8b6f998be9e7ea188fedceb9c7db29c7d65099da9003c36de68335a016a33ce827ca10330a7115a87d5c59 WHIRLPOOL f2260b042c99c99656a084ff77c584ed0112e3fe9955ceebcf1f43b67f06b9c8725b308f2bfcc5505a4c35b7b6c9678607c0e8a5078b3a836c93ec56177be8c7
diff --git a/mail-filter/anomy-sanitizer/anomy-sanitizer-1.76-r1.ebuild b/mail-filter/anomy-sanitizer/anomy-sanitizer-1.76-r1.ebuild
new file mode 100644
index 00000000000..950c1b71343
--- /dev/null
+++ b/mail-filter/anomy-sanitizer/anomy-sanitizer-1.76-r1.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils user
+
+DESCRIPTION="Perl based e-mail filtering tool, sensitive to html tags, mime types and attachments"
+HOMEPAGE="http://mailtools.anomy.net/"
+SRC_URI="
+ http://dev.gentoo.org/~jlec/distfiles/sample_e-mail-architecture.png.tar
+ http://mailtools.anomy.net/dist/${PN}-${PV}.tar.gz
+ http://dev.gentoo.org/~pacho/maintainer-needed/sample_e-mail-architektur.flw"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="dev-lang/perl
+ >=virtual/perl-MIME-Base64-2.12-r2
+ >=dev-perl/Mail-Audit-2.1-r1
+ dev-perl/Convert-TNEF
+ dev-perl/MIME-tools
+ dev-perl/libwww-perl
+ virtual/mta"
+
+S="${WORKDIR}/anomy"
+DEST="/usr/share/${PN}"
+SANI_WORKDIR="/var/spool/sanitizer"
+SANI_CONFDIR="/etc/mail/${PN}"
+
+src_install() {
+ dodoc *.sanitizer CREDITS UNICODE.TXT
+ dohtml sanitizer.html
+ rm -rf "${S}/contrib/.tmp"
+ rm -f *.sanitizer CREDITS UNICODE.TXT sanitizer.html
+ mv "${S}/contrib" "${D}/usr/share/doc/${PF}/"
+
+ insinto /usr/share/doc/${PF}/examples
+ doins "${FILESDIR}"/*.sh "${WORKDIR}"/*.png "${DISTDIR}"/*.flw
+
+ keepdir ${SANI_CONFDIR}
+ insinto ${SANI_CONFDIR}
+ doins "${FILESDIR}"/*.conf
+
+ keepdir ${SANI_WORKDIR}
+ dodir ${DEST}
+ insinto ${DEST}
+
+# generate lists for doins
+ _list="anomy anomy/bin anomy/bin/Anomy anomy/bin/Anomy/Sanitizer anomy/testcases anomy/testcases/results.def"
+
+ for i in $_list; do
+ _di=`echo $i | sed -e "s/^anomy//g; s/^\///g"` &>/dev/null
+ insinto ${DEST}/$_di
+
+ _sublist=`find "${WORKDIR}"/$i/* -maxdepth 0 -type f`
+ for l in $_sublist; do
+ echo &>/dev/null
+ doins $l
+ done
+ done
+
+ dosym ${SANI_CONFDIR}/anomy.conf ${DEST}/anomy.conf
+}
+
+pkg_preinst() {
+ enewgroup sanitizer
+ enewuser sanitizer -1 -1 ${SANI_WORKDIR} sanitizer
+}
+
+pkg_postinst() {
+ chown -R sanitizer:sanitizer "${ROOT}"/${SANI_WORKDIR}
+ chmod -R a-rwx,g+X,u+rwX "${ROOT}"/${SANI_WORKDIR}
+ chown -R sanitizer:sanitizer "${ROOT}"/${DEST}
+ chmod -R a-rwx,g+rX,u+rX "${ROOT}"/${DEST}
+ chown sanitizer:sanitizer "${ROOT}"/${SANI_CONFDIR}/anomy.conf
+ chmod 0640 "${ROOT}"/${SANI_CONFDIR}/anomy.conf
+ chmod u+x "${ROOT}"/${DEST}/bin/*.pl
+ chmod u+x "${ROOT}"/${DEST}/testcases/*.sh
+ chmod u+w "${ROOT}"/${DEST}/*
+ chmod u+w "${ROOT}"/${DEST}/bin
+ chmod u+w "${ROOT}"/${DEST}/bin/Anomy
+ chmod u+w "${ROOT}"/${DEST}/bin/Anomy/Sanitizer
+ chmod u+w "${ROOT}"/${DEST}/testcases
+ chmod u+w "${ROOT}"/${DEST}/testcases/results.def
+
+ elog ""
+ elog "There is a howto for the integration of sanitizer"
+ elog "into your (postfix) mail system at"
+ elog "http://advosys.ca/papers/postfix-filtering.html"
+ elog "Please find example scripts to be used to integrate sanitizer"
+ elog "into your (postfix) mail system at"
+ elog "/usr/share/doc/${PF}/examples"
+ elog "There is also a png and kivio document about a possible"
+ elog "e-mail architecture"
+ elog ""
+
+}
+
+pkg_postrm() {
+ elog "After unmerging this ebuild, you will have to remove"
+ elog "created user and group manually. To do so, run:"
+ elog "userdel -r sanitizer; groupdel sanitizer"
+}
diff --git a/mail-filter/anomy-sanitizer/files/anomy.conf b/mail-filter/anomy-sanitizer/files/anomy.conf
new file mode 100644
index 00000000000..f7c45cd973d
--- /dev/null
+++ b/mail-filter/anomy-sanitizer/files/anomy.conf
@@ -0,0 +1,207 @@
+# Example configuration file for Anomy Sanitizer
+#
+# Thiemo Kellner, thiemo@thiam.ch, 2003-05-29
+# Based on http://advosys.ca/papers/postfix-filtering.html,
+# Advosys Consulting Inc., Ottawa
+#
+# Works with Anomy Sanitizer revision 1.60
+
+
+ # Warn user about unscanned parts, etc.
+ feat_verbose = 1
+
+ # Inline logs: 0 = Off, 1 = Maybe, 2 = Force
+ feat_log_inline = 1
+
+ # Print log to standard error: 0 = Off, 1 = On
+ feat_log_stderr = 1
+
+ # Don't use XML format for logs.
+ feat_log_xml = 0
+
+ # Omit trace info from logs.
+ feat_log_trace = 0
+
+ # Don't add any scratch space to part headers.
+ feat_log_after = 0
+
+ # Enable filename-based policy decisions.
+ feat_files = 1
+
+ # Force all parts (except text/plain and
+ # text/html parts) to have file names: 0 = Off, 1 = On
+ feat_force_name = 1
+
+ # Replace all boundary strings with our own
+ # NOTE: Always breaks PGP/MIME messages!
+ feat_boundaries = 0
+
+ # Protect against buffer overflows and null values.
+ feat_lengths = 1
+
+ # Defang incoming shell scripts.
+ feat_scripts = 1
+
+ # Defang active HTML content.
+ feat_html = 1
+
+ # Web-bugs are allowed.
+ feat_webbugs = 0
+
+ # Don't scan PGP signed message parts: 0 = Don't scan (???)
+ feat_trust_pgp = 0
+ msg_pgp_warning = WARNING: Unsanitized content follows.\n
+
+ # Sanitize inline uuencoded files.
+ feat_uuencoded = 1
+
+ # Sanitize forwarded messages
+ feat_forwards = 1
+
+ # Set to 0 if going productive (This isn't a test-case configuration.)
+ feat_testing = 1
+
+ # Fix invalid MIME, if possible.
+ feat_fixmime = 1
+
+ # Don't be excessively paranoid about MIME headers etc.
+ feat_paranoid = 0
+
+ # Advertisement to insert in each mail header:
+ header_info = X-Sanitizer: Anomy Sanitizer mail filter
+ header_url = 0
+ header_rev = 0
+
+
+ #
+ # Scoring
+ #
+
+ # Any message requring this many modifications
+ # will cause the sanitizer to return a non-zero
+ # exit code after processing the entire message.
+ # To disable set to 0.
+ score_bad = 100
+ #score_panic = 0
+
+ msg_file_drop = \n*****\n
+ msg_file_drop += NOTE: An attachment named %FILENAME was deleted from
+ msg_file_drop += this message because it contained a (windows) executable
+ msg_file_drop += or other potentially dangerous file type.
+ msg_file_drop += If you really need this attachment, have it re-sent
+ msg_file_drop += encapsulated, e.g. in a zip or tgz archive or contact your
+ msg_file_drop += mail system administrator.
+
+ #
+ # You may need to increase the following if you have a very
+ # complex configuration split between multiple files.
+ #
+ # Thiemo Kellner, thiemo@thiam.ch, 2003-05-31
+ # max_conf_recursions does not work with 1.60
+ #max_conf_recursions = 5 # The default is 5.
+ #
+ # Create temporary or saved files using this template.
+ # An attachment named "dude.txt" might be saved as
+ #
+ # /var/quarantine/att-dude-txt.A9Y
+ #
+ # Note: The directory must exist and be writable by
+ # the user running the sanitizer.
+ # (supposedly: $F -> file name, $$$ -> three arbitrary characters)
+ file_name_tpl = /var/spool/sanitizer/att-$F.$$$
+
+ # We have three policies, in addition to the default which is
+ # to defang file names.
+ #
+ file_list_rules = 3
+ file_default_policy = defang
+ file_default_filename = unnamed.file
+
+ # Delete obviously executable attachments. This list is
+ # incomplete! This is a perl regular expression, see "man
+ # perlre" for info. The (?i) prefix makes the regexp case
+ # insensitive.
+ #
+ file_list_1 = (?i)(winmail.dat)|
+ file_list_1 += (\.(exe|com|vb[se]|dll|ocx|cmd|bat|pif|lnk|hlp|ms[ip]|reg|sct
+ file_list_1 += |inf|asd|cab|sh[sb]|scr|cpl|chm|ws[fhc]|hta|vcd|vcf|eml|nws))$
+ file_list_1_policy = drop
+ file_list_1_scanner = 0
+
+ # Scan WinWord and Excel attachments with built-in macro scanner.
+ # We consider anything exceeding the score of 25 to be dangerous,
+ # and save it in the quarantine.
+ #
+ file_list_2 = (?i)\.(doc|dot|xls|xlw)$
+ file_list_2_policy = accept:accept:save:save
+ file_list_2_scanner = 0:1:2:builtin/macro 25# Do not log to STDERR:
+
+ # Allow file types considered "safe" (DO NOT JUST TRUST THIS LIST!)
+ file_list_3 = (?i)\.(
+ # Plain ASCII formats:
+ file_list_3 += txt|rtf|csv|dxf|htm|[sp]?html?|xml|xslt?|dtd|css|sgml
+ # PostScript (like) formats:
+ file_list_3 += |pdf|e?ps
+ # Word processor and document formats:
+ file_list_3 += |doc|dot|kwd|stw
+ # Spreadsheets:
+ file_list_3 += |xls|xlw|xlt|wk[1-4]|stc|ksp|gnumeric
+ # Presentation applications:
+ file_list_3 += |ppt|pps|pot|kpr|chrt
+ # Type setting formats:
+ file_list_3 += |dvi|texi?|tfm|txi|texinfo
+ # Flow charting:
+ file_list_3 += |flw
+ # Bitmap graphic files (maybe some are actually vector graphic formats):
+ file_list_3 += |jpe?g|gif|png|tiff?|bmp|psd|pcx|xcf|pat|pix|pnm|sgi|snp|ras|tga
+ file_list_3 += |xwd|xpm|dib|rle|cal|cas|pat|bmf|cel|cex|cgm|ico|img|jfi|jif|raw
+ file_list_3 += |crw|sun
+ # Vector graphics and diagramming:
+ file_list_3 += |vsd|drw|cdr|swf|pct|pict|kpm|kon
+ # Multimedia:
+ file_list_3 += |mp[23]|avi|mpe?g|mov|ram?|midi?|ogg|aiff?|au|snd|wav
+ # Archives:
+ file_list_3 += |zip|g?z|rar|tgz|t?bz2|tar|sit|sea|arc
+ # Package formats:
+ file_list_3 += |rpm|deb
+ # Others:
+ file_list_3 += |kfo
+ # Source code:
+ file_list_3 += |[ch](pp|\+\+)?|s|inc|asm|patch|java|php\d?|jsp|bas|ebuild)
+ file_list_3_policy = accept
+ file_list_3_scanner = 0
+
+ # Any file type not listed above gets renamed to prevent
+ # the mail client from auto-executing it.
+
+ #
+ # More sample file lists
+ #
+ # Scan mp3 files for Evil Viruses, using the imaginary mp3virscan
+ # utility. Always define FOUR potential policies, which depend on the
+ # exit code returned by the scanner. Which code means what is
+ # defined in the scanner line, which must contain THREE entries.
+ # The fourth policy is used for "anything else".
+ #
+ # "accept" if the file is clean (exit status 0 or 1)
+ # "mangle" if the file was dirty, but is now clean (2 or 4)
+ # "drop" if the file is still dirty (66)
+ # "save" if the mp3virscan utility returns some other exit code
+ # or an error occurs.
+ #
+ #file_list_4 = (?i)\.(mp3|mp2|mpg)$
+ #file_list_4_policy = accept:mangle:drop:save
+ #file_list_4_scanner = 0,1:2,4:66:/path/to/mp3virscan -opt -f %FILENAME
+
+ # Archives and scriptable stuff - virus scan these.
+ # NOTE: There must be THREE groups of exit codes and FOUR policies,
+ # - the first three match the code groups, the fourth is default.
+ #
+ #file_list_5_scanner = 0:5:3,4:/usr/local/bin/avp.sh %FILENAME
+ #file_list_5_policy = accept:accept:save:save
+ #file_list_5 = (?i)\.(xls|d(at|oc)|p(pt|l)|rtf|[sp]?html?
+ #file_list_5 += |class|upd|wp\d?|m?db
+ #file_list_5 += |z(ip|oo)|ar[cj]|lha|[tr]ar|rpm|deb|slp|tgz
+ #file_list_5 += )(\.g?z|\.bz\d?)*$
+
+
diff --git a/mail-filter/anomy-sanitizer/files/sample2_mailfilter.sh b/mail-filter/anomy-sanitizer/files/sample2_mailfilter.sh
new file mode 100644
index 00000000000..3448d0ac0ea
--- /dev/null
+++ b/mail-filter/anomy-sanitizer/files/sample2_mailfilter.sh
@@ -0,0 +1,83 @@
+#!/bin/sh
+#
+# spamassassin
+#
+# Simple filter to plug SpamAssassin only
+# into the Postfix MTA, using the spamc / spamd
+# daemon version of SpamAssassin.
+#
+# (Should result in higher performance on busy servers)
+#
+# NOTE: spamd must be running before using this script!
+#
+# For use with:
+# Postfix 20010228 or later
+# SpamAssassin 2.42 or later
+#
+############
+# #
+# UNTESTED #
+# #
+############
+
+
+# VARIABLES
+# ---------
+
+# File locations
+# (CHANGE AS REQUIRED TO MATCH YOUR SET-UP)
+INSPECT_DIR="/var/spool/sanitizer"
+#INSPECT_DIR="/var/spool/filter"
+SENDMAIL="/usr/lib/sendmail -i"
+ANOMY="/usr/share/anomy-sanitizer"
+ANOMY_BIN="${ANOMY}/bin/sanitizer.pl"
+ANOMY_CONF="/usr/share/anomy-sanitizer/anomy.conf"
+#ANOMY_LOG="/dev/null"
+ANOMY_LOG="/tmp/sanitizer.log"
+SPAMASSASSIN="/usr/bin/spamassassin"
+#SPAMASSASSIN_LOG="/dev/null"
+SPAMASSASSIN_LOG="/tmp/spamassassin.log"
+CAT="/bin/cat"
+
+# Messages
+UNABLE_TO_CD_INSPECTDIR="Impossible to change to ${INSPECT_DIR}"
+MSG_CONTENT_REJECTED="Message content rejected"
+
+# Exit codes from <sysexits.h>
+EX_TEMPFAIL=75
+EX_UNAVAILABLE=69
+
+# Users that execute different filters
+SPAMC_USER="sanitizer"
+
+export ANOMY
+
+
+# MAIN
+# ----
+
+cd ${INSPECT_DIR} || { echo ${UNABLE_TO_CD_INSPECTDIR} ; exit ${EX_TEMPFAIL}; }
+
+# Clean up when done or when aborting.
+trap "rm -f out.$$" 0 1 2 3 15
+
+# sanitizer only
+#${CAT} \
+# | ${ANOMY_BIN} ${ANOMY_CONF} 2>>${ANOMY_LOG} > out.$$ || \
+# { echo ${MSG_CONTENT_REJECTED}; exit ${EX_UNAVAILABLE}; }
+
+# sanitizer and SpamAssassin
+${CAT} \
+ | ${SPAMC} -f -u ${SPAMC_USER} 2>${SPAMASSASSIN_LOG} \
+ | ${ANOMY_BIN} ${ANOMY_CONF} 2>>${ANOMY_LOG} > out.$$ || \
+ { echo ${MSG_CONTENT_REJECTED}; exit ${EX_UNAVAILABLE}; }
+
+# SpamAssassin only
+#${CAT} \
+# | ${SPAMC} -f -u ${SPAMC_USER} 2>${SPAMASSASSIN_LOG} > out.$$ || \
+# { echo ${MSG_CONTENT_REJECTED}; exit ${EX_UNAVAILABLE}; }
+
+$SENDMAIL "$@" < out.$$
+
+exit 0
+
diff --git a/mail-filter/anomy-sanitizer/files/sample_mailfiler.sh b/mail-filter/anomy-sanitizer/files/sample_mailfiler.sh
new file mode 100644
index 00000000000..a258f4890de
--- /dev/null
+++ b/mail-filter/anomy-sanitizer/files/sample_mailfiler.sh
@@ -0,0 +1,76 @@
+#!/bin/sh
+#
+# spamc.sh
+#
+# Simple filter to plug SpamAssassin only
+# into the Postfix MTA, using the spamc / spamd
+# daemon version of SpamAssassin.
+#
+# (Should result in higher performance on busy servers)
+#
+# NOTE: spamd must be running before using this script!
+#
+# For use with:
+# Postfix 20010228 or later
+# SpamAssassin 2.42 or later
+#
+
+
+# VARIABLES
+# ---------
+
+# File locations
+# (CHANGE AS REQUIRED TO MATCH YOUR SET-UP)
+INSPECT_DIR="/var/spool/sanitizer"
+#INSPECT_DIR="/var/spool/filter"
+SENDMAIL="/usr/lib/sendmail -i"
+ANOMY="/usr/share/anomy-sanitizer"
+ANOMY_BIN="${ANOMY}/bin/sanitizer.pl"
+ANOMY_CONF="/usr/share/anomy-sanitizer/anomy.conf"
+#ANOMY_LOG="/dev/null"
+ANOMY_LOG="/tmp/sanitizer.log"
+SPAMC="/usr/bin/spamc"
+#SPAMC_LOG="/dev/null"
+SPAMC_LOG="/tmp/spamc.log"
+CAT="/bin/cat"
+
+# Messages
+UNABLE_TO_CD_INSPECTDIR="Impossible to change to ${INSPECT_DIR}"
+MSG_CONTENT_REJECTED="Message content rejected"
+
+# Exit codes from <sysexits.h>
+EX_TEMPFAIL=75
+EX_UNAVAILABLE=69
+
+# Users that execute different filters
+SPAMC_USER="sanitizer"
+
+export ANOMY
+
+
+# MAIN
+# ----
+
+cd ${INSPECT_DIR} || { echo ${UNABLE_TO_CD_INSPECTDIR} ; exit ${EX_TEMPFAIL}; }
+
+# sanitizer only
+#${CAT} \
+# | ${ANOMY_BIN} ${ANOMY_CONF} 2>>${ANOMY_LOG} \
+# | ${SENDMAIL} "$@" || \
+# { echo ${MSG_CONTENT_REJECTED}; exit ${EX_UNAVAILABLE}; }
+
+# sanitizer and SpamAssassin
+${CAT} \
+ | ${SPAMC} -f -u ${SPAMC_USER} 2>${SPAMC_LOG} \
+ | ${ANOMY_BIN} ${ANOMY_CONF} 2>>${ANOMY_LOG} \
+ | ${SENDMAIL} "$@" || \
+ { echo ${MSG_CONTENT_REJECTED}; exit ${EX_UNAVAILABLE}; }
+
+# SpamAssassin only
+#${CAT} \
+# | ${SPAMC} -f -u ${SPAMC_USER} 2>${SPAMC_LOG} \
+# | ${SENDMAIL} "$@" || \
+# { echo ${MSG_CONTENT_REJECTED}; exit ${EX_UNAVAILABLE}; }
+
+exit 0
+
diff --git a/mail-filter/anomy-sanitizer/metadata.xml b/mail-filter/anomy-sanitizer/metadata.xml
new file mode 100644
index 00000000000..91f4e72fb54
--- /dev/null
+++ b/mail-filter/anomy-sanitizer/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/mail-filter/anubis/Manifest b/mail-filter/anubis/Manifest
new file mode 100644
index 00000000000..55068622287
--- /dev/null
+++ b/mail-filter/anubis/Manifest
@@ -0,0 +1 @@
+DIST anubis-4.1.1.tar.gz 1104272 SHA256 93ef7a2d8bc3b50cd2e228cfe27e296ee14accadf8533bad9b2beee88a96e8fa SHA512 51e9c3a4cc4f217348522ba196daf26908f5ebed1abbe8c3f4c876847284e1f43f19d5cc68cde3cae5aacc55d42b7a6786f9afb23856c647ddf6d6c4b6c0a7a7 WHIRLPOOL 316e6d19b87b80f4f7c97899972deb31ca6d1797abb28d9a5eb4b8792f324bd69bf84a1f978e37cd4d98cbeead01a27cdb53a670a7e25d8ac2ed7860492a5b86
diff --git a/mail-filter/anubis/anubis-4.1.1-r1.ebuild b/mail-filter/anubis/anubis-4.1.1-r1.ebuild
new file mode 100644
index 00000000000..6809f8f8b65
--- /dev/null
+++ b/mail-filter/anubis/anubis-4.1.1-r1.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils autotools pam toolchain-funcs user
+
+DESCRIPTION="GNU Anubis is an outgoing mail processor"
+HOMEPAGE="http://www.gnu.org/software/anubis/"
+
+SRC_URI="mirror://gnu/anubis/${P}.tar.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="~amd64 ppc x86"
+IUSE="crypt guile mysql postgres nls pam pcre sasl socks5 +gnutls tcpd test"
+
+RDEPEND="sys-libs/gdbm
+ crypt? ( >=app-crypt/gpgme-0.9.0 )
+ guile? ( >=dev-scheme/guile-1.8 )
+ mysql? ( virtual/mysql )
+ pam? ( virtual/pam )
+ postgres? ( dev-db/postgresql[server] )
+ nls? ( sys-devel/gettext )
+ pcre? ( >=dev-libs/libpcre-3.9 )
+ sasl? ( virtual/gsasl )
+ gnutls? ( net-libs/gnutls )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 )"
+DEPEND="${RDEPEND}
+ test? ( dev-util/dejagnu )"
+
+REQUIRED_USE="mysql? ( sasl )
+ postgres? ( sasl )"
+
+pkg_setup() {
+ enewuser anubis
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-gnutls.patch
+ epatch "${FILESDIR}"/${PV}-gpgme.patch
+ epatch "${FILESDIR}"/${PV}-testsuite.patch
+ epatch "${FILESDIR}"/${PV}-gnutls3.patch
+ sed -i -e "s/1024-bit ELG-E/1024-bit ELG/" \
+ testsuite/etc/{gpgcrypt.pat,gpgse.pat}
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ if use crypt ; then
+ myconf="--with-gpgme --with-gpgme-prefix=$(gpgme-config --prefix)"
+ else
+ myconf="--without-gpgme"
+ fi
+ econf --with-unprivileged-user=anubis \
+ --disable-rpath \
+ $(use_with mysql) \
+ $(use_with postgres) \
+ $(use_with pam) \
+ $(use_with pcre) \
+ $(use_enable nls) \
+ $(use_with guile) \
+ $(use_with sasl gsasl) \
+ $(use_with gnutls) \
+ $(use_with tcpd tcp-wrappers) \
+ $(use_with socks5 socks-proxy) \
+ ${myconf}
+}
+
+src_compile() {
+ # parallel make fails
+ emake AR=$(tc-getAR) -j1
+}
+
+src_test() {
+ cd "${S}/testsuite"
+ emake -j1 check
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc AUTHORS ChangeLog INSTALL NEWS README* THANKS TODO
+ docinto examples
+ dodoc examples/*anubis*
+ docinto guile
+ dodoc guile/*.scm
+
+ if use pam ; then
+ pamd_mimic system-auth anubis auth account session
+ fi
+
+ rm -rf "${D}"/usr/share/anubis
+}
diff --git a/mail-filter/anubis/anubis-4.1.1.ebuild b/mail-filter/anubis/anubis-4.1.1.ebuild
new file mode 100644
index 00000000000..4d2c0c19960
--- /dev/null
+++ b/mail-filter/anubis/anubis-4.1.1.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils autotools pam user
+
+DESCRIPTION="GNU Anubis is an outgoing mail processor"
+HOMEPAGE="http://www.gnu.org/software/anubis/"
+
+SRC_URI="mirror://gnu/anubis/${P}.tar.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="ppc x86"
+IUSE="crypt guile mysql postgres nls pam pcre sasl socks5 +gnutls tcpd test"
+
+RDEPEND="sys-libs/gdbm
+ crypt? ( >=app-crypt/gpgme-0.9.0 )
+ guile? ( >=dev-scheme/guile-1.8 )
+ mysql? ( virtual/mysql )
+ pam? ( virtual/pam )
+ postgres? ( dev-db/postgresql[server] )
+ nls? ( sys-devel/gettext )
+ pcre? ( >=dev-libs/libpcre-3.9 )
+ sasl? ( virtual/gsasl )
+ gnutls? ( net-libs/gnutls )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 )"
+DEPEND="${RDEPEND}
+ test? ( dev-util/dejagnu )"
+
+REQUIRED_USE="mysql? ( sasl )
+ postgres? ( sasl )"
+
+pkg_setup() {
+ enewuser anubis
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-gnutls.patch
+ epatch "${FILESDIR}"/${PV}-gpgme.patch
+ epatch "${FILESDIR}"/${PV}-testsuite.patch
+ sed -i -e "s/1024-bit ELG-E/1024-bit ELG/" \
+ testsuite/etc/{gpgcrypt.pat,gpgse.pat}
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ if use crypt ; then
+ myconf="--with-gpgme --with-gpgme-prefix=$(gpgme-config --prefix)"
+ else
+ myconf="--without-gpgme"
+ fi
+ econf --with-unprivileged-user=anubis \
+ --disable-rpath \
+ $(use_with mysql) \
+ $(use_with postgres) \
+ $(use_with pam) \
+ $(use_with pcre) \
+ $(use_enable nls) \
+ $(use_with guile) \
+ $(use_with sasl gsasl) \
+ $(use_with gnutls) \
+ $(use_with tcpd tcp-wrappers) \
+ $(use_with socks5 socks-proxy) \
+ ${myconf}
+}
+
+src_compile() {
+ # parallel make fails
+ emake -j1
+}
+
+src_test() {
+ cd "${S}/testsuite"
+ emake -j1 check
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc AUTHORS ChangeLog INSTALL NEWS README* THANKS TODO
+ docinto examples
+ dodoc examples/*anubis*
+ docinto guile
+ dodoc guile/*.scm
+
+ if use pam ; then
+ pamd_mimic system-auth anubis auth account session
+ fi
+
+ rm -rf "${D}"/usr/share/anubis
+}
diff --git a/mail-filter/anubis/files/4.1.1-gnutls.patch b/mail-filter/anubis/files/4.1.1-gnutls.patch
new file mode 100644
index 00000000000..c4dd28bff69
--- /dev/null
+++ b/mail-filter/anubis/files/4.1.1-gnutls.patch
@@ -0,0 +1,11 @@
+--- configure.ac 2011-06-13 13:46:22.817856139 +0300
++++ configure.ac 2011-06-13 13:47:56.000000000 +0300
+@@ -277,7 +277,7 @@
+ if test $with_gnutls = yes; then
+ AC_CHECK_HEADERS(gnutls/gnutls.h)
+ if test $ac_cv_header_gnutls_gnutls_h != no; then
+- AM_PATH_LIBGNUTLS("1.0.0",
++ PKG_CHECK_MODULES(LIBGNUTLS, gnutls >= 1.0.0,
+ [M4_DEFS="$M4_DEFS -DWITH_SSL -DWITH_GNUTLS"
+ AC_DEFINE(USE_GNUTLS, 1,
+ [Define to 1 if USE_GNUTLS is requested.])],
diff --git a/mail-filter/anubis/files/4.1.1-gnutls3.patch b/mail-filter/anubis/files/4.1.1-gnutls3.patch
new file mode 100644
index 00000000000..c9d9197a218
--- /dev/null
+++ b/mail-filter/anubis/files/4.1.1-gnutls3.patch
@@ -0,0 +1,14 @@
+--- src/tls.c 2008-12-16 16:21:54.000000000 +0000
++++ src/tls.c 2012-10-30 09:06:37.387243098 +0000
+@@ -294,7 +294,10 @@
+ static void
+ verify_certificate (gnutls_session session)
+ {
+- int status = gnutls_certificate_verify_peers (session);
++ int status, verify_ret;
++ verify_ret = gnutls_certificate_verify_peers2 (session, &status);
++ if (!verify_ret)
++ return status;
+
+ if (status == GNUTLS_E_NO_CERTIFICATE_FOUND)
+ {
diff --git a/mail-filter/anubis/files/4.1.1-gpgme.patch b/mail-filter/anubis/files/4.1.1-gpgme.patch
new file mode 100644
index 00000000000..7aa8ba578ee
--- /dev/null
+++ b/mail-filter/anubis/files/4.1.1-gpgme.patch
@@ -0,0 +1,32 @@
+--- configure.ac 2011-06-13 19:40:37.856822010 +0300
++++ configure.ac 2011-06-13 19:43:27.000000000 +0300
+@@ -149,10 +149,18 @@
+ AC_MSG_CHECKING(for $1/include/gpgme.h)
+ AC_MSG_RESULT([yes])
+ return 0
++ else
++ if test -f "$1/include/gpgme/gpgme.h"; then
++ gpgmedir=1
++ INCLUDES="$INCLUDES -I$1/include/gpgme"
++ AC_MSG_CHECKING(for $1/include/gpgme/gpgme.h)
++ AC_MSG_RESULT([yes])
++ return 0
++ fi
+ fi
+ return 1
+ }
+- for maindir in /usr/pkg /opt /sw; do
++ for maindir in /usr/pkg /opt /sw /usr; do
+ findgpgmedir $maindir && break 2
+ done
+ if test $gpgmedir; then
+--- configure.ac 2011-06-17 11:54:29.000000000 +0000
++++ configure.ac 2011-06-17 11:56:22.000000000 +0000
+@@ -137,6 +137,7 @@
+ else
+ AM_PATH_GPGME([1.0.0], with_gpgme=yes, with_gpgme=no)
+ AC_CHECK_LIB(gpgme, main,, with_gpgme=no)
++ AC_CHECK_LIB(gpg-error, gpg_err_init,, with_gpgme=no)
+ fi
+ if test "$with_gpgme" = "no"; then
+ AC_MSG_RESULT([Disabling GPGME support...])
diff --git a/mail-filter/anubis/files/4.1.1-testsuite.patch b/mail-filter/anubis/files/4.1.1-testsuite.patch
new file mode 100644
index 00000000000..5b1c656fa0a
--- /dev/null
+++ b/mail-filter/anubis/files/4.1.1-testsuite.patch
@@ -0,0 +1,14 @@
+--- testsuite/data/Makefile.am 2011-06-13 14:29:38.843665225 +0300
++++ testsuite/data/Makefile.am 2011-06-13 14:31:16.000000000 +0300
+@@ -22,8 +22,10 @@
+ EXTRA_DIST = pubring.asc secring.asc anubis.pem append.txt users
+ CLEANFILES = *.gpg random_seed *~ text.db
+
+-pubring.gpg secring.gpg: $(srcdir)/pubring.asc $(srcdir)/secring.asc
++pubring.gpg: $(srcdir)/pubring.asc
+ $(GPG) --homedir . --import < $(srcdir)/pubring.asc
++
++secring.gpg: $(srcdir)/secring.asc
+ $(GPG) --homedir . --allow-secret-key-import --import < $(srcdir)/secring.asc
+
+ text.db: $(srcdir)/users
diff --git a/mail-filter/anubis/metadata.xml b/mail-filter/anubis/metadata.xml
new file mode 100644
index 00000000000..51f94e3fbe0
--- /dev/null
+++ b/mail-filter/anubis/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-mail</herd>
+</pkgmetadata>
diff --git a/mail-filter/ask/Manifest b/mail-filter/ask/Manifest
new file mode 100644
index 00000000000..8ebad0876d0
--- /dev/null
+++ b/mail-filter/ask/Manifest
@@ -0,0 +1,2 @@
+DIST ask-2.4.1.tar.gz 102631 SHA256 1b5aedca6ff52cb6067f07ca6f8766e86ab4dd2b19585a3e4221c01cc50f147d
+DIST ask-2.5.3.tar.gz 106339 SHA256 f5f90d9006f655673104d45f803a6e7e1f9baba708a51510cf16e5e753183f15
diff --git a/mail-filter/ask/ask-2.4.1.ebuild b/mail-filter/ask/ask-2.4.1.ebuild
new file mode 100644
index 00000000000..3cdfa73cd09
--- /dev/null
+++ b/mail-filter/ask/ask-2.4.1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="Active Spam Killer: A program to filter spam"
+HOMEPAGE="http://www.paganini.net/ask/index.html"
+SRC_URI="mirror://sourceforge/a-s-k/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="ppc x86"
+
+IUSE="procmail"
+RDEPEND=">=dev-lang/python-2.2
+ virtual/mta
+ procmail? ( >=mail-filter/procmail-3.22 )"
+
+src_install() {
+ into /
+ dobin ask.py asksetup.py askversion.py utils/asksenders.py
+
+ insinto /usr/lib/ask
+ doins askconfig.py asklock.py asklog.py askmail.py askmain.py \
+ askmessage.py askremote.py
+
+ insinto /usr/share/ask/samples
+ doins samples/*
+
+ insinto /usr/share/ask/templates
+ doins templates/*
+
+ insinto /usr/share/ask/utils
+ doins utils/*
+
+ doman docs/*.1
+
+ dodoc ChangeLog TODO docs/ask_doc*
+}
+
+pkg_postinst() {
+ elog
+ elog "You MUST run the asksetup.py file to configure ASK!"
+ elog
+ if use procmail; then
+ elog "To use ASK's procmail support these should be your first two procmail rules:"
+ elog
+ elog ":0 fW"
+ elog "|/path_to_ask/ask.py --procmail --loglevel=5 --logfile=/your_home/ask.log"
+ elog
+ elog ":0 e"
+ elog "/dev/null"
+ elog
+ elog "The second rule above instructs procmail to deliver the message to /dev/null"
+ elog "if ASK returns a fail code. If you're truly paranoid, you can save those"
+ elog "messages to a file instead for later inspection."
+ fi
+}
diff --git a/mail-filter/ask/ask-2.5.3.ebuild b/mail-filter/ask/ask-2.5.3.ebuild
new file mode 100644
index 00000000000..72c30d90560
--- /dev/null
+++ b/mail-filter/ask/ask-2.5.3.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit multilib
+
+DESCRIPTION="Active Spam Killer: A program to filter spam"
+HOMEPAGE="http://www.paganini.net/ask/index.html"
+SRC_URI="mirror://sourceforge/a-s-k/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+
+IUSE="procmail"
+RDEPEND="dev-lang/python
+ virtual/mta
+ procmail? ( >=mail-filter/procmail-3.22 )"
+
+src_install() {
+ dobin askfilter asksetup askversion.py utils/asksenders
+
+ insinto /usr/$(get_libdir)/ask
+ doins askconfig.py asklock.py asklog.py askmail.py askmain.py \
+ askmessage.py askremote.py
+
+ insinto /usr/share/ask/templates
+ doins templates/*
+
+ insinto /usr/share/ask/utils
+ doins utils/*
+
+ doman docs/*.1
+
+ dodoc ChangeLog docs/ask_doc*
+}
+
+pkg_postinst() {
+ elog "You MUST run the asksetup file to configure ASK!"
+ elog "WARNING: if you upgrade from ask-2.4.1, you must replace ask.py with askfilter"
+ elog " in your procmail/maildrop recipe!"
+}
diff --git a/mail-filter/ask/metadata.xml b/mail-filter/ask/metadata.xml
new file mode 100644
index 00000000000..6e7a699e30a
--- /dev/null
+++ b/mail-filter/ask/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <use>
+ <flag name="procmail">Adds support for
+ <pkg>mail-filter/procmail</pkg></flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">a-s-k</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/assp/Manifest b/mail-filter/assp/Manifest
new file mode 100644
index 00000000000..ee3607d5bc5
--- /dev/null
+++ b/mail-filter/assp/Manifest
@@ -0,0 +1,5 @@
+DIST ASSP_1.8.5.9-Install.zip 750552 SHA256 f468d8cd0003280ff089efd438c0516f928f772fd9cc0e6d522866a21492ccb1
+DIST ASSP_1.9.4.7-Install.zip 1461151 SHA256 47180d185624a96d4b218fa48d30997cb048cf5a01ea43140b203ce9cab6edb9 SHA512 02083320630831fee048e13d6101dd844aceadddf36a5f2b5bff6f203d67be2e456fb992a71e903a9dace48992962a6d26f90998025b8666e24f3f4aaec76cfc WHIRLPOOL 07bd6c83f9a70c7cadbc5834979c49221fe053e5ab42cb747d09aec402553c8b3ee1677a786276f536c242ff6622405d43dada55bbf8744cf647b6c13c8251f3
+DIST ASSP_1.9.4.8-Install.zip 1462121 SHA256 075716ac57795bccfbe5b858eaabf908de93391c3a7b36144a5c2bcb4f8e3a1e SHA512 4888bfb4e8577608ee638391c6c9f38901f70e60fa29829d0f5a56102f13ba08b8363d9041bfb64d9d238526bc4051d5d97faddd6d819909d6dd4e6aa0a96225 WHIRLPOOL 1d71512d36b5e2e1ef0c05b6ade11c2285ad3498d6e2bf3c14f564ac8840a76b59492385d375369e16b049c9821d9f90627122eb7f113a6ee29dd7cf16b67aed
+DIST ASSP_1.9.4.9-Install.zip 1461140 SHA256 5392340a6c331102dc8c254a668ae061fe340ea304a8e22e8d6766c172bc72ad SHA512 a049a8e36193aee12c7abc7bbfdc41a92a7a33f6f01f7e6cded406f1f84ddf3c514808ca1c4c6a25c3a441b3a2792b4451ca218021bb09dad508a56434c8656b WHIRLPOOL 4f0b140c8395b935a270ef08b5cc2aca86d04a047efb95ff3780b43aa18c3e1ea032c9e460495cd611cbbfb19dfe526b439cb6a0fe15a8d4d13feaebd0059a70
+DIST ASSP_1.98_13030_install.zip 874117 SHA256 f3a500f5b00f53177ca71b7b8806c4b4dbf6642d0b068d08f828395e402ee7fe SHA512 46c067c9ffe98f860669166fca69346c974bc82a1c0a5046f607aae8344fe18d41f7a87c2f79bdfcaa24c6233a88a590031deab66c76d42fee78fec64dc2a2a1 WHIRLPOOL 6951a479f8b6873b9a27101071c9214607d9da8700924a305cc99bd79ff13bfc5bc32e8045c213d32f810f7aac7759b6f9f0d8fead656b03bbfa5c5436f2b085
diff --git a/mail-filter/assp/assp-1.8.5.9.ebuild b/mail-filter/assp/assp-1.8.5.9.ebuild
new file mode 100644
index 00000000000..e5d996ca228
--- /dev/null
+++ b/mail-filter/assp/assp-1.8.5.9.ebuild
@@ -0,0 +1,177 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils user
+
+DESCRIPTION="Anti-Spam SMTP Proxy written in Perl"
+HOMEPAGE="http://assp.sourceforge.net/"
+MY_PN=ASSP_${PV}-Install
+SRC_URI="mirror://sourceforge/${PN}/${MY_PN}.zip"
+LICENSE="GPL-2"
+SLOT="0"
+
+KEYWORDS="amd64 x86"
+
+IUSE="ipv6 ldap sasl spf srs ssl syslog"
+
+DEPEND="app-arch/unzip"
+
+RDEPEND="dev-lang/perl
+ dev-perl/Net-DNS
+ dev-perl/File-ReadBackwards
+ virtual/perl-IO-Compress
+ dev-perl/Email-MIME
+ dev-perl/Email-Send
+ dev-perl/Email-Valid
+ dev-perl/libwww-perl
+ dev-perl/mime-construct
+ dev-perl/Net-CIDR-Lite
+ virtual/perl-Digest-MD5
+ virtual/perl-Time-HiRes
+ ipv6? ( dev-perl/IO-Socket-INET6 )
+ sasl? ( dev-perl/Authen-SASL )
+ spf? ( dev-perl/Mail-SPF )
+ srs? ( dev-perl/Mail-SRS )
+ ssl? ( dev-perl/IO-Socket-SSL )
+ syslog? ( virtual/perl-Sys-Syslog )
+ ldap? ( dev-perl/perl-ldap )"
+
+S=${WORKDIR}/${MY_PN}/ASSP
+
+pkg_setup() {
+ enewgroup assp
+ enewuser assp -1 -1 /dev/null assp
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ local FILES="
+ assp.pl
+ rebuildspamdb.pl
+ stat.pl
+ "
+ # just being safe
+ for file in ${FILES}; do
+ edos2unix ${file}
+ done
+
+ # portable changes via sed vs patch
+ sed -i -e 's|file:files/|file:/etc/assp/|' \
+ -e 's|$base/images|/usr/share/assp/images|' \
+ -e 's|logs/maillog.txt|/var/log/assp/maillog.txt|' \
+ -e 's|PID File'\'',40,textinput,'\''pid'\''|PID File'\'',40,textinput,'\''asspd.pid'\''|' \
+ -e 's|Daemon\*\*'\'',0,checkbox,0|Daemon\*\*'\'',0,checkbox,1|' \
+ -e 's|UID\*\*'\'',20,textinput,'\'''\''|UID\*\*'\'',20,textinput,'\''assp'\''|' \
+ -e 's|GID\*\*'\'',20,textinput,'\'''\''|GID\*\*'\'',20,textinput,'\''assp'\''|' \
+ -e 's|popFileEditor'\('\\'\''pb/pbdb\.\([^\.]*\)\.db\\'\'',|popFileEditor(\\'\''/var/lib/assp/pb/pbdb.\1.db\\'\'',|g' \
+ -e 's|$base/assp.cfg|/etc/assp/assp.cfg|g' \
+ -e 's|$base/$pidfile|/var/run/assp/asspd.pid|' \
+ -e 's|mkdir "$base/$logdir",0700 if $logdir;||' \
+ -e 's|mkdir "$base/$logdir",0700;||' \
+ -e 's|$base/$logfile|$logfile|' \
+ -e 's|$base/$logdir|$logdir|' \
+ -e 's|"maillog.log"|"/var/log/assp/maillog.log"|' \
+ -e 's|-d "$base/logs" or mkdir "$base/logs",0700;||' \
+ -e 's|-d "$base/notes" or mkdir "$base/notes",0700;||' \
+ -e 's|-d "$base/docs" or mkdir "$base/docs",0777;||' \
+ -e 's|$base/$archivelogfile|$archivelogfile|' \
+ -e 's|"$base/$file",$sub,"$this|"/etc/assp/$file",$sub,"$this|' \
+ -e 's|"$base/$file",'\'''\'',"$this|"/etc/assp/$file",'\'''\'',"$this|' \
+ -e 's|my $fil=$1; $fil="$base/$fil" if $fil!~/^\\Q$base\\E/i;|my $fil=$1;|' \
+ -e 's|$fil="$base/$fil" if $fil!~/^\\Q$base\\E/i;|$fil="/etc/assp/$fil" if $fil!~/^\\/etc\\/assp\\/\|\\/var\\/lib\\/assp\\/\/i;|' \
+ -e 's|$fil="$base/$fil" if $fil!~/^((\[a-z\]:)?\[\\/\\\\\]\|\\Q$base\\E)/;||' \
+ -e 's|if ($fil !~ /^\\Q$base\\E/i) {|if ($fil !~ /^\\/usr\\/share\\/assp\\//i) {|' \
+ -e 's|$fil = "$base/$fil";|$fil = "/usr/share/assp/$fil";|' \
+ -e 's|Q$base\\E|Q\\/etc\\/assp\\/\\E|' \
+ -e 's|$fil="$base/$fil"|$fil="/etc/assp/$fil"|' \
+ -e 's|$base/$bf|/etc/assp/$bf|g' \
+ -e 's|rebuildrun.txt|/var/lib/assp/rebuildrun.txt|' \
+ assp.pl || die
+
+ # sed rebuildspamdb.pl
+ sed -i -e 's|assp.cfg|/etc/assp/assp.cfg|' \
+ -e 's|} && "$Config{base}/$Config{logfile}" \|\| '\''maillog.txt'\'';|};|' \
+ -e 's|tmaxtick('\''rebuild'\'');|tmaxtick('\''/var/lib/assp/rebuild'\'');|' \
+ -e 's|goodhosts|/var/lib/assp/goodhosts|g' \
+ -e 's|rebuildrun.txt|/var/lib/assp/rebuildrun.txt|' \
+ -e 's|$base/$DropList|$DropList|' \
+ -e 's|&fixPath($base) . "/|"|' \
+ -e 's|= "/var/lib/assp/rebuildrun.txt";|= "/var/lib/assp/rebuildrun.txt";\n $RebuildLog = "/var/lib/assp/rebuild.log";|' \
+ -e 's|"$base//|"/|g' \
+ rebuildspamdb.pl || die
+
+ # remove windows stuff
+ rm "${S}/addservice.pl" || die "Could not remove ${S}/addservice.pl"
+ rm -f "${S}/Win32-quickstart-guide.txt" || die "Could not remove ${S}/Win32-quickstart-guide.txt"
+}
+
+src_install() {
+ # Configuration directory
+ dodir /etc/assp/notes
+
+ insinto /etc/assp
+ # Installs files that are used by assp for black/gray lists,
+ # and domain country lookup. To be changed by admin as needed.
+ doins files/*.txt || die
+
+ fowners assp:assp /etc/assp -R
+ fperms 770 /etc/assp /etc/assp/notes
+
+ # Setup directories for mail to be stored for filter
+ keepdir /var/lib/assp/spam /var/lib/assp/notspam
+ keepdir /var/lib/assp/errors/spam /var/lib/assp/errors/notspam
+
+ # Logs directory
+ keepdir /var/log/assp
+ fowners assp:assp -R /var/log/assp
+ fperms 770 /var/log/assp
+
+ # Install the app
+ exeinto /usr/share/assp
+ doexe *.pl *.sh || die
+ insinto /usr/share/assp
+ doins -r images/ || die
+
+ # Lock down the files/data
+ fowners assp:assp -R /usr/share/assp
+ fperms 770 /usr/share/assp
+
+ # Data storage
+ fowners assp:assp -R /var/lib/assp
+ fperms 770 /var/lib/assp
+
+ # PID directory
+ dodir /var/run/assp
+ keepdir /var/run/assp
+ fowners assp:assp -R /var/run/assp
+ fperms 770 /var/run/assp
+
+ # Install the init.d script to listen
+ newinitd "${FILESDIR}/asspd.init" asspd
+
+ dohtml docs/*.htm || die "Failed to install html docs"
+}
+
+pkg_postinst() {
+ elog
+ elog "To configure ASSP, start /etc/init.d/asspd then point"
+ elog "your browser to http://localhost:55555"
+ elog "Username: admin Password: nospam4me (CHANGE ASAP!)"
+ elog
+ elog "File permissions have been set to use assp:assp"
+ elog "with mode 770 on directories. When you configure"
+ elog "ASSP, make sure and use the user assp."
+ elog
+ elog "Don't change any path related options."
+ elog
+ elog "See the on-line docs for a complete tutorial."
+ elog "http://assp.sourceforge.net/docs.html"
+ elog
+ elog "If upgrading, please update your old config to set both"
+ elog "redre.txt and nodelay.txt path of /etc/assp. There are"
+ elog "also many new options that you should review."
+ elog
+}
diff --git a/mail-filter/assp/assp-1.9.4.7.ebuild b/mail-filter/assp/assp-1.9.4.7.ebuild
new file mode 100644
index 00000000000..dd35a454c32
--- /dev/null
+++ b/mail-filter/assp/assp-1.9.4.7.ebuild
@@ -0,0 +1,178 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils user
+
+DESCRIPTION="Anti-Spam SMTP Proxy written in Perl"
+HOMEPAGE="http://assp.sourceforge.net/"
+MY_PN=ASSP_${PV}-Install
+SRC_URI="mirror://sourceforge/${PN}/${MY_PN}.zip"
+LICENSE="GPL-2"
+SLOT="0"
+
+# this is a pre-release, so no keywords for now
+KEYWORDS="~amd64 ~x86"
+
+IUSE="ipv6 ldap sasl spf srs ssl syslog"
+
+DEPEND="app-arch/unzip"
+
+RDEPEND="dev-lang/perl
+ dev-perl/Net-DNS
+ dev-perl/File-ReadBackwards
+ virtual/perl-IO-Compress
+ dev-perl/Email-MIME
+ dev-perl/Email-Send
+ dev-perl/Email-Valid
+ dev-perl/libwww-perl
+ dev-perl/mime-construct
+ dev-perl/Net-CIDR-Lite
+ virtual/perl-Digest-MD5
+ virtual/perl-Time-HiRes
+ ipv6? ( dev-perl/IO-Socket-INET6 )
+ sasl? ( dev-perl/Authen-SASL )
+ spf? ( dev-perl/Mail-SPF )
+ srs? ( dev-perl/Mail-SRS )
+ ssl? ( dev-perl/IO-Socket-SSL )
+ syslog? ( virtual/perl-Sys-Syslog )
+ ldap? ( dev-perl/perl-ldap )"
+
+S=${WORKDIR}/${MY_PN}/ASSP
+
+pkg_setup() {
+ enewgroup assp
+ enewuser assp -1 -1 /dev/null assp
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ local FILES="
+ assp.pl
+ rebuildspamdb.pl
+ stat.pl
+ "
+ # just being safe
+ for file in ${FILES}; do
+ edos2unix ${file}
+ done
+
+ # portable changes via sed vs patch
+ sed -i -e 's|file:files/|file:/etc/assp/|' \
+ -e 's|$base/images|/usr/share/assp/images|' \
+ -e 's|logs/maillog.txt|/var/log/assp/maillog.txt|' \
+ -e 's|PID File'\'',40,textinput,'\''pid'\''|PID File'\'',40,textinput,'\''asspd.pid'\''|' \
+ -e 's|Daemon\*\*'\'',0,checkbox,0|Daemon\*\*'\'',0,checkbox,1|' \
+ -e 's|UID\*\*'\'',20,textinput,'\'''\''|UID\*\*'\'',20,textinput,'\''assp'\''|' \
+ -e 's|GID\*\*'\'',20,textinput,'\'''\''|GID\*\*'\'',20,textinput,'\''assp'\''|' \
+ -e 's|popFileEditor'\('\\'\''pb/pbdb\.\([^\.]*\)\.db\\'\'',|popFileEditor(\\'\''/var/lib/assp/pb/pbdb.\1.db\\'\'',|g' \
+ -e 's|$base/assp.cfg|/etc/assp/assp.cfg|g' \
+ -e 's|$base/$pidfile|/var/run/assp/asspd.pid|' \
+ -e 's|mkdir "$base/$logdir",0700 if $logdir;||' \
+ -e 's|mkdir "$base/$logdir",0700;||' \
+ -e 's|$base/$logfile|$logfile|' \
+ -e 's|$base/$logdir|$logdir|' \
+ -e 's|"maillog.log"|"/var/log/assp/maillog.log"|' \
+ -e 's|-d "$base/logs" or mkdir "$base/logs",0700;||' \
+ -e 's|-d "$base/notes" or mkdir "$base/notes",0700;||' \
+ -e 's|-d "$base/docs" or mkdir "$base/docs",0777;||' \
+ -e 's|$base/$archivelogfile|$archivelogfile|' \
+ -e 's|"$base/$file",$sub,"$this|"/etc/assp/$file",$sub,"$this|' \
+ -e 's|"$base/$file",'\'''\'',"$this|"/etc/assp/$file",'\'''\'',"$this|' \
+ -e 's|my $fil=$1; $fil="$base/$fil" if $fil!~/^\\Q$base\\E/i;|my $fil=$1;|' \
+ -e 's|$fil="$base/$fil" if $fil!~/^\\Q$base\\E/i;|$fil="/etc/assp/$fil" if $fil!~/^\\/etc\\/assp\\/\|\\/var\\/lib\\/assp\\/\/i;|' \
+ -e 's|$fil="$base/$fil" if $fil!~/^((\[a-z\]:)?\[\\/\\\\\]\|\\Q$base\\E)/;||' \
+ -e 's|if ($fil !~ /^\\Q$base\\E/i) {|if ($fil !~ /^\\/usr\\/share\\/assp\\//i) {|' \
+ -e 's|$fil = "$base/$fil";|$fil = "/usr/share/assp/$fil";|' \
+ -e 's|Q$base\\E|Q\\/etc\\/assp\\/\\E|' \
+ -e 's|$fil="$base/$fil"|$fil="/etc/assp/$fil"|' \
+ -e 's|$base/$bf|/etc/assp/$bf|g' \
+ -e 's|rebuildrun.txt|/var/lib/assp/rebuildrun.txt|' \
+ assp.pl || die
+
+ # sed rebuildspamdb.pl
+ sed -i -e 's|assp.cfg|/etc/assp/assp.cfg|' \
+ -e 's|} && "$Config{base}/$Config{logfile}" \|\| '\''maillog.txt'\'';|};|' \
+ -e 's|tmaxtick('\''rebuild'\'');|tmaxtick('\''/var/lib/assp/rebuild'\'');|' \
+ -e 's|goodhosts|/var/lib/assp/goodhosts|g' \
+ -e 's|rebuildrun.txt|/var/lib/assp/rebuildrun.txt|' \
+ -e 's|$base/$DropList|$DropList|' \
+ -e 's|&fixPath($base) . "/|"|' \
+ -e 's|= "/var/lib/assp/rebuildrun.txt";|= "/var/lib/assp/rebuildrun.txt";\n $RebuildLog = "/var/lib/assp/rebuild.log";|' \
+ -e 's|"$base//|"/|g' \
+ rebuildspamdb.pl || die
+
+ # remove windows stuff
+ rm "${S}/addservice.pl" || die "Could not remove ${S}/addservice.pl"
+ rm -f "${S}/Win32-quickstart-guide.txt" || die "Could not remove ${S}/Win32-quickstart-guide.txt"
+}
+
+src_install() {
+ # Configuration directory
+ dodir /etc/assp/notes
+
+ insinto /etc/assp
+ # Installs files that are used by assp for black/gray lists,
+ # and domain country lookup. To be changed by admin as needed.
+ doins files/*.txt || die
+
+ fowners assp:assp /etc/assp -R
+ fperms 770 /etc/assp /etc/assp/notes
+
+ # Setup directories for mail to be stored for filter
+ keepdir /var/lib/assp/spam /var/lib/assp/notspam
+ keepdir /var/lib/assp/errors/spam /var/lib/assp/errors/notspam
+
+ # Logs directory
+ keepdir /var/log/assp
+ fowners assp:assp -R /var/log/assp
+ fperms 770 /var/log/assp
+
+ # Install the app
+ exeinto /usr/share/assp
+ doexe *.pl *.sh || die
+ insinto /usr/share/assp
+ doins -r images/ || die
+
+ # Lock down the files/data
+ fowners assp:assp -R /usr/share/assp
+ fperms 770 /usr/share/assp
+
+ # Data storage
+ fowners assp:assp -R /var/lib/assp
+ fperms 770 /var/lib/assp
+
+ # PID directory
+ dodir /var/run/assp
+ keepdir /var/run/assp
+ fowners assp:assp -R /var/run/assp
+ fperms 770 /var/run/assp
+
+ # Install the init.d script to listen
+ newinitd "${FILESDIR}/asspd.init" asspd
+
+ dohtml docs/*.htm || die "Failed to install html docs"
+}
+
+pkg_postinst() {
+ elog
+ elog "To configure ASSP, start /etc/init.d/asspd then point"
+ elog "your browser to http://localhost:55555"
+ elog "Username: admin Password: nospam4me (CHANGE ASAP!)"
+ elog
+ elog "File permissions have been set to use assp:assp"
+ elog "with mode 770 on directories. When you configure"
+ elog "ASSP, make sure and use the user assp."
+ elog
+ elog "Don't change any path related options."
+ elog
+ elog "See the on-line docs for a complete tutorial."
+ elog "http://assp.sourceforge.net/docs.html"
+ elog
+ elog "If upgrading, please update your old config to set both"
+ elog "redre.txt and nodelay.txt path of /etc/assp. There are"
+ elog "also many new options that you should review."
+ elog
+}
diff --git a/mail-filter/assp/assp-1.9.4.8.ebuild b/mail-filter/assp/assp-1.9.4.8.ebuild
new file mode 100644
index 00000000000..dd35a454c32
--- /dev/null
+++ b/mail-filter/assp/assp-1.9.4.8.ebuild
@@ -0,0 +1,178 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils user
+
+DESCRIPTION="Anti-Spam SMTP Proxy written in Perl"
+HOMEPAGE="http://assp.sourceforge.net/"
+MY_PN=ASSP_${PV}-Install
+SRC_URI="mirror://sourceforge/${PN}/${MY_PN}.zip"
+LICENSE="GPL-2"
+SLOT="0"
+
+# this is a pre-release, so no keywords for now
+KEYWORDS="~amd64 ~x86"
+
+IUSE="ipv6 ldap sasl spf srs ssl syslog"
+
+DEPEND="app-arch/unzip"
+
+RDEPEND="dev-lang/perl
+ dev-perl/Net-DNS
+ dev-perl/File-ReadBackwards
+ virtual/perl-IO-Compress
+ dev-perl/Email-MIME
+ dev-perl/Email-Send
+ dev-perl/Email-Valid
+ dev-perl/libwww-perl
+ dev-perl/mime-construct
+ dev-perl/Net-CIDR-Lite
+ virtual/perl-Digest-MD5
+ virtual/perl-Time-HiRes
+ ipv6? ( dev-perl/IO-Socket-INET6 )
+ sasl? ( dev-perl/Authen-SASL )
+ spf? ( dev-perl/Mail-SPF )
+ srs? ( dev-perl/Mail-SRS )
+ ssl? ( dev-perl/IO-Socket-SSL )
+ syslog? ( virtual/perl-Sys-Syslog )
+ ldap? ( dev-perl/perl-ldap )"
+
+S=${WORKDIR}/${MY_PN}/ASSP
+
+pkg_setup() {
+ enewgroup assp
+ enewuser assp -1 -1 /dev/null assp
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ local FILES="
+ assp.pl
+ rebuildspamdb.pl
+ stat.pl
+ "
+ # just being safe
+ for file in ${FILES}; do
+ edos2unix ${file}
+ done
+
+ # portable changes via sed vs patch
+ sed -i -e 's|file:files/|file:/etc/assp/|' \
+ -e 's|$base/images|/usr/share/assp/images|' \
+ -e 's|logs/maillog.txt|/var/log/assp/maillog.txt|' \
+ -e 's|PID File'\'',40,textinput,'\''pid'\''|PID File'\'',40,textinput,'\''asspd.pid'\''|' \
+ -e 's|Daemon\*\*'\'',0,checkbox,0|Daemon\*\*'\'',0,checkbox,1|' \
+ -e 's|UID\*\*'\'',20,textinput,'\'''\''|UID\*\*'\'',20,textinput,'\''assp'\''|' \
+ -e 's|GID\*\*'\'',20,textinput,'\'''\''|GID\*\*'\'',20,textinput,'\''assp'\''|' \
+ -e 's|popFileEditor'\('\\'\''pb/pbdb\.\([^\.]*\)\.db\\'\'',|popFileEditor(\\'\''/var/lib/assp/pb/pbdb.\1.db\\'\'',|g' \
+ -e 's|$base/assp.cfg|/etc/assp/assp.cfg|g' \
+ -e 's|$base/$pidfile|/var/run/assp/asspd.pid|' \
+ -e 's|mkdir "$base/$logdir",0700 if $logdir;||' \
+ -e 's|mkdir "$base/$logdir",0700;||' \
+ -e 's|$base/$logfile|$logfile|' \
+ -e 's|$base/$logdir|$logdir|' \
+ -e 's|"maillog.log"|"/var/log/assp/maillog.log"|' \
+ -e 's|-d "$base/logs" or mkdir "$base/logs",0700;||' \
+ -e 's|-d "$base/notes" or mkdir "$base/notes",0700;||' \
+ -e 's|-d "$base/docs" or mkdir "$base/docs",0777;||' \
+ -e 's|$base/$archivelogfile|$archivelogfile|' \
+ -e 's|"$base/$file",$sub,"$this|"/etc/assp/$file",$sub,"$this|' \
+ -e 's|"$base/$file",'\'''\'',"$this|"/etc/assp/$file",'\'''\'',"$this|' \
+ -e 's|my $fil=$1; $fil="$base/$fil" if $fil!~/^\\Q$base\\E/i;|my $fil=$1;|' \
+ -e 's|$fil="$base/$fil" if $fil!~/^\\Q$base\\E/i;|$fil="/etc/assp/$fil" if $fil!~/^\\/etc\\/assp\\/\|\\/var\\/lib\\/assp\\/\/i;|' \
+ -e 's|$fil="$base/$fil" if $fil!~/^((\[a-z\]:)?\[\\/\\\\\]\|\\Q$base\\E)/;||' \
+ -e 's|if ($fil !~ /^\\Q$base\\E/i) {|if ($fil !~ /^\\/usr\\/share\\/assp\\//i) {|' \
+ -e 's|$fil = "$base/$fil";|$fil = "/usr/share/assp/$fil";|' \
+ -e 's|Q$base\\E|Q\\/etc\\/assp\\/\\E|' \
+ -e 's|$fil="$base/$fil"|$fil="/etc/assp/$fil"|' \
+ -e 's|$base/$bf|/etc/assp/$bf|g' \
+ -e 's|rebuildrun.txt|/var/lib/assp/rebuildrun.txt|' \
+ assp.pl || die
+
+ # sed rebuildspamdb.pl
+ sed -i -e 's|assp.cfg|/etc/assp/assp.cfg|' \
+ -e 's|} && "$Config{base}/$Config{logfile}" \|\| '\''maillog.txt'\'';|};|' \
+ -e 's|tmaxtick('\''rebuild'\'');|tmaxtick('\''/var/lib/assp/rebuild'\'');|' \
+ -e 's|goodhosts|/var/lib/assp/goodhosts|g' \
+ -e 's|rebuildrun.txt|/var/lib/assp/rebuildrun.txt|' \
+ -e 's|$base/$DropList|$DropList|' \
+ -e 's|&fixPath($base) . "/|"|' \
+ -e 's|= "/var/lib/assp/rebuildrun.txt";|= "/var/lib/assp/rebuildrun.txt";\n $RebuildLog = "/var/lib/assp/rebuild.log";|' \
+ -e 's|"$base//|"/|g' \
+ rebuildspamdb.pl || die
+
+ # remove windows stuff
+ rm "${S}/addservice.pl" || die "Could not remove ${S}/addservice.pl"
+ rm -f "${S}/Win32-quickstart-guide.txt" || die "Could not remove ${S}/Win32-quickstart-guide.txt"
+}
+
+src_install() {
+ # Configuration directory
+ dodir /etc/assp/notes
+
+ insinto /etc/assp
+ # Installs files that are used by assp for black/gray lists,
+ # and domain country lookup. To be changed by admin as needed.
+ doins files/*.txt || die
+
+ fowners assp:assp /etc/assp -R
+ fperms 770 /etc/assp /etc/assp/notes
+
+ # Setup directories for mail to be stored for filter
+ keepdir /var/lib/assp/spam /var/lib/assp/notspam
+ keepdir /var/lib/assp/errors/spam /var/lib/assp/errors/notspam
+
+ # Logs directory
+ keepdir /var/log/assp
+ fowners assp:assp -R /var/log/assp
+ fperms 770 /var/log/assp
+
+ # Install the app
+ exeinto /usr/share/assp
+ doexe *.pl *.sh || die
+ insinto /usr/share/assp
+ doins -r images/ || die
+
+ # Lock down the files/data
+ fowners assp:assp -R /usr/share/assp
+ fperms 770 /usr/share/assp
+
+ # Data storage
+ fowners assp:assp -R /var/lib/assp
+ fperms 770 /var/lib/assp
+
+ # PID directory
+ dodir /var/run/assp
+ keepdir /var/run/assp
+ fowners assp:assp -R /var/run/assp
+ fperms 770 /var/run/assp
+
+ # Install the init.d script to listen
+ newinitd "${FILESDIR}/asspd.init" asspd
+
+ dohtml docs/*.htm || die "Failed to install html docs"
+}
+
+pkg_postinst() {
+ elog
+ elog "To configure ASSP, start /etc/init.d/asspd then point"
+ elog "your browser to http://localhost:55555"
+ elog "Username: admin Password: nospam4me (CHANGE ASAP!)"
+ elog
+ elog "File permissions have been set to use assp:assp"
+ elog "with mode 770 on directories. When you configure"
+ elog "ASSP, make sure and use the user assp."
+ elog
+ elog "Don't change any path related options."
+ elog
+ elog "See the on-line docs for a complete tutorial."
+ elog "http://assp.sourceforge.net/docs.html"
+ elog
+ elog "If upgrading, please update your old config to set both"
+ elog "redre.txt and nodelay.txt path of /etc/assp. There are"
+ elog "also many new options that you should review."
+ elog
+}
diff --git a/mail-filter/assp/assp-1.9.4.9.ebuild b/mail-filter/assp/assp-1.9.4.9.ebuild
new file mode 100644
index 00000000000..dd35a454c32
--- /dev/null
+++ b/mail-filter/assp/assp-1.9.4.9.ebuild
@@ -0,0 +1,178 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils user
+
+DESCRIPTION="Anti-Spam SMTP Proxy written in Perl"
+HOMEPAGE="http://assp.sourceforge.net/"
+MY_PN=ASSP_${PV}-Install
+SRC_URI="mirror://sourceforge/${PN}/${MY_PN}.zip"
+LICENSE="GPL-2"
+SLOT="0"
+
+# this is a pre-release, so no keywords for now
+KEYWORDS="~amd64 ~x86"
+
+IUSE="ipv6 ldap sasl spf srs ssl syslog"
+
+DEPEND="app-arch/unzip"
+
+RDEPEND="dev-lang/perl
+ dev-perl/Net-DNS
+ dev-perl/File-ReadBackwards
+ virtual/perl-IO-Compress
+ dev-perl/Email-MIME
+ dev-perl/Email-Send
+ dev-perl/Email-Valid
+ dev-perl/libwww-perl
+ dev-perl/mime-construct
+ dev-perl/Net-CIDR-Lite
+ virtual/perl-Digest-MD5
+ virtual/perl-Time-HiRes
+ ipv6? ( dev-perl/IO-Socket-INET6 )
+ sasl? ( dev-perl/Authen-SASL )
+ spf? ( dev-perl/Mail-SPF )
+ srs? ( dev-perl/Mail-SRS )
+ ssl? ( dev-perl/IO-Socket-SSL )
+ syslog? ( virtual/perl-Sys-Syslog )
+ ldap? ( dev-perl/perl-ldap )"
+
+S=${WORKDIR}/${MY_PN}/ASSP
+
+pkg_setup() {
+ enewgroup assp
+ enewuser assp -1 -1 /dev/null assp
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ local FILES="
+ assp.pl
+ rebuildspamdb.pl
+ stat.pl
+ "
+ # just being safe
+ for file in ${FILES}; do
+ edos2unix ${file}
+ done
+
+ # portable changes via sed vs patch
+ sed -i -e 's|file:files/|file:/etc/assp/|' \
+ -e 's|$base/images|/usr/share/assp/images|' \
+ -e 's|logs/maillog.txt|/var/log/assp/maillog.txt|' \
+ -e 's|PID File'\'',40,textinput,'\''pid'\''|PID File'\'',40,textinput,'\''asspd.pid'\''|' \
+ -e 's|Daemon\*\*'\'',0,checkbox,0|Daemon\*\*'\'',0,checkbox,1|' \
+ -e 's|UID\*\*'\'',20,textinput,'\'''\''|UID\*\*'\'',20,textinput,'\''assp'\''|' \
+ -e 's|GID\*\*'\'',20,textinput,'\'''\''|GID\*\*'\'',20,textinput,'\''assp'\''|' \
+ -e 's|popFileEditor'\('\\'\''pb/pbdb\.\([^\.]*\)\.db\\'\'',|popFileEditor(\\'\''/var/lib/assp/pb/pbdb.\1.db\\'\'',|g' \
+ -e 's|$base/assp.cfg|/etc/assp/assp.cfg|g' \
+ -e 's|$base/$pidfile|/var/run/assp/asspd.pid|' \
+ -e 's|mkdir "$base/$logdir",0700 if $logdir;||' \
+ -e 's|mkdir "$base/$logdir",0700;||' \
+ -e 's|$base/$logfile|$logfile|' \
+ -e 's|$base/$logdir|$logdir|' \
+ -e 's|"maillog.log"|"/var/log/assp/maillog.log"|' \
+ -e 's|-d "$base/logs" or mkdir "$base/logs",0700;||' \
+ -e 's|-d "$base/notes" or mkdir "$base/notes",0700;||' \
+ -e 's|-d "$base/docs" or mkdir "$base/docs",0777;||' \
+ -e 's|$base/$archivelogfile|$archivelogfile|' \
+ -e 's|"$base/$file",$sub,"$this|"/etc/assp/$file",$sub,"$this|' \
+ -e 's|"$base/$file",'\'''\'',"$this|"/etc/assp/$file",'\'''\'',"$this|' \
+ -e 's|my $fil=$1; $fil="$base/$fil" if $fil!~/^\\Q$base\\E/i;|my $fil=$1;|' \
+ -e 's|$fil="$base/$fil" if $fil!~/^\\Q$base\\E/i;|$fil="/etc/assp/$fil" if $fil!~/^\\/etc\\/assp\\/\|\\/var\\/lib\\/assp\\/\/i;|' \
+ -e 's|$fil="$base/$fil" if $fil!~/^((\[a-z\]:)?\[\\/\\\\\]\|\\Q$base\\E)/;||' \
+ -e 's|if ($fil !~ /^\\Q$base\\E/i) {|if ($fil !~ /^\\/usr\\/share\\/assp\\//i) {|' \
+ -e 's|$fil = "$base/$fil";|$fil = "/usr/share/assp/$fil";|' \
+ -e 's|Q$base\\E|Q\\/etc\\/assp\\/\\E|' \
+ -e 's|$fil="$base/$fil"|$fil="/etc/assp/$fil"|' \
+ -e 's|$base/$bf|/etc/assp/$bf|g' \
+ -e 's|rebuildrun.txt|/var/lib/assp/rebuildrun.txt|' \
+ assp.pl || die
+
+ # sed rebuildspamdb.pl
+ sed -i -e 's|assp.cfg|/etc/assp/assp.cfg|' \
+ -e 's|} && "$Config{base}/$Config{logfile}" \|\| '\''maillog.txt'\'';|};|' \
+ -e 's|tmaxtick('\''rebuild'\'');|tmaxtick('\''/var/lib/assp/rebuild'\'');|' \
+ -e 's|goodhosts|/var/lib/assp/goodhosts|g' \
+ -e 's|rebuildrun.txt|/var/lib/assp/rebuildrun.txt|' \
+ -e 's|$base/$DropList|$DropList|' \
+ -e 's|&fixPath($base) . "/|"|' \
+ -e 's|= "/var/lib/assp/rebuildrun.txt";|= "/var/lib/assp/rebuildrun.txt";\n $RebuildLog = "/var/lib/assp/rebuild.log";|' \
+ -e 's|"$base//|"/|g' \
+ rebuildspamdb.pl || die
+
+ # remove windows stuff
+ rm "${S}/addservice.pl" || die "Could not remove ${S}/addservice.pl"
+ rm -f "${S}/Win32-quickstart-guide.txt" || die "Could not remove ${S}/Win32-quickstart-guide.txt"
+}
+
+src_install() {
+ # Configuration directory
+ dodir /etc/assp/notes
+
+ insinto /etc/assp
+ # Installs files that are used by assp for black/gray lists,
+ # and domain country lookup. To be changed by admin as needed.
+ doins files/*.txt || die
+
+ fowners assp:assp /etc/assp -R
+ fperms 770 /etc/assp /etc/assp/notes
+
+ # Setup directories for mail to be stored for filter
+ keepdir /var/lib/assp/spam /var/lib/assp/notspam
+ keepdir /var/lib/assp/errors/spam /var/lib/assp/errors/notspam
+
+ # Logs directory
+ keepdir /var/log/assp
+ fowners assp:assp -R /var/log/assp
+ fperms 770 /var/log/assp
+
+ # Install the app
+ exeinto /usr/share/assp
+ doexe *.pl *.sh || die
+ insinto /usr/share/assp
+ doins -r images/ || die
+
+ # Lock down the files/data
+ fowners assp:assp -R /usr/share/assp
+ fperms 770 /usr/share/assp
+
+ # Data storage
+ fowners assp:assp -R /var/lib/assp
+ fperms 770 /var/lib/assp
+
+ # PID directory
+ dodir /var/run/assp
+ keepdir /var/run/assp
+ fowners assp:assp -R /var/run/assp
+ fperms 770 /var/run/assp
+
+ # Install the init.d script to listen
+ newinitd "${FILESDIR}/asspd.init" asspd
+
+ dohtml docs/*.htm || die "Failed to install html docs"
+}
+
+pkg_postinst() {
+ elog
+ elog "To configure ASSP, start /etc/init.d/asspd then point"
+ elog "your browser to http://localhost:55555"
+ elog "Username: admin Password: nospam4me (CHANGE ASAP!)"
+ elog
+ elog "File permissions have been set to use assp:assp"
+ elog "with mode 770 on directories. When you configure"
+ elog "ASSP, make sure and use the user assp."
+ elog
+ elog "Don't change any path related options."
+ elog
+ elog "See the on-line docs for a complete tutorial."
+ elog "http://assp.sourceforge.net/docs.html"
+ elog
+ elog "If upgrading, please update your old config to set both"
+ elog "redre.txt and nodelay.txt path of /etc/assp. There are"
+ elog "also many new options that you should review."
+ elog
+}
diff --git a/mail-filter/assp/assp-1.9.8.13030.ebuild b/mail-filter/assp/assp-1.9.8.13030.ebuild
new file mode 100644
index 00000000000..2e52d11194a
--- /dev/null
+++ b/mail-filter/assp/assp-1.9.8.13030.ebuild
@@ -0,0 +1,178 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils user
+
+DESCRIPTION="Anti-Spam SMTP Proxy written in Perl"
+HOMEPAGE="http://assp.sourceforge.net/"
+MY_PN=ASSP_${PV/9.8.1/98_1}_install
+SRC_URI="mirror://sourceforge/${PN}/${MY_PN}.zip"
+LICENSE="GPL-2"
+SLOT="0"
+
+# this is a pre-release, so no keywords for now
+KEYWORDS="~amd64 ~x86"
+
+IUSE="ipv6 ldap sasl spf srs ssl syslog"
+
+DEPEND="app-arch/unzip"
+
+RDEPEND="dev-lang/perl
+ dev-perl/Net-DNS
+ dev-perl/File-ReadBackwards
+ virtual/perl-IO-Compress
+ dev-perl/Email-MIME
+ dev-perl/Email-Send
+ dev-perl/Email-Valid
+ dev-perl/libwww-perl
+ dev-perl/mime-construct
+ dev-perl/Net-CIDR-Lite
+ virtual/perl-Digest-MD5
+ virtual/perl-Time-HiRes
+ ipv6? ( dev-perl/IO-Socket-INET6 )
+ sasl? ( dev-perl/Authen-SASL )
+ spf? ( dev-perl/Mail-SPF )
+ srs? ( dev-perl/Mail-SRS )
+ ssl? ( dev-perl/IO-Socket-SSL )
+ syslog? ( virtual/perl-Sys-Syslog )
+ ldap? ( dev-perl/perl-ldap )"
+
+S=${WORKDIR}/${MY_PN}/ASSP
+
+pkg_setup() {
+ enewgroup assp
+ enewuser assp -1 -1 /dev/null assp
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ local FILES="
+ assp.pl
+ rebuildspamdb.pl
+ stat.pl
+ "
+ # just being safe
+ for file in ${FILES}; do
+ edos2unix ${file}
+ done
+
+ # portable changes via sed vs patch
+ sed -i -e 's|file:files/|file:/etc/assp/|' \
+ -e 's|$base/images|/usr/share/assp/images|' \
+ -e 's|logs/maillog.txt|/var/log/assp/maillog.txt|' \
+ -e 's|PID File'\'',40,textinput,'\''pid'\''|PID File'\'',40,textinput,'\''asspd.pid'\''|' \
+ -e 's|Daemon\*\*'\'',0,checkbox,0|Daemon\*\*'\'',0,checkbox,1|' \
+ -e 's|UID\*\*'\'',20,textinput,'\'''\''|UID\*\*'\'',20,textinput,'\''assp'\''|' \
+ -e 's|GID\*\*'\'',20,textinput,'\'''\''|GID\*\*'\'',20,textinput,'\''assp'\''|' \
+ -e 's|popFileEditor'\('\\'\''pb/pbdb\.\([^\.]*\)\.db\\'\'',|popFileEditor(\\'\''/var/lib/assp/pb/pbdb.\1.db\\'\'',|g' \
+ -e 's|$base/assp.cfg|/etc/assp/assp.cfg|g' \
+ -e 's|$base/$pidfile|/var/run/assp/asspd.pid|' \
+ -e 's|mkdir "$base/$logdir",0700 if $logdir;||' \
+ -e 's|mkdir "$base/$logdir",0700;||' \
+ -e 's|$base/$logfile|$logfile|' \
+ -e 's|$base/$logdir|$logdir|' \
+ -e 's|"maillog.log"|"/var/log/assp/maillog.log"|' \
+ -e 's|-d "$base/logs" or mkdir "$base/logs",0700;||' \
+ -e 's|-d "$base/notes" or mkdir "$base/notes",0700;||' \
+ -e 's|-d "$base/docs" or mkdir "$base/docs",0777;||' \
+ -e 's|$base/$archivelogfile|$archivelogfile|' \
+ -e 's|"$base/$file",$sub,"$this|"/etc/assp/$file",$sub,"$this|' \
+ -e 's|"$base/$file",'\'''\'',"$this|"/etc/assp/$file",'\'''\'',"$this|' \
+ -e 's|my $fil=$1; $fil="$base/$fil" if $fil!~/^\\Q$base\\E/i;|my $fil=$1;|' \
+ -e 's|$fil="$base/$fil" if $fil!~/^\\Q$base\\E/i;|$fil="/etc/assp/$fil" if $fil!~/^\\/etc\\/assp\\/\|\\/var\\/lib\\/assp\\/\/i;|' \
+ -e 's|$fil="$base/$fil" if $fil!~/^((\[a-z\]:)?\[\\/\\\\\]\|\\Q$base\\E)/;||' \
+ -e 's|if ($fil !~ /^\\Q$base\\E/i) {|if ($fil !~ /^\\/usr\\/share\\/assp\\//i) {|' \
+ -e 's|$fil = "$base/$fil";|$fil = "/usr/share/assp/$fil";|' \
+ -e 's|Q$base\\E|Q\\/etc\\/assp\\/\\E|' \
+ -e 's|$fil="$base/$fil"|$fil="/etc/assp/$fil"|' \
+ -e 's|$base/$bf|/etc/assp/$bf|g' \
+ -e 's|rebuildrun.txt|/var/lib/assp/rebuildrun.txt|' \
+ assp.pl || die
+
+ # sed rebuildspamdb.pl
+ sed -i -e 's|assp.cfg|/etc/assp/assp.cfg|' \
+ -e 's|} && "$Config{base}/$Config{logfile}" \|\| '\''maillog.txt'\'';|};|' \
+ -e 's|tmaxtick('\''rebuild'\'');|tmaxtick('\''/var/lib/assp/rebuild'\'');|' \
+ -e 's|goodhosts|/var/lib/assp/goodhosts|g' \
+ -e 's|rebuildrun.txt|/var/lib/assp/rebuildrun.txt|' \
+ -e 's|$base/$DropList|$DropList|' \
+ -e 's|&fixPath($base) . "/|"|' \
+ -e 's|= "/var/lib/assp/rebuildrun.txt";|= "/var/lib/assp/rebuildrun.txt";\n $RebuildLog = "/var/lib/assp/rebuild.log";|' \
+ -e 's|"$base//|"/|g' \
+ rebuildspamdb.pl || die
+
+ # remove windows stuff
+ rm "${S}/addservice.pl" || die "Could not remove ${S}/addservice.pl"
+ rm -f "${S}/Win32-quickstart-guide.txt" || die "Could not remove ${S}/Win32-quickstart-guide.txt"
+}
+
+src_install() {
+ # Configuration directory
+ dodir /etc/assp/notes
+
+ insinto /etc/assp
+ # Installs files that are used by assp for black/gray lists,
+ # and domain country lookup. To be changed by admin as needed.
+ doins files/*.txt || die
+
+ fowners assp:assp /etc/assp -R
+ fperms 770 /etc/assp /etc/assp/notes
+
+ # Setup directories for mail to be stored for filter
+ keepdir /var/lib/assp/spam /var/lib/assp/notspam
+ keepdir /var/lib/assp/errors/spam /var/lib/assp/errors/notspam
+
+ # Logs directory
+ keepdir /var/log/assp
+ fowners assp:assp -R /var/log/assp
+ fperms 770 /var/log/assp
+
+ # Install the app
+ exeinto /usr/share/assp
+ doexe *.pl *.sh || die
+ insinto /usr/share/assp
+ doins -r images/ || die
+
+ # Lock down the files/data
+ fowners assp:assp -R /usr/share/assp
+ fperms 770 /usr/share/assp
+
+ # Data storage
+ fowners assp:assp -R /var/lib/assp
+ fperms 770 /var/lib/assp
+
+ # PID directory
+ dodir /var/run/assp
+ keepdir /var/run/assp
+ fowners assp:assp -R /var/run/assp
+ fperms 770 /var/run/assp
+
+ # Install the init.d script to listen
+ newinitd "${FILESDIR}/asspd.init" asspd
+
+ dohtml docs/*.htm || die "Failed to install html docs"
+}
+
+pkg_postinst() {
+ elog
+ elog "To configure ASSP, start /etc/init.d/asspd then point"
+ elog "your browser to http://localhost:55555"
+ elog "Username: admin Password: nospam4me (CHANGE ASAP!)"
+ elog
+ elog "File permissions have been set to use assp:assp"
+ elog "with mode 770 on directories. When you configure"
+ elog "ASSP, make sure and use the user assp."
+ elog
+ elog "Don't change any path related options."
+ elog
+ elog "See the on-line docs for a complete tutorial."
+ elog "http://assp.sourceforge.net/docs.html"
+ elog
+ elog "If upgrading, please update your old config to set both"
+ elog "redre.txt and nodelay.txt path of /etc/assp. There are"
+ elog "also many new options that you should review."
+ elog
+}
diff --git a/mail-filter/assp/files/assp-1.2.6.patch b/mail-filter/assp/files/assp-1.2.6.patch
new file mode 100644
index 00000000000..d89ca181c23
--- /dev/null
+++ b/mail-filter/assp/files/assp-1.2.6.patch
@@ -0,0 +1,364 @@
+diff -Naur assporg/ASSP/assp.pl asspmod/ASSP/assp.pl
+--- assporg/ASSP/assp.pl 2007-01-18 23:12:20.000000000 +0100
++++ asspmod/ASSP/assp.pl 2007-01-20 21:17:07.000000000 +0100
+@@ -52,13 +52,10 @@
+ if($ARGV[0]) {
+ $base=$ARGV[0];
+ } else {
+- # the last one is the one used if all else fails
+- foreach ('.','assp','/usr/local/assp','/home/assp','/usr/assp','/applications/assp','/assp','.') {
+- $base=$_;
+- last if -e "$base/assp.cfg";
++ $base='/etc/assp/';
+ }
+-}
+-if ( !-e "$base/images/noIcon.png")
++
++if ( !-e "/usr/share/assp/images/noIcon.png")
+ { die "Abort: folder 'images' not correctly installed";}
+
+ loadConfig();
+@@ -86,7 +83,7 @@
+ 'The address:port of your message handling system\'s smtp server. If only the port is entered, or the keyword <b>__INBOUND__</b>:<i>port</i> is used, then the connection will be established to the same IP where the connection was received. This is usefull when you have several IPs with different domains/profiles in your MTA.<br /> Examples: "127.0.0.1:125","127.0.0.1:125|127.0.0.5:125", "10.0.1.3", "10.0.1.3:1025", "__INBOUND__:125", "125", etc.'],
+ [AsAService,'As a Service',0,checkbox,0,'(.*)',undef,
+ 'In Windows 2000 / NT you can run it as a service; requires <a href="http://www.roth.net/perl/Daemon/" rel="external">win32::daemon</a>. Requires start from the service control panel.'],
+-[AsADaemon,'As a Daemon',0,checkbox,0,'(.*)',undef,
++[AsADaemon,'As a Daemon',0,checkbox,1,'(.*)',undef,
+ 'In Linux/BSD/Unix/OSX fork and close file handles, kinda like "perl assp.pl &amp;" but better. Requires restart.'],
+ [myName,'My Name',40,textinput,'ASSP.nospam','(\S+)',undef,
+ 'What the program calls itself in the email "received by" header. Usually ASSP.nospam.'],
+@@ -912,10 +909,10 @@
+ 'This user must have CREATE privilege on database to create tables
+ automatically'],
+ [mypassword,'MySQL password',40,textinput,'','(\S*)',undef,''],
+-[logfile,'ASSP Logfile',40,textinput,'maillog.txt','(\S*)',ConfigChangeLogfile,
++[logfile,'ASSP Logfile',40,textinput,'/var/log/assp/maillog.txt','(\S*)',ConfigChangeLogfile,
+ 'Blank if you don\'t want a log file. Change it to maillog.log if you don\'t want auto rollover.
+ NOTE: Changing this field requires restarting ASSP before changes take effect.'],
+-[pidfile,'PID File',40,textinput,'pid','(\S*)',undef,'Blank to skip writing a pid file. *nix users need pid files.
++[pidfile,'PID File',40,textinput,'asspd.pid','(\S*)',undef,'Blank to skip writing a pid file. *nix users need pid files.
+ Leave it blank in Windows.<br /> You have to restart the service before you get a pid file in the new location.<br /><hr />
+ <div class=\"menuLevel1\">Notes On File Path</div>
+ <input type="button" value="Notes" onClick="javascript:popFileEditor(\'notes/filepath.txt\',3);">
+@@ -979,9 +976,9 @@
+ '],
+
+ [0,0,0,'heading','Security'],
+-[runAsUser,'Run as UID',20,textinput,'nobody','(\S*)',undef,
++[runAsUser,'Run as UID',20,textinput,'assp','(\S*)',undef,
+ 'The *nix user name to assume after startup: assp or nobody -- requires ASSP restart.'],
+-[runAsGroup,'Run as GID',20,textinput,'nobody','(\S*)',undef,
++[runAsGroup,'Run as GID',20,textinput,'assp','(\S*)',undef,
+ 'The *nix group to assume after startup: assp or nogroup -- requires ASSP restart.'],
+ [ChangeRoot,'Change Root',40,textinput,'','(.*)',undef,
+ 'Non-blank means to run in chroot jail in *nix. You need an etc/protocols file to make this work<br />
+@@ -1106,7 +1103,7 @@
+ }
+ }
+ # load configuration file
+- open(F,"<$base/assp.cfg"); local $/; (%Config)=split(/:=|\n/,<F>); close F;
++ open(F,"</etc/assp/assp.cfg"); local $/; (%Config)=split(/:=|\n/,<F>); close F;
+ # set nonexistent settings to default values
+ foreach $c (@Config) {
+ if ($c->[0] && !(exists $Config{$c->[0]})) {
+@@ -1446,19 +1443,19 @@
+ $silent=1;
+ }
+
+-if($pidfile) {open(F,">$base/$pidfile"); print F $$; close F;}
++if($pidfile) {open(F,">/var/run/assp/$pidfile"); print F $$; close F;}
+
+ sub RemovePid {
+ if ($pidfile) {
+ d('RemovePid');
+- unlink("$base/$pidfile");
++ unlink("/var/run/assp/$pidfile");
+ }
+ }
+
+ if($DEBUG) {open(DEBUG, ">$base/".time.".dbg"); binmode(DEBUG); my $oldfh = select(DEBUG); $| = 1; select($oldfh);}
+ my $logdir = $1 if $logfile=~/(.*)\/.*/;
+- mkdir "$base/$logdir",0777 if $logdir;
+-if($logfile && open(LOG,">>$base/$logfile")) {my $oldfh = select(LOG); $| = 1; select($oldfh);}
++ mkdir "$logdir",0777 if $logdir;
++if($logfile && open(LOG,">>$logfile")) {my $oldfh = select(LOG); $| = 1; select($oldfh);}
+
+ if($AsAService) {
+ eval(<<'EOT');
+@@ -1652,16 +1649,16 @@
+ -d "$base/$correctednotspam" or mkdir "$base/$correctednotspam",0700;
+ my $pbdir = $1 if $pbdb=~/(.*)\/.*/;
+ mkdir "$base/$pbdir",0700 if $pbdir;
+- -d "$base/notes" or mkdir "$base/notes",0700;
+- if ( !-e "$base/reports/whitereport.txt") {
+- -d "$base/reports" or mkdir "$base/reports",0700;
+- copy("whitereport.txt", "reports/whitereport.txt");
+- copy("whiteremovereport.txt", "reports/whiteremovereport.txt");
+- copy("redreport.txt", "reports/redreport.txt");
+- copy("redremovereport.txt", "reports/redremovereport.txt");
+- copy("helpreport.txt", "reports/helpreport.txt");
+- copy("notspamreport.txt", "reports/notspamreport.txt");
+- copy("spamreport.txt", "reports/spamreport.txt");
++ -d "/etc/assp/notes" or mkdir "/etc/assp/notes",0700;
++ if ( !-e "/etc/assp/reports/whitereport.txt") {
++ -d "/etc/assp/reports" or mkdir "/etc/assp/reports",0700;
++ copy("/usr/share/assp/whitereport.txt", "/etc/assp/reports/whitereport.txt");
++ copy("/usr/share/assp/whiteremovereport.txt", "/etc/assp/reports/whiteremovereport.txt");
++ copy("/usr/share/assp/redreport.txt", "/etc/assp/reports/redreport.txt");
++ copy("/usr/share/assp/redremovereport.txt", "/etc/assp/reports/redremovereport.txt");
++ copy("/usr/share/assp/helpreport.txt", "/etc/assp/reports/helpreport.txt");
++ copy("/usr/share/assp/notspamreport.txt", "/etc/assp/reports/notspamreport.txt");
++ copy("/usr/share/assp/spamreport.txt", "/etc/assp/reports/spamreport.txt");
+ }
+
+
+@@ -2073,7 +2070,7 @@
+ # roll log every $LogRollDays days, at midnight
+ my $t=int((time()+Time::Local::timelocal(localtime())-Time::Local::timelocal(gmtime()))/($LogRollDays*24*3600));
+
+- if($logfile && $mlogLastT && $t != $mlogLastT && $logfile ne "maillog.log" && $asspLog) {
++ if($logfile && $mlogLastT && $t != $mlogLastT && $logfile ne "/var/log/assp/maillog.log" && $asspLog) {
+ # roll the log
+
+ my ($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
+@@ -2084,7 +2081,7 @@
+ if (!$logdir) {
+ $archivelogfile = "$mm.$logfile";
+ } else {
+- mkdir "$base/$logdir",0777;
++ mkdir "$logdir",0777;
+ $archivelogfile = "$logdir/$mm.$logdirfile";
+ }
+ my $msg="$m: Rolling log file -- archive saved as '$archivelogfile'\n";
+@@ -2092,8 +2089,8 @@
+ print $msg unless $silent;
+
+ close LOG;
+- rename("$base/$logfile", "$base/$archivelogfile");
+- if(open(LOG,">>$base/$logfile")) {my $oldfh = select(LOG); $| = 1; select($oldfh);}
++ rename("$logfile", "$archivelogfile");
++ if(open(LOG,">>$logfile")) {my $oldfh = select(LOG); $| = 1; select($oldfh);}
+ print LOG "$m new log file -- old log file renamed to '$archivelogfile'\n";
+ SaveConfig();
+ }
+@@ -3683,7 +3680,7 @@
+ return 1;
+ }
+ my ($per_result, $smtp_comment, $header_comment, $spf_fail);
+- foreach my $recip (split(' ', $this->{rcpt})) {
++ foreach my $recip (split('/var/lib/assp/', $this->{rcpt})) {
+ ($per_result, $smtp_comment, $header_comment, $spf_fail) =
+ $query->result2($recip);
+ # Keep processing SPF records until all recipients are checked
+@@ -5243,8 +5240,8 @@
+
+
+
+- ReturnMail($this->{mailfrom},"$base/$file",$sub,"$this->{rcpt}\n\n$this->{report}\n") if ($EmailErrorsReply==1 || $EmailErrorsReply==3);
+- ReturnMail($EmailErrorsTo,"$base/$file",$sub,"$this->{rcpt}\n\n$this->{report}\n",$this->{mailfrom}) if ($EmailErrorsTo && ($EmailErrorsReply==2 || $EmailErrorsReply==3));
++ ReturnMail($this->{mailfrom},"/etc/assp/$file",$sub,"$this->{rcpt}\n\n$this->{report}\n") if ($EmailErrorsReply==1 || $EmailErrorsReply==3);
++ ReturnMail($EmailErrorsTo,"/etc/assp/$file",$sub,"$this->{rcpt}\n\n$this->{report}\n",$this->{mailfrom}) if ($EmailErrorsTo && ($EmailErrorsReply==2 || $EmailErrorsReply==3));
+
+ stateReset($fh);
+ $this->{getline}=\&getline;
+@@ -5377,13 +5374,13 @@
+
+ if (($this->{reporttype}==2) || ($this->{reporttype}==3)) {
+
+-ReturnMail($this->{mailfrom},"$base/$file",'',"$this->{rcpt}\n\n$this->{report}\n") if ($EmailWhitelistReply==1 || $EmailWhitelistReply==3);
++ReturnMail($this->{mailfrom},"/etc/assp/$file",'',"$this->{rcpt}\n\n$this->{report}\n") if ($EmailWhitelistReply==1 || $EmailWhitelistReply==3);
+
+-ReturnMail($EmailWhitelistTo,"$base/$file",'',"$this->{rcpt}\n\n$this->{report}\n",$this->{mailfrom}) if ( $EmailWhitelistTo && ($EmailWhitelistReply==2 || $EmailWhitelistReply==3));
++ReturnMail($EmailWhitelistTo,"/etc/assp/$file",'',"$this->{rcpt}\n\n$this->{report}\n",$this->{mailfrom}) if ( $EmailWhitelistTo && ($EmailWhitelistReply==2 || $EmailWhitelistReply==3));
+ } else {
+- ReturnMail($this->{mailfrom},"$base/$file",'',"$this->{rcpt}\n\n$this->{report}\n") if ($EmailRedlistReply==1 || $EmailRedlistReply==3);
++ ReturnMail($this->{mailfrom},"/etc/assp/$file",'',"$this->{rcpt}\n\n$this->{report}\n") if ($EmailRedlistReply==1 || $EmailRedlistReply==3);
+
+-ReturnMail($EmailRedlistTo,"$base/$file",'',"$this->{rcpt}\n\n$this->{report}\n",$this->{mailfrom}) if ( $EmailRedlistTo && ($EmailRedlistReply==2 || $EmailRedlistReply==3));
++ReturnMail($EmailRedlistTo,"/etc/assp//$file",'',"$this->{rcpt}\n\n$this->{report}\n",$this->{mailfrom}) if ( $EmailRedlistTo && ($EmailRedlistReply==2 || $EmailRedlistReply==3));
+ }
+ delete $this->{report};
+ stateReset($fh);
+@@ -5531,8 +5528,8 @@
+ my $file=($this->{reporttype}==0) ? "reports/spamreport.txt" : "reports/notspamreport.txt";
+
+
+- ReturnMail($this->{mailfrom},"$base/$file",$sub,"$this->{rcpt}\n\n$this->{report}\n") if ($EmailErrorsReply==1 || $EmailErrorsReply==3);
+- ReturnMail($EmailErrorsTo,"$base/$file",$sub,"$this->{rcpt}\n\n$this->{report}\n",$this->{mailfrom}) if ($EmailErrorsTo && ($EmailErrorsReply==2 || $EmailErrorsReply==3));
++ ReturnMail($this->{mailfrom},"/etc/assp/$file",$sub,"$this->{rcpt}\n\n$this->{report}\n") if ($EmailErrorsReply==1 || $EmailErrorsReply==3);
++ ReturnMail($EmailErrorsTo,"/etc/assp/$file",$sub,"$this->{rcpt}\n\n$this->{report}\n",$this->{mailfrom}) if ($EmailErrorsTo && ($EmailErrorsReply==2 || $EmailErrorsReply==3));
+
+ delete $this->{report};
+ stateReset($fh);
+@@ -6010,7 +6007,7 @@
+ $a{lc $1}=1;
+ }
+ }
+- foreach $a (split(' ',lc $this->{rcpt})) {
++ foreach $a (split('/var/lib/assp/',lc $this->{rcpt})) {
+ $a{$a}=1;
+ }
+ foreach $a (keys %a) {
+@@ -6470,10 +6467,10 @@
+ if($UseSubjectsAsMaillogNames || $isspam==2 || $isspam==3) {
+
+ $sub.="--".(++$Counter);
+- return "$base/$maillog/$sub$maillogExt";
++ return "/var/lib/assp/$maillog/$sub$maillogExt";
+ } else {
+ my $fn=(time + $Counter++ ) % $MaxFiles;
+- "$base/$maillog/$fn$maillogExt";
++ "/var/lib/assp/$maillog/$fn$maillogExt";
+ }
+ }
+
+@@ -7759,7 +7756,7 @@
+ $m=~s/^... (...) +(\d+) (\S+) ..(..)/$1-$2-$4 $3 /;
+ my $indent=" " x length($m);
+ if(!$pat) {
+- open(F,"<$base/$logfile");
++ open(F,"<$logfile");
+ seek(F,-$MaillogTailBytes,2) || seek(F,0,0);
+ local $/;
+ $s=<F>;
+@@ -7779,7 +7776,7 @@
+ my $lines=0;
+ my $files=0;
+ my ($logdir, $logdirfile) = $logfile=~/^(.*[\/\\])?(.*?)$/;
+- my @logfiles=reverse sort glob("$base/$logdir*$logdirfile");
++ my @logfiles=reverse sort glob("$logdir*$logdirfile");
+ my $logf=File::ReadBackwards->new(shift(@logfiles),'(?:\r?\n|\r)',1); # line terminator regex
+ if ($logf) {
+ $files++;
+@@ -7821,7 +7818,7 @@
+ my %replace;
+ my $j=0;
+ my $highlightExpr='=~s/(';
+- foreach (map/^([^-].*)/, split(' ',$pat)) {
++ foreach (map/^([^-].*)/, split('/var/lib/assp/',$pat)) {
+ $replace{lc $_}=$highlights[$j % @highlights]; # pick highlight style
+ $highlightExpr.=quotemeta($_).'|';
+ if ($MaillogTailWrapColumn>0) {
+@@ -7982,7 +7979,7 @@
+
+ else {
+ #$fil="$base/$fil" if $fil!~/^(([a-z]:)?[\/\\]|\Q$base\E)/;
+- $fil="$base/$fil" if $fil!~/^\Q$base\E/i;
++ $fil="/etc/assp/$fil" if $fil!~/^\Q\/etc\/assp\/\E/i;
+ if ($qs{B1}=~/delete/i) {
+ unlink($fil);
+ }
+@@ -8206,7 +8203,7 @@
+ }
+
+ if ($fil !~ /^\Q$base\E/i) {
+- $fil="$base/$fil";
++ $fil="/usr/share/assp/$fil";
+ }
+ if (-e $fil) {
+ my $mtime;
+@@ -8541,9 +8538,9 @@
+ }
+
+ sub SaveConfig {
+- rename("$base/assp.cfg.bak","$base/assp.cfg.bak.bak");
+- rename("$base/assp.cfg","$base/assp.cfg.bak");
+- open(F,">$base/assp.cfg");
++ rename("/etc/assp/assp.cfg.bak","/etc/assp/assp.cfg.bak.bak");
++ rename("/etc/assp/assp.cfg","/etc/assp/assp.cfg.bak");
++ open(F,">/etc/assp/assp.cfg");
+ foreach (sort keys %Config) {print F "$_:=$Config{$_}\n";}
+ close F;
+ }
+@@ -8724,8 +8721,8 @@
+ # the option list is actually saved in a file.
+ $fromfile = 1;
+ my $fil = $1;
+- if ($fil !~ /^(([a-z]:)?[\/\\]|\Q$base\E)/){
+- $fil = "$base/$fil";
++ if ($fil !~ /^(([a-z]:)?[\/\\]|\Q\/etc\/assp\/\E)/){
++ $fil = "/etc/assp/$fil";
+ };
+ local $/;
+ my @s = stat($fil);
+@@ -8789,7 +8786,7 @@
+ sub fileUpdated {
+ my $fil=shift;
+
+- $fil="$base/$fil" if $fil!~/^(([a-z]:)?[\/\\]|\Q$base\E)/;
++ $fil="/etc/assp/$fil" if $fil!~/^(([a-z]:)?[\/\\]|\Q\/etc\/assp\/\E)/;
+ #$fil="$base/$fil" if $fil!~/^\Q$base\E/i;
+ return 1 unless $FileUpdate{$fil};
+ my @s=stat($fil);
+@@ -8891,7 +8888,7 @@
+ sub ConfigChangeLogfile {my ($name, $old, $new)=@_;
+ close LOG if $logfile;
+ $logfile=$new;
+- if($logfile && open(LOG,">>$base/$logfile")) {my $oldfh = select(LOG); $| = 1; select($oldfh);}
++ if($logfile && open(LOG,">>$logfile")) {my $oldfh = select(LOG); $| = 1; select($oldfh);}
+ mlog(0,"log file changed to '$new' from '$old' per admin request");
+ '';
+ }
+@@ -9242,7 +9239,7 @@
+ # called on SIG HUP
+ my %newConfig;
+ mlog(0,"sig HUP -- reloading config");
+- open(F,"<$base/assp.cfg"); local $/; (%newConfig)=split(/:=|\n/,<F>); close F;
++ open(F,"</etc/assp/assp.cfg"); local $/; (%newConfig)=split(/:=|\n/,<F>); close F;
+ foreach $c (@Config) {
+ my ($name,$nicename,$size,$func,$default,$valid,$onchange,$description)=@$c;
+ if($Config{$name} ne $newConfig{$name}) {
+@@ -9270,7 +9267,7 @@
+ }
+ # reopen log file, just for fun.
+ close LOG;
+- if(open(LOG,">>$base/$logfile")) {my $oldfh = select(LOG); $| = 1; select($oldfh);}
++ if(open(LOG,">>$logfile")) {my $oldfh = select(LOG); $| = 1; select($oldfh);}
+ print LOG "Logfile reopened on HUP\n";
+ }
+
+diff -Naur assporg/ASSP/move2num.pl asspmod/ASSP/move2num.pl
+--- assporg/ASSP/move2num.pl 2007-01-18 23:12:20.000000000 +0100
++++ asspmod/ASSP/move2num.pl 2007-01-18 23:14:09.000000000 +0100
+@@ -3,7 +3,7 @@
+ # renames files to numbers
+ # (c) John Hanna, John Calvi 2003 under the terms of the GPL
+
+-open(F,"<assp.cfg"); local $/; (%Config)=split(/:=|\n/,<F>); close F;
++open(F,"</etc/assp/assp.cfg"); local $/; (%Config)=split(/:=|\n/,<F>); close F;
+ $spamlog=$Config{spamlog} && "$Config{base}/$Config{spamlog}" || 'spam';
+ $notspamlog=$Config{notspamlog} && "$Config{base}/$Config{notspamlog}" || 'notspam';
+ $MaxFiles=$Config{MaxFiles} || 14003;
+diff -Naur assporg/ASSP/rebuildspamdb.pl asspmod/ASSP/rebuildspamdb.pl
+--- assporg/ASSP/rebuildspamdb.pl 2007-01-18 23:12:20.000000000 +0100
++++ asspmod/ASSP/rebuildspamdb.pl 2007-01-18 23:14:09.000000000 +0100
+@@ -4,7 +4,7 @@
+ # (c) John Hanna 2003 under the terms of the GPL
+ # Updated July 2004 for simple proxy support.
+
+-open(F,"<assp.cfg"); local $/; (%Config)=split(/:=|\n/,<F>); close F;
++open(F,"</etc/assp/assp.cfg"); local $/; (%Config)=split(/:=|\n/,<F>); close F;
+ $spamlog=$Config{spamlog} && "$Config{base}/$Config{spamlog}" || 'spam';
+ $notspamlog=$Config{notspamlog} && "$Config{base}/$Config{notspamlog}" || 'notspam';
+ $correctedspam=$Config{correctedspam} && "$Config{base}/$Config{correctedspam}" || 'errors/spam';
+@@ -13,7 +13,7 @@
+ $whitelistdb=$Config{whitelistdb} && "$Config{base}/$Config{whitelistdb}" || 'whitelist';
+ $MaxWhitelistDays=$Config{MaxWhitelistDays} || 90;
+ $OrderedTieHashSize=$Config{OrderedTieHashSize} || 5000;
+-$Log=$Config{logfile} && "$Config{base}/$Config{logfile}" || 'maillog.txt';
++$Log=$Config{logfile};
+ $whiteRE=$Config{whiteRE};
+ $KeepWhitelistedSpam=$Config{KeepWhitelistedSpam};
+ $proxyserver=$Config{proxyserver};
+diff -Naur assporg/ASSP/stats.sh asspmod/ASSP/stats.sh
+--- assporg/ASSP/stats.sh 2007-01-18 23:12:23.000000000 +0100
++++ asspmod/ASSP/stats.sh 2007-01-18 23:14:09.000000000 +0100
+@@ -52,7 +52,7 @@
+ # your system's 'newsyslog' functionality. You can send a SIGHUP to
+ # ASSP when you roll the log so it starts afresh..KRL
+
+-tail -300 -f /usr/local/assp/maillog.log | \
++tail -n 300 -f /var/log/assp/maillog.txt | \
+ awk ' \
+ /whitelisted/ { \
+ printf("%s %s \033[1;32m%-15s L\033[0mW %s \033[1;32m->\033[0m %s\n", \
diff --git a/mail-filter/assp/files/asspd.init b/mail-filter/assp/files/asspd.init
new file mode 100644
index 00000000000..e592402f23f
--- /dev/null
+++ b/mail-filter/assp/files/asspd.init
@@ -0,0 +1,22 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting ASSP"
+ start-stop-daemon -b -m --start --quiet --startas /usr/share/assp/assp.pl \
+ --pidfile /var/run/assp/asspd.pid -- /var/lib/assp/
+ 2<&1 >> /var/log/assp/assp.log
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ASSP"
+ start-stop-daemon --stop --quiet --pidfile /var/run/assp/asspd.pid
+ eend $?
+}
diff --git a/mail-filter/assp/files/base.patch b/mail-filter/assp/files/base.patch
new file mode 100644
index 00000000000..dfcf9573e7a
--- /dev/null
+++ b/mail-filter/assp/files/base.patch
@@ -0,0 +1,15 @@
+--- ASSP_1.3.3.7-Install/ASSP/assp.pl 2007-10-20 13:10:09.000000000 -0400
++++ ASSP_1.3.3.7-Install_orig/ASSP/assp.pl 2007-10-20 13:09:47.000000000 -0400
+@@ -83,11 +83,7 @@
+ if($ARGV[0]) {
+ $base=$ARGV[0];
+ } else {
+- # the last one is the one used if all else fails
+- foreach ('.','assp','/usr/local/assp','/home/assp','/etc/assp','/usr/assp','/applications/assp','/assp','.') {
+- $base=$_;
+- last if -e "/etc/assp/assp.cfg";
+- }
++ $base='$base/';
+ }
+ if ( !-e "/usr/share/assp/images/noIcon.png")
+ { die "Abort: folder 'images' not correctly installed";}
diff --git a/mail-filter/assp/metadata.xml b/mail-filter/assp/metadata.xml
new file mode 100644
index 00000000000..7d7dfbb78f4
--- /dev/null
+++ b/mail-filter/assp/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+ <longdescription>
+ The Anti-Spam SMTP Proxy (ASSP) Server project is an open source
+ platform-independent SMTP Proxy server which implements whitelists
+ and Bayesian filtering to rid the planet of the blight of unsolicited
+ email (UCE). UCE must be stopped at the SMTP server. Anti-spam tools
+ must be adaptive to new spam and customized for each site's mail
+ patterns. This free, easy-to-use tool works with any mail transport
+ and achieves these goals requiring no operator intervention after the
+ initial setup phase.
+ </longdescription>
+ <use>
+ <flag name="spf">Adds support for Sender Policy Framework</flag>
+ <flag name="srs">Adds support for Sender Rewriting Scheme</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">assp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/bmf/Manifest b/mail-filter/bmf/Manifest
new file mode 100644
index 00000000000..65d4167ae72
--- /dev/null
+++ b/mail-filter/bmf/Manifest
@@ -0,0 +1 @@
+DIST bmf-0.9.4.tar.gz 36740 SHA256 7eed21802f95df2321ac4c958f99e14d2809852a5708700b633e1abb032c9ce1
diff --git a/mail-filter/bmf/bmf-0.9.4-r2.ebuild b/mail-filter/bmf/bmf-0.9.4-r2.ebuild
new file mode 100644
index 00000000000..a744a1115a4
--- /dev/null
+++ b/mail-filter/bmf/bmf-0.9.4-r2.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit toolchain-funcs eutils
+
+IUSE="mysql berkdb"
+
+DESCRIPTION="A fast and small Bayesian spam filter"
+HOMEPAGE="http://bmf.sourceforge.net/"
+SRC_URI="mirror://sourceforge/bmf/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+
+DEPEND="mysql? ( virtual/mysql )
+ berkdb? ( >=sys-libs/db-3.2.9 )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # respect CFLAGS
+ sed -i -e '/D_LINUX/s/CFLAGS="$CCDBG/CFLAGS+=" $CCDBG/' \
+ "${S}/configure" || die
+
+ # include mysql headers
+ sed -i -e '/HAVE_MYSQL/s/HAVE_MYSQL/HAVE_MYSQL `mysql_config --include`/' \
+ "${S}/configure" || die
+
+ epatch "${FILESDIR}/${P}_QA.patch"
+}
+
+src_configure() {
+ # this is not an autotools script
+ ./configure \
+ $(use_with mysql) \
+ $(use_with berkdb libdb) || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README AUTHORS ChangeLog
+}
+
+pkg_postinst() {
+ elog
+ elog "Important: Remember to train bmf before you start using it."
+ elog "See the README file for further instructions on training and using bmf"
+ elog "with procmail."
+ elog
+}
diff --git a/mail-filter/bmf/files/bmf-0.9.4_QA.patch b/mail-filter/bmf/files/bmf-0.9.4_QA.patch
new file mode 100644
index 00000000000..f911e05d58f
--- /dev/null
+++ b/mail-filter/bmf/files/bmf-0.9.4_QA.patch
@@ -0,0 +1,19 @@
+--- dbh.c 2002-10-14 07:09:51.000000000 +0000
++++ dbh.c 2012-02-24 10:52:07.000000000 +0000
+@@ -60,12 +60,16 @@
+ case db_text:
+ pdb = (dbh_t*)dbtext_db_open( dbhost, dbname, dbuser, dbpass );
+ break;
++#ifdef HAVE_LIBDB
+ case db_db:
+ pdb = (dbh_t*)dbdb_db_open( dbhost, dbname, dbuser, dbpass );
+ break;
++#endif
++#ifdef HAVE_MYSQL
+ case db_mysql:
+ pdb = (dbh_t*) dbmysql_db_open( dbhost, dbname, dbuser, dbpass );
+ break;
++#endif
+ default:
+ assert(false);
+ }
diff --git a/mail-filter/bmf/metadata.xml b/mail-filter/bmf/metadata.xml
new file mode 100644
index 00000000000..85b79b68dd9
--- /dev/null
+++ b/mail-filter/bmf/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <upstream>
+ <remote-id type="sourceforge">bmf</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/bogofilter/Manifest b/mail-filter/bogofilter/Manifest
new file mode 100644
index 00000000000..8cc0b8978ea
--- /dev/null
+++ b/mail-filter/bogofilter/Manifest
@@ -0,0 +1 @@
+DIST bogofilter-1.2.4.tar.bz2 887848 SHA256 e10287a58d135feaea26880ce7d4b9fa2841fb114a2154bf7da8da98aab0a6b4 SHA512 e8c0b6bcc14f12fbbb2752e697a6d9065e17abfca3f70045ce9fe668d01c1cfad4adaa35c81546ecdd3639b0c28f3f4776bb5ed4699f21e9e2a5b19ca33479db WHIRLPOOL a35a2ce87333d07fe64972d173a4ae6a3105e31577b5915fdd376f41a14fb226e94a173d393c14aac7ca147726aa4267b1c6060ce7df5deea11ca82c3d350a13
diff --git a/mail-filter/bogofilter/bogofilter-1.2.4-r1.ebuild b/mail-filter/bogofilter/bogofilter-1.2.4-r1.ebuild
new file mode 100644
index 00000000000..348722a6276
--- /dev/null
+++ b/mail-filter/bogofilter/bogofilter-1.2.4-r1.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools db-use eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Bayesian spam filter designed with fast algorithms, and tuned for speed"
+HOMEPAGE="http://bogofilter.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~sh sparc x86 ~x86-fbsd"
+IUSE="berkdb sqlite tokyocabinet"
+
+DEPEND="virtual/libiconv
+ berkdb? ( >=sys-libs/db-3.2 )
+ !berkdb? (
+ sqlite? ( >=dev-db/sqlite-3.6.22 )
+ !sqlite? (
+ tokyocabinet? ( dev-db/tokyocabinet )
+ !tokyocabinet? ( >=sys-libs/db-3.2 )
+ )
+ )
+ sci-libs/gsl
+ app-arch/pax"
+# pax needed for bf_tar
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ has_version mail-filter/bogofilter || return 0
+ if ( use berkdb && ! has_version 'mail-filter/bogofilter[berkdb]' ) || \
+ ( ! use berkdb && has_version 'mail-filter/bogofilter[berkdb]' ) || \
+ ( use sqlite && ! has_version 'mail-filter/bogofilter[sqlite]' ) || \
+ ( ! use sqlite && has_version 'mail-filter/bogofilter[sqlite]' ) || \
+ ( has_version '>=mail-filter/bogofilter-1.2.1-r1' && \
+ ( use tokyocabinet && ! has_version 'mail-filter/bogofilter[tokyocabinet]' ) || \
+ ( ! use tokyocabinet && has_version 'mail-filter/bogofilter[tokyocabinet]' )
+ ) ; then
+ ewarn
+ ewarn "If you want to switch the database backend, you must dump the wordlist"
+ ewarn "with the current version (old use flags) and load it with the new version!"
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # bug 445918
+ sed -i -e 's/ -ggdb//' configure.ac || die
+
+ # bug 421747
+ epatch "${FILESDIR}"/${P}-test-env.patch
+ chmod +x src/tests/t.{ctype,leakfind,lexer.qpcr,lexer.eoh,message_id,queue_id}
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf="" berkdb=true
+ myconf="--without-included-gsl"
+
+ # determine backend: berkdb *is* default
+ if use berkdb && use sqlite ; then
+ elog "Both useflags berkdb and sqlite are in USE:"
+ elog "Using berkdb as database backend."
+ elif use berkdb && use tokyocabinet ; then
+ elog "Both useflags berkdb and tokyocabinet are in USE:"
+ elog "Using berkdb as database backend."
+ elif use sqlite && use tokyocabinet ; then
+ elog "Both useflags sqlite and tokyocabinet are in USE:"
+ elog "Using sqlite as database backend."
+ myconf="${myconf} --with-database=sqlite"
+ berkdb=false
+ elif use sqlite ; then
+ myconf="${myconf} --with-database=sqlite"
+ berkdb=false
+ elif use tokyocabinet ; then
+ myconf="${myconf} --with-database=tokyocabinet"
+ berkdb=false
+ elif ! use berkdb ; then
+ elog "Neither berkdb nor sqlite nor tokyocabinet are in USE:"
+ elog "Using berkdb as database backend."
+ fi
+
+ # Include the right berkdb headers for FreeBSD
+ if ${berkdb} ; then
+ append-cppflags "-I$(db_includedir)"
+ fi
+
+ # bug #324405
+ if [[ $(gcc-version) == "3.4" ]] ; then
+ epatch "${FILESDIR}"/${PN}-1.2.2-gcc34.patch
+ fi
+
+ econf ${myconf}
+}
+
+src_test() {
+ emake -C src/ check
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ exeinto /usr/share/${PN}/contrib
+ doexe contrib/{bogofilter-qfe,parmtest,randomtrain}.sh \
+ contrib/{bfproxy,bogominitrain,mime.get.rfc822,printmaildir}.pl \
+ contrib/{spamitarium,stripsearch}.pl
+
+ insinto /usr/share/${PN}/contrib
+ doins contrib/{README.*,dot-qmail-bogofilter-default} \
+ contrib/{bogogrep.c,bogo.R,bogofilter-milter.pl,*.example} \
+ contrib/vm-bogofilter.el \
+ contrib/{trainbogo,scramble}.sh
+
+ dodoc AUTHORS NEWS README RELEASE.NOTES* TODO GETTING.STARTED \
+ doc/integrating-with-* doc/README.{db,sqlite}
+
+ dohtml doc/*.html
+
+ dodir /usr/share/doc/${PF}/samples
+ mv "${D}"/etc/bogofilter.cf.example "${D}"/usr/share/doc/${PF}/samples/ || die
+ rmdir "${D}"/etc || die
+}
diff --git a/mail-filter/bogofilter/files/bogofilter-1.2.2-gcc34.patch b/mail-filter/bogofilter/files/bogofilter-1.2.2-gcc34.patch
new file mode 100644
index 00000000000..80e4d787cf8
--- /dev/null
+++ b/mail-filter/bogofilter/files/bogofilter-1.2.2-gcc34.patch
@@ -0,0 +1,24 @@
+diff -ruN bogofilter-1.2.1-orig/src/Makefile.am bogofilter-1.2.1/src/Makefile.am
+--- bogofilter-1.2.1-orig/src/Makefile.am 2009-05-28 22:59:05.000000000 +0200
++++ bogofilter-1.2.1/src/Makefile.am 2010-06-16 22:52:36.000000000 +0200
+@@ -16,7 +16,7 @@
+ AM_CPPFLAGS = -iquote$(top_srcdir)/gnugetopt -iquote$(top_srcdir)/trio \
+ -I$(srcdir) @GSL_CFLAGS@ -I$(top_srcdir)/gsl/specfunc -I$(top_srcdir)
+ else
+-AM_CPPFLAGS = -I$(top_srcdir)/gnugetopt -I$(top_srcdir)/trio -I- -I. \
++AM_CPPFLAGS = -I$(top_srcdir)/gnugetopt -I$(top_srcdir)/trio -I. \
+ -I$(srcdir) @GSL_CFLAGS@ -I$(top_srcdir)/gsl/specfunc -I$(top_srcdir)
+ endif
+
+diff -ruN bogofilter-1.2.1-orig/src/Makefile.in bogofilter-1.2.1/src/Makefile.in
+--- bogofilter-1.2.1-orig/src/Makefile.in 2009-08-01 21:00:51.000000000 +0200
++++ bogofilter-1.2.1/src/Makefile.in 2010-06-16 22:52:23.000000000 +0200
+@@ -483,7 +483,7 @@
+ @ENABLE_MEMDEBUG_TRUE@MEMDEBUG_SRC = memdebug.c memdebug.h
+ noinst_LIBRARIES = libbogofilter.a $(am__append_3) $(am__append_5) \
+ $(am__append_10)
+-@USE_GCC4_FALSE@AM_CPPFLAGS = -I$(top_srcdir)/gnugetopt -I$(top_srcdir)/trio -I- -I. \
++@USE_GCC4_FALSE@AM_CPPFLAGS = -I$(top_srcdir)/gnugetopt -I$(top_srcdir)/trio -I. \
+ @USE_GCC4_FALSE@ -I$(srcdir) @GSL_CFLAGS@ -I$(top_srcdir)/gsl/specfunc -I$(top_srcdir)
+
+ @USE_GCC4_TRUE@AM_CPPFLAGS = -iquote$(top_srcdir)/gnugetopt -iquote$(top_srcdir)/trio \
diff --git a/mail-filter/bogofilter/files/bogofilter-1.2.4-test-env.patch b/mail-filter/bogofilter/files/bogofilter-1.2.4-test-env.patch
new file mode 100644
index 00000000000..8cf109c4551
--- /dev/null
+++ b/mail-filter/bogofilter/files/bogofilter-1.2.4-test-env.patch
@@ -0,0 +1,11 @@
+--- a/src/tests/Makefile.am
++++ b/src/tests/Makefile.am
+@@ -67,7 +67,7 @@
+
+ TESTS=$(BUILT_TESTS) $(TESTSCRIPTS)
+
+-TESTS_ENVIRONMENT=RUN_FROM_MAKE=1 AWK=$(AWK) srcdir=$(srcdir) SHELL="$(SHELL)" $(SHELL) $(VERBOSE)
++TESTS_ENVIRONMENT=RUN_FROM_MAKE=1 AWK=$(AWK) srcdir=$(srcdir) SHELL="$(SHELL)" $(VERBOSE)
+
+ EXTRA_DIST=$(TESTSCRIPTS) t.frame t.save t.skel \
+ printcore t._abort unsort.pl \
diff --git a/mail-filter/bogofilter/metadata.xml b/mail-filter/bogofilter/metadata.xml
new file mode 100644
index 00000000000..5204b3d1809
--- /dev/null
+++ b/mail-filter/bogofilter/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>johu@gentoo.org</email>
+ <name>Johannes Huber</name>
+ </maintainer>
+ <longdescription>
+ Bogofilter is a mail filter that classifies mail as spam or ham (non-spam)
+ by a statistical analysis of the message's header and content (body). The
+ program is able to learn from the user's classifications and corrections.
+ </longdescription>
+ <use>
+ <flag name="tokyocabinet">Enable Tokyo Cabinet database support</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">bogofilter</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/clamassassin/Manifest b/mail-filter/clamassassin/Manifest
new file mode 100644
index 00000000000..58e71b5e15d
--- /dev/null
+++ b/mail-filter/clamassassin/Manifest
@@ -0,0 +1 @@
+DIST clamassassin-1.2.4.tar.gz 35350 SHA256 63bae3963d27548d0fc7bbf76eb6bc5506291e9e1cb95aa13390497c4c17a100
diff --git a/mail-filter/clamassassin/clamassassin-1.2.4.ebuild b/mail-filter/clamassassin/clamassassin-1.2.4.ebuild
new file mode 100644
index 00000000000..f9968aef65c
--- /dev/null
+++ b/mail-filter/clamassassin/clamassassin-1.2.4.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="A simple spamassassin-like script for virus scanning (through clamav) and filtering e-mail messages"
+HOMEPAGE="http://jameslick.com/clamassassin/"
+SRC_URI="http://jameslick.com/clamassassin/${P}.tar.gz"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 ~ppc ~sparc x86"
+IUSE="subject-rewrite clamd"
+DEPEND=">=app-antivirus/clamav-0.90
+ sys-apps/debianutils
+ sys-apps/which
+ mail-filter/procmail"
+
+src_compile() {
+ # Try to get location of clamd's DatabaseDirectory
+ local clamav_dbdir=`awk '$1 == "DatabaseDirectory" { print $2 }' \
+ /etc/clamd.conf`
+ # If not defined in clamd.conf, go with default
+ if [ -z "$clamav_dbdir" ] ; then
+ clamav_dbdir="/var/lib/clamav"
+ fi
+ # Add an entry to sandbox write prediction list, so sandbox doesn't complain
+ addpredict ${clamav_dbdir}/
+
+ econf \
+ $(use_enable subject-rewrite) \
+ $(use_enable clamd clamdscan) \
+ || die
+ # Fix problems with Portage exporting TMP and breaking clamassassin. #61806
+ sed -i -e "s:${TMP}:/tmp:" clamassassin
+}
+
+src_install() {
+ dobin clamassassin
+ dodoc CHANGELOG LICENSE README
+}
diff --git a/mail-filter/clamassassin/metadata.xml b/mail-filter/clamassassin/metadata.xml
new file mode 100644
index 00000000000..065f543536b
--- /dev/null
+++ b/mail-filter/clamassassin/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-mail</herd>
+<use>
+ <flag name='clamd'>Use the <pkg>app-antivirus/clamav</pkg> daemon for virus
+ checking</flag>
+ <flag name='subject-rewrite'>Adds support for subject rewriting</flag>
+</use>
+</pkgmetadata>
diff --git a/mail-filter/clamsmtp/Manifest b/mail-filter/clamsmtp/Manifest
new file mode 100644
index 00000000000..4ba0a430e6d
--- /dev/null
+++ b/mail-filter/clamsmtp/Manifest
@@ -0,0 +1 @@
+DIST clamsmtp-1.10.tar.gz 217126 RMD160 464047852f91d46af79340f10179106c2fb22bbc SHA1 0bfbc39228ab40db5064917dd0805e06fdbfd598 SHA256 a52fdb4b26e11ece30c478a806c95b1eda16f4e73937bd560ece7017fb0df92a
diff --git a/mail-filter/clamsmtp/clamsmtp-1.10.ebuild b/mail-filter/clamsmtp/clamsmtp-1.10.ebuild
new file mode 100644
index 00000000000..7107d9fe1c1
--- /dev/null
+++ b/mail-filter/clamsmtp/clamsmtp-1.10.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="ClamSMTP is an SMTP filter that allows you to check for viruses using the ClamAV anti-virus software"
+HOMEPAGE="http://memberwebs.com/nielsen/software/clamsmtp/"
+
+SRC_URI="http://memberwebs.com/nielsen/software/clamsmtp/${P}.tar.gz"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 hppa ~sparc x86"
+IUSE=""
+
+DEPEND=">=sys-apps/sed-4"
+RDEPEND=">=app-antivirus/clamav-0.75"
+
+src_install() {
+ make DESTDIR="${D}" install || die
+ dodoc AUTHORS ChangeLog README NEWS
+ newinitd "${FILESDIR}"/clamsmtpd.init clamsmtpd
+ insinto /etc
+ newins doc/clamsmtpd.conf clamsmtpd.conf
+
+ sed -i \
+ -e "s|\#\(ClamAddress\): .*|\1: /var/run/clamav/clamd.sock|" \
+ -e "s|\#\(User\): .*|\1: clamav|" \
+ "${D}"/etc/clamsmtpd.conf
+}
+
+pkg_postinst() {
+ echo
+ elog "For help configuring Postfix to use clamsmtpd, see:"
+ elog " http://memberwebs.com/nielsen/software/clamsmtp/postfix.html"
+ echo
+ ewarn "You'll need to have ScanMail support turned on in clamav.conf"
+ ewarn "Also, make sure the clamd scanning daemon is running (not just freshclam)"
+ echo
+}
diff --git a/mail-filter/clamsmtp/files/clamsmtpd.init b/mail-filter/clamsmtp/files/clamsmtpd.init
new file mode 100644
index 00000000000..74df0aa8ef9
--- /dev/null
+++ b/mail-filter/clamsmtp/files/clamsmtpd.init
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need clamd
+}
+
+start() {
+ ebegin "Starting ClamSMTPd"
+ start-stop-daemon --start --quiet \
+ --exec /usr/sbin/clamsmtpd -- -p /var/run/clamav/clamsmtpd.pid -f /etc/clamsmtpd.conf
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ClamSMTPd"
+ start-stop-daemon --stop --quiet --pidfile /var/run/clamav/clamsmtpd.pid
+ eend $?
+}
diff --git a/mail-filter/clamsmtp/metadata.xml b/mail-filter/clamsmtp/metadata.xml
new file mode 100644
index 00000000000..798cf022ffd
--- /dev/null
+++ b/mail-filter/clamsmtp/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <longdescription>ClamSMTP is an SMTP filter that allows you to check for viruses using the ClamAV anti-virus software. It accepts SMTP connections and forwards the SMTP commands and responses to another SMTP server. The 'DATA' email body is intercepted and scanned before forwarding.</longdescription>
+</pkgmetadata>
diff --git a/mail-filter/couriersrs/Manifest b/mail-filter/couriersrs/Manifest
new file mode 100644
index 00000000000..4322dcb80a8
--- /dev/null
+++ b/mail-filter/couriersrs/Manifest
@@ -0,0 +1 @@
+DIST couriersrs-0.1.2.tar.gz 521868 SHA256 44890a3348f3c6630ec6eca0cc9b2d755d5cce44e100439d22acbb3da6f94109
diff --git a/mail-filter/couriersrs/couriersrs-0.1.2.ebuild b/mail-filter/couriersrs/couriersrs-0.1.2.ebuild
new file mode 100644
index 00000000000..73538fc9786
--- /dev/null
+++ b/mail-filter/couriersrs/couriersrs-0.1.2.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit autotools eutils
+
+DESCRIPTION="SRS (Sender Rewriting Scheme) wrapper for the courier MTA"
+HOMEPAGE="http://couriersrs.com/"
+SRC_URI="http://couriersrs.com/download/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~x86"
+IUSE=""
+DEPEND="dev-libs/popt
+ mail-filter/libsrs2"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ rm m4/*.m4
+ epatch "${FILESDIR}/${P}-automake-fixes.diff"
+ AT_M4DIR="m4" eautoreconf
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ dodoc AUTHORS NEWS ChangeLog
+}
diff --git a/mail-filter/couriersrs/files/couriersrs-0.1.2-automake-fixes.diff b/mail-filter/couriersrs/files/couriersrs-0.1.2-automake-fixes.diff
new file mode 100644
index 00000000000..153e5d92c99
--- /dev/null
+++ b/mail-filter/couriersrs/files/couriersrs-0.1.2-automake-fixes.diff
@@ -0,0 +1,36 @@
+--- couriersrs-0.1.2/configure.ac.1 2009-10-11 19:20:07.000000000 +0200
++++ couriersrs-0.1.2/configure.ac 2009-10-11 19:30:35.000000000 +0200
+@@ -16,7 +16,7 @@
+ AM_ICONV
+
+ AM_GNU_GETTEXT
+-AM_GNU_GETTEXT_VERSION(0.14.1)
++AM_GNU_GETTEXT_VERSION(0.15)
+ ALL_LINGUAS=""
+
+ AC_DISABLE_STATIC
+diff -Naur couriersrs-0.1.1/intl/Makefile.in couriersrs-0.1.1-x/intl/Makefile.in
+--- couriersrs-0.1.1/intl/Makefile.in 2007-03-15 20:59:02.000000000 +0100
++++ couriersrs-0.1.1-x/intl/Makefile.in 2009-09-19 23:36:54.000000000 +0200
+@@ -39,8 +39,7 @@
+
+ INSTALL = @INSTALL@
+ INSTALL_DATA = @INSTALL_DATA@
+-MKINSTALLDIRS = @MKINSTALLDIRS@
+-mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
++mkinstalldirs = @mkdir_p@
+
+ l = @INTL_LIBTOOL_SUFFIX_PREFIX@
+
+--- couriersrs-0.1.1/po/Makefile.in.in 2007-03-15 20:59:04.000000000 +0100
++++ couriersrs-0.1.1-x/po/Makefile.in.in 2009-09-19 23:36:00.000000000 +0200
+@@ -28,8 +28,7 @@
+
+ INSTALL = @INSTALL@
+ INSTALL_DATA = @INSTALL_DATA@
+-MKINSTALLDIRS = @MKINSTALLDIRS@
+-mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
++mkinstalldirs = @mkdir_p@
+
+ GMSGFMT = @GMSGFMT@
+ MSGFMT = @MSGFMT@
diff --git a/mail-filter/couriersrs/metadata.xml b/mail-filter/couriersrs/metadata.xml
new file mode 100644
index 00000000000..b507dbb0fd1
--- /dev/null
+++ b/mail-filter/couriersrs/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-mail</herd>
+<maintainer><email>hanno@gentoo.org</email></maintainer>
+</pkgmetadata>
diff --git a/mail-filter/dcc/Manifest b/mail-filter/dcc/Manifest
new file mode 100644
index 00000000000..fd22ebed002
--- /dev/null
+++ b/mail-filter/dcc/Manifest
@@ -0,0 +1,2 @@
+DIST dcc-1.3.140.tar.Z 1681539 SHA256 19060563d3d72b70578d8f16e6780458d36f1a1db18a6d1e533bc42d80c38f24 SHA512 1c36bb32ae36480ded8306ca6a460a3070758397075cd6a4cee9c01a0e306ad371336037adf7759c8ef96f46b36c408699b7ec43b01268ac8e7c289d1e31d2e1 WHIRLPOOL 9415bd94a74b6e0d22ec323a8cf5227c08f5026c24b1530c7708321d092d5f0c58d6f3d5e7beb03d0dca948ea8c75cf3220d34e1b077030ee0b9b85c80644b64
+DIST dcc-1.3.154.tar.Z 1711292 SHA256 bc2e1496ec04914690c1d6d9d0f8be0954551b4165d731eb2d07dad307269399 SHA512 703bd3de44ccff3f318239dc2ca26a285f83ae0340a91391bcc5b719c298e77c8122d1502665350ddfc9fb14f12d9b6a56cba422ff8985db9cee6c91091fb987 WHIRLPOOL 7595b36066d3a89b1d2f4952334f6abe7cc70a1c03ff06ac6596b8901b8590329c944c9eeb132ed6253a4841150308378bef87dc5b2b74495c92a283110e0b14
diff --git a/mail-filter/dcc/dcc-1.3.140-r1.ebuild b/mail-filter/dcc/dcc-1.3.140-r1.ebuild
new file mode 100644
index 00000000000..740cc7728de
--- /dev/null
+++ b/mail-filter/dcc/dcc-1.3.140-r1.ebuild
@@ -0,0 +1,147 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Distributed Checksum Clearinghouse"
+HOMEPAGE="http://www.rhyolite.com/anti-spam/dcc/"
+SRC_URI="http://www.rhyolite.com/anti-spam/dcc/source/old/${P}.tar.Z"
+
+LICENSE="DCC"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc x86"
+IUSE="cgi ipv6 rrdtool milter"
+
+RDEPEND="dev-lang/perl
+ rrdtool? ( net-analyzer/rrdtool )
+ || ( net-misc/wget www-client/fetch net-misc/curl net-ftp/ftp )
+ milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )"
+DEPEND="sys-apps/sed
+ sys-devel/gcc
+ ${RDEPEND}"
+
+dcc_cgibin=/var/www/localhost/cgi-bin/dcc
+dcc_homedir=/var/dcc
+dcc_libexec=/usr/sbin
+dcc_man=/usr/share/man
+dcc_rundir=/var/run/dcc
+
+src_prepare() {
+ epatch "${FILESDIR}"/dcc-1.3.140-configure-fix.patch
+}
+
+src_configure() {
+ local myconf
+ myconf="${myconf} --homedir=${dcc_homedir}"
+ myconf="${myconf} --bindir=/usr/bin"
+ myconf="${myconf} --libexecdir=${dcc_libexec}"
+ myconf="${myconf} --mandir=/usr/share/man"
+ myconf="${myconf} --with-updatedcc_pfile=${dcc_homedir}/updatecc.pfile"
+ myconf="${myconf} --with-installroot=${D}"
+ # sigh. should be DCC-MD5 but see line 486 in the shipped configure script
+ myconf="${myconf} --with-DDC-MD5"
+ myconf="${myconf} --with-uid=root"
+ myconf="${myconf} --enable-server"
+ myconf="${myconf} --enable-dccifd"
+ myconf="${myconf} --with-rundir=${dcc_rundir}"
+ myconf="${myconf} --with-db-memory=64"
+ myconf="${myconf} --with-max-db-mem=128"
+ myconf="${myconf} --with-max-log-size=0"
+ myconf="${myconf} $(use_enable ipv6 IPv6)"
+
+ if use milter ; then
+ myconf="${myconf} --enable-dccm"
+ myconf="${myconf} --with-sendmail="
+ else
+ myconf="${myconf} --disable-dccm"
+ fi
+
+ if use cgi ; then
+ myconf="${myconf} --with-cgibin=${dcc_cgibin}"
+ else
+ myconf="${myconf} --without-cgibin"
+ fi
+
+ einfo "Using config: ${myconf}"
+
+ # This is NOT a normal configure script.
+ ./configure ${myconf} || die "configure failed!"
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" || die "emake failed!"
+}
+
+moveconf() {
+ local into=/etc/dcc/
+ for i in $@; do
+ mv "${D}${dcc_homedir}/${i}" "${D}${into}"
+ dosym "${into}${i}" "${dcc_homedir}/${i}"
+ done
+}
+
+src_install() {
+ # stolen from the RPM .spec and modified for gentoo
+ MANOWN=root MANGRP=root export MANOWN MANGRP
+ BINOWN="${MANOWN}" BINGRP="${MANGRP}" export BINOWN BINGRP
+ DCC_PROTO_HOMEDIR="${D}${dcc_homedir}" export DCC_PROTO_HOMEDIR
+ DCC_CGIBINDIR="${D}${dcc_cgibin}" export DCC_CGIBINDIR
+ DCC_SUID="${BINOWN}" DCC_OWN="${BINOWN}" DCC_GRP="${BINGRP}" export DCC_SUID DCC_OWN DCC_GRP
+
+ dodir /etc/cron.daily "${dcc_homedir}" /usr/bin /usr/sbin /usr/share/man/man{0,8} /etc/dcc
+ if use cgi ; then
+ dodir "${dcc_cgibin}"
+ fi
+ keepdir /var/log/dcc
+
+ # This package now takes "${D}" at compile-time!
+ # make DESTDIR="${D}" DCC_BINDIR="${D}"/usr/bin MANDIR="${D}"/usr/share/man/man DCC_HOMEDIR="${D}"${dcc_homedir} install || die
+ emake install || die "emake install failed"
+
+ # branding and setting reasonable defaults
+ sed -e "s/BRAND=\$/BRAND='Gentoo ${PF}'/;" \
+ -e "s/GREY_ENABLE=\$/GREY_ENABLE=off/;" \
+ -e "s/DCCM_LOG_AT=5\$/DCCM_LOG_AT=50/;" \
+ -e "s,DCCM_LOGDIR=\"log\"\$,DCCM_LOGDIR=\"/var/log/dcc\",;" \
+ -e "s/DCCM_ARGS=\$/DCCM_ARGS='-SHELO -Smail_host -SSender -SList-ID'/;" \
+ -e "s/DCCIFD_ARGS=\$/DCCIFD_ARGS=\"\$DCCM_ARGS\"/;" \
+ -e 's/DCCIFD_ENABLE=off/DCCIFD_ENABLE=on/' \
+ -e 's/DBCLEAN_LOGDAYS=14/DBCLEAN_LOGDAYS=1/' \
+ -i "${D}${dcc_homedir}/dcc_conf"
+
+ if use milter ; then
+ # enable milter
+ sed -i -e "s:^[\t #]*\(DCCM_ENABLE[\t ]*=[\t ]*\).*:\1on:g" \
+ "${D}${dcc_homedir}"/dcc_conf
+ fi
+
+ # provide cronjob
+ mv "${D}"/usr/sbin/cron-dccd "${D}"/etc/cron.daily/dccd || die "mv failed"
+
+ # clean up
+ mv "${D}"/usr/sbin/logger "${D}"/usr/sbin/logger-dcc || die "mv failed"
+
+ statslist="${D}/usr/sbin/{dcc-stats-graph,dcc-stats-init,dcc-stats-collect}"
+ if ! use rrdtool; then
+ # remove rrdtool interface scripts
+ eval rm -f ${statslist} || die "Failed to clean up rrdtool scripts"
+ fi
+
+ # clean up
+ rm -f "${D}"/usr/sbin/{rcDCC,updatedcc}
+
+ # place configuration files into /etc instead of /var/dcc
+ moveconf dcc_conf flod grey_flod grey_whitelist ids map map.txt whiteclnt whitecommon whitelist
+
+ newinitd "${FILESDIR}"/dcc.initd-1.3.140 dcc
+ newconfd "${FILESDIR}"/dcc.confd dcc
+
+ rmdir "${D}"/var/dcc/log/
+
+ dodoc CHANGES RESTRICTIONS
+ dohtml *.html
+ doman *.{0,8}
+}
diff --git a/mail-filter/dcc/dcc-1.3.154.ebuild b/mail-filter/dcc/dcc-1.3.154.ebuild
new file mode 100644
index 00000000000..35796acc308
--- /dev/null
+++ b/mail-filter/dcc/dcc-1.3.154.ebuild
@@ -0,0 +1,133 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit base eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Distributed Checksum Clearinghouse"
+HOMEPAGE="http://www.rhyolite.com/anti-spam/dcc/"
+SRC_URI="http://www.rhyolite.com/anti-spam/dcc/source/old/${P}.tar.Z"
+
+LICENSE="DCC GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" # ~amd64-fbsd
+IUSE="cgi ipv6 rrdtool milter"
+
+RDEPEND="dev-lang/perl
+ rrdtool? ( net-analyzer/rrdtool )
+ || ( net-misc/wget www-client/fetch net-misc/curl net-ftp/ftp )
+ milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )"
+DEPEND="sys-apps/sed
+ sys-devel/gcc
+ ${RDEPEND}"
+
+dcc_cgibin=/var/www/localhost/cgi-bin/dcc
+dcc_homedir=/var/dcc
+dcc_libexec=/usr/sbin
+dcc_man=/usr/share/man
+dcc_rundir=/var/run/dcc
+
+PATCHES=( "${FILESDIR}"/dcc-1.3.140-freebsd.patch )
+
+src_configure() {
+ tc-export CC AR RANLIB
+ local myconf
+ myconf="${myconf} --homedir=${dcc_homedir}"
+ myconf="${myconf} --bindir=/usr/bin"
+ myconf="${myconf} --libexecdir=${dcc_libexec}"
+ myconf="${myconf} --mandir=/usr/share/man"
+ myconf="${myconf} --with-updatedcc_pfile=${dcc_homedir}/updatecc.pfile"
+ myconf="${myconf} --with-installroot=${D}"
+ # sigh. should be DCC-MD5 but see line 486 in the shipped configure script
+ myconf="${myconf} --with-DDC-MD5"
+ myconf="${myconf} --with-uid=root"
+ myconf="${myconf} --enable-server"
+ myconf="${myconf} --enable-dccifd"
+ myconf="${myconf} --with-rundir=${dcc_rundir}"
+ myconf="${myconf} --with-db-memory=64"
+ myconf="${myconf} --with-max-db-mem=128"
+ myconf="${myconf} --with-max-log-size=0"
+ myconf="${myconf} --with-make-cmd=${MAKE:-make}"
+ myconf="${myconf} $(use_enable ipv6 IPv6)"
+ myconf="${myconf} $(use_with cgi cgibin ${dcc_cgibin})"
+ myconf="${myconf} $(use_enable milter dccm)"
+ use milter && myconf="${myconf} --with-sendmail="
+
+ einfo "Using config: ${myconf}"
+
+ # This is NOT a normal configure script.
+ ./configure ${myconf} || die "configure failed!"
+}
+
+moveconf() {
+ local into=/etc/dcc/
+ for i in $@; do
+ mv "${D}${dcc_homedir}/${i}" "${D}${into}"
+ dosym "${into}${i}" "${dcc_homedir}/${i}"
+ done
+}
+
+src_install() {
+ # stolen from the RPM .spec and modified for gentoo
+ MANOWN=root MANGRP=$(id -g -n root) export MANOWN MANGRP
+ BINOWN="${MANOWN}" BINGRP="${MANGRP}" export BINOWN BINGRP
+ DCC_PROTO_HOMEDIR="${D}${dcc_homedir}" export DCC_PROTO_HOMEDIR
+ DCC_CGIBINDIR="${D}${dcc_cgibin}" export DCC_CGIBINDIR
+ DCC_SUID="${BINOWN}" DCC_OWN="${BINOWN}" DCC_GRP="${BINGRP}" export DCC_SUID DCC_OWN DCC_GRP
+
+ dodir /etc/cron.daily "${dcc_homedir}" /usr/bin /usr/sbin /usr/share/man/man{0,8} /etc/dcc
+ if use cgi ; then
+ dodir "${dcc_cgibin}"
+ fi
+ keepdir /var/log/dcc
+
+ # This package now takes "${D}" at compile-time!
+ # make DESTDIR="${D}" DCC_BINDIR="${D}"/usr/bin MANDIR="${D}"/usr/share/man/man DCC_HOMEDIR="${D}"${dcc_homedir} install || die
+ emake install
+
+ # branding and setting reasonable defaults
+ sed -e "s/BRAND=\$/BRAND='Gentoo ${PF}'/;" \
+ -e "s/GREY_ENABLE=\$/GREY_ENABLE=off/;" \
+ -e "s/DCCM_LOG_AT=5\$/DCCM_LOG_AT=50/;" \
+ -e "s,DCCM_LOGDIR=\"log\"\$,DCCM_LOGDIR=\"/var/log/dcc\",;" \
+ -e "s/DCCM_ARGS=\$/DCCM_ARGS='-SHELO -Smail_host -SSender -SList-ID'/;" \
+ -e "s/DCCIFD_ARGS=\$/DCCIFD_ARGS=\"\$DCCM_ARGS\"/;" \
+ -e 's/DCCIFD_ENABLE=off/DCCIFD_ENABLE=on/' \
+ -e 's/DBCLEAN_LOGDAYS=14/DBCLEAN_LOGDAYS=1/' \
+ -i "${D}${dcc_homedir}/dcc_conf"
+
+ if use milter ; then
+ # enable milter
+ sed -i -e "s:^[\t #]*\(DCCM_ENABLE[\t ]*=[\t ]*\).*:\1on:g" \
+ "${D}${dcc_homedir}"/dcc_conf
+ fi
+
+ # provide cronjob
+ mv "${D}"/usr/sbin/cron-dccd "${D}"/etc/cron.daily/dccd || die "mv failed"
+
+ # clean up
+ mv "${D}"/usr/sbin/logger "${D}"/usr/sbin/logger-dcc || die "mv failed"
+
+ statslist="${D}/usr/sbin/{dcc-stats-graph,dcc-stats-init,dcc-stats-collect}"
+ if ! use rrdtool; then
+ # remove rrdtool interface scripts
+ eval rm -f ${statslist} || die "Failed to clean up rrdtool scripts"
+ fi
+
+ # clean up
+ rm -f "${D}"/usr/sbin/{rcDCC,updatedcc}
+
+ # place configuration files into /etc instead of /var/dcc
+ moveconf dcc_conf flod grey_flod grey_whitelist ids map map.txt whiteclnt whitecommon whitelist
+
+ newinitd "${FILESDIR}"/dcc.initd-1.3.154 dcc
+ newconfd "${FILESDIR}"/dcc.confd dcc
+
+ rmdir "${D}"/var/dcc/log/
+
+ dodoc CHANGES RESTRICTIONS
+ dohtml *.html
+ doman *.{0,8}
+}
diff --git a/mail-filter/dcc/files/dcc-1.3.140-configure-fix.patch b/mail-filter/dcc/files/dcc-1.3.140-configure-fix.patch
new file mode 100644
index 00000000000..41620929c61
--- /dev/null
+++ b/mail-filter/dcc/files/dcc-1.3.140-configure-fix.patch
@@ -0,0 +1,17 @@
+Avoid installing into /no/.
+
+Signed-off-by: Lars Wendler (Polynomial-C) <polynomial-c@gentoo.org>
+X-Gentoo-Bug: 388383
+X-Gentoo-Bug-URL: https://bugs.gentoo.org/388383
+
+--- dcc-1.3.140/configure
++++ dcc-1.3.140/configure
+@@ -3256,7 +3256,7 @@
+ withval="$with_cgibin"
+ :
+ fi
+-if test -n "$with_cgibin" -a "$with_cgi_bin" != no; then
++if test -n "$with_cgibin" -a "$with_cgibin" != no; then
+ cgibin="$with_cgibin"
+ fi
+
diff --git a/mail-filter/dcc/files/dcc-1.3.140-freebsd.patch b/mail-filter/dcc/files/dcc-1.3.140-freebsd.patch
new file mode 100644
index 00000000000..e72224f41c2
--- /dev/null
+++ b/mail-filter/dcc/files/dcc-1.3.140-freebsd.patch
@@ -0,0 +1,13 @@
+diff --git a/configure b/configure
+index 5efe49d..de8d6f2 100755
+--- a/configure
++++ b/configure
+@@ -3677,7 +3677,7 @@ case "$TARGET_SYS" in
+ # compressed via /usr/share/mk
+ mancat=man
+ MANX='$(MAN8)'
+- USE_DCCMANINSTALL='# USE_DCCMANINSTALL=no'
++ USE_DCCMANINSTALL='USE_DCCMANINSTALL=yes'
+ ;;
+ DragonFly)
+ # default to /usr/local/man/man8 and use nroff files, possibly
diff --git a/mail-filter/dcc/files/dcc-1.3.86.patch b/mail-filter/dcc/files/dcc-1.3.86.patch
new file mode 100644
index 00000000000..c1ac27f1075
--- /dev/null
+++ b/mail-filter/dcc/files/dcc-1.3.86.patch
@@ -0,0 +1,41 @@
+I know it looks weird that we are patching configure here, but there is NO
+configure.{ac,in} source included with this package.
+- Robin H. Johnson <robbat2@gentoo.org>
+
+This patch is from Gentoo bug 182172, and was submitted by steveb
+<steeeeeveee@gmx.net>.
+
+diff -Naur dcc-1.3.86/configure dcc-1.3.86.new/configure
+--- dcc-1.3.86/configure 2008-03-11 16:38:41.000000000 +0100
++++ dcc-1.3.86.new/configure 2008-03-24 19:50:52.802962250 +0100
+@@ -1058,8 +1058,7 @@
+ FreeBSD|DragonFly)
+ PTHREAD_LDFLAGS="$PTHREAD_LDFLAGS -pthread"
+ if test -s /usr/lib/libc_r.a; then
+- # use libc_r on ancient versions
+- appendvar PTHREAD_LIBS -lc_r
++ appendvar PTHREAD_LIBS
+ fi
+ ;;
+ Darwin)
+@@ -3511,7 +3510,7 @@
+ mancat=man
+ MAN8='dcc.8 $(SUBDIR_MAN8)'
+ MAN8INST=''
+- USE_DCCMANINSTALL='# do not use dccmaninstall'
++ USE_DCCMANINSTALL='maninstall:dccmaninstall'
+ ;;
+ DragonFly)
+ # default to /usr/local/man/man8 and use nroff files, possibly
+diff -Naur dcc-1.3.86/thrlib/cmn.c dcc-1.3.86.new/thrlib/cmn.c
+--- dcc-1.3.86/thrlib/cmn.c 2008-02-11 06:00:45.000000000 +0100
++++ dcc-1.3.86.new/thrlib/cmn.c 2008-03-24 19:51:36.333682750 +0100
+@@ -667,7 +667,7 @@
+ LOG_CMN_CAPTION(cwp, DCC_LOG_TRN_MSG_CR);
+ cwp->log_size = MAX_LOG_SIZE+1;
+ #else
+- log_write(&wp->cw, buf, buflen);
++ log_write(cwp, buf, buflen);
+ #endif
+ }
+
diff --git a/mail-filter/dcc/files/dcc.confd b/mail-filter/dcc/files/dcc.confd
new file mode 100644
index 00000000000..a6e556827db
--- /dev/null
+++ b/mail-filter/dcc/files/dcc.confd
@@ -0,0 +1,14 @@
+# Config file for /etc/init.d/dcc
+
+# Start server or DCC daemon
+START_DCC_DCCD="yes"
+
+# Start DCC greylisting
+START_DCC_GREY="yes"
+
+# Start milter interface
+START_DCC_DCCM="yes"
+
+# Start general Perl and MTA interface
+# and Postfix before-queue filter
+START_DCC_DCCIF="yes"
diff --git a/mail-filter/dcc/files/dcc.initd b/mail-filter/dcc/files/dcc.initd
new file mode 100644
index 00000000000..a730ddcdf8f
--- /dev/null
+++ b/mail-filter/dcc/files/dcc.initd
@@ -0,0 +1,136 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use logger
+ need net
+ before mta
+}
+
+checkconfig() {
+ if [[ ! -f "/etc/dcc/dcc_conf" || ! -r "/etc/dcc/dcc_conf" ]]
+ then
+ eerror "You need a DCC configuration in /etc/dcc/dcc_conf"
+ return 1
+ else
+ source "/etc/dcc/dcc_conf"
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ if [[ "${START_DCC_DCCD}" == "yes" ]]
+ then
+ if [[ "${DCCD_ENABLE}" != "on" ]]
+ then
+ einfo "DCCD_ENABLE is not setto 'on' in dcc_conf"
+ else
+ if [[ -x "${DCC_LIBEXEC}/start-dccd" ]]
+ then
+ ebegin "Starting dccd"
+ ${DCC_LIBEXEC}/start-dccd >/dev/null 2>&1
+ eend ${?}
+ else
+ eerror "You enabled DCCD but start-dccd is missing or not executable"
+ fi
+ fi
+ fi
+
+ if [[ "${START_DCC_GREY}" == "yes" ]]
+ then
+ if [[ "${GREY_ENABLE}" != "on" ]]
+ then
+ einfo "GREY_ENABLE is not set to 'on' in dcc_conf"
+ else
+ if [[ -x "${DCC_LIBEXEC}/start-grey" ]]
+ then
+ ebegin "Starting grey"
+ ${DCC_LIBEXEC}/start-grey >/dev/null 2>&1
+ eend ${?}
+ else
+ eerror "You enabled GREY but start-grey is missing or not executable"
+ fi
+ fi
+ fi
+
+ if [[ "${START_DCC_DCCM}" == "yes" ]]
+ then
+ if [[ "${DCCM_ENABLE}" != "on" ]]
+ then
+ einfo "DCCM_ENABLE is not set to 'on' in dcc_conf"
+ else
+ if [[ -x "${DCC_LIBEXEC}/start-dccm" ]]
+ then
+ ebegin "Starting dccm"
+ ${DCC_LIBEXEC}/start-dccm >/dev/null 2>&1
+ eend ${?}
+ for ((dccmtimeout=0 ; dccmtimeout <= 20 ; dccmtimeout++))
+ do
+ if [[ ! -S "${DCC_RUNDIR}/dccm" || ! -r "${DCC_RUNDIR}/dccm" ]]
+ then
+ sleep 1
+ else
+ break
+ fi
+ done
+ chown ${SOCKET_USER:-milter}:${SOCKET_GROUP:-milter} ${DCC_RUNDIR}/dccm 1>/dev/null 2>&1
+ chmod ${SOCKET_MODE:-664} ${DCC_RUNDIR}/dccm 1>/dev/null 2>&1
+ sed -i -e "s:^\-::" ${DCC_RUNDIR}/dccm.pid
+ else
+ eerror "You enabled DCCM but start-dccm is missing or not executable"
+ fi
+ fi
+ fi
+
+ if [[ "${START_DCC_DCCIF}" == "yes" ]]
+ then
+ if [[ "${DCCIFD_ENABLE}" != "on" ]]
+ then
+ einfo "DCCIFD_ENABLE is not set to 'on' in dcc_conf"
+ else
+ if [[ -x "${DCC_LIBEXEC}/start-dccifd" ]]
+ then
+ ebegin "Starting dccif"
+ ${DCC_LIBEXEC}/start-dccifd >/dev/null 2>&1
+ eend ${?}
+ else
+ eerror "You enabled DCCIF but start-dccif is missing or not executable"
+ fi
+ fi
+ fi
+}
+
+stop() {
+ checkconfig || return 1
+
+ if [[ -r "${DCC_RUNDIR}/dccifd.pid" ]]
+ then
+ ebegin "Stopping dccif"
+ kill -15 $(< ${DCC_RUNDIR}/dccifd.pid) 2>/dev/null
+ eend ${?}
+ fi
+
+ if [[ -r "${DCC_RUNDIR}/dccm.pid" ]]
+ then
+ ebegin "Stopping dccm"
+ kill -15 $(< ${DCC_RUNDIR}/dccm.pid) 2>/dev/null
+ eend ${?}
+ fi
+
+ if (pidof dccd >/dev/null 2>&1) && [[ -x "${DCC_LIBEXEC}/stop-dccd" ]]
+ then
+ ebegin "Stopping dccd"
+ ${DCC_LIBEXEC}/stop-dccd >/dev/null 2>&1
+ eend ${?}
+ fi
+
+ if (pidof dccd >/dev/null 2>&1) && [[ -x "${DCC_LIBEXEC}/stop-dccd" ]]
+ then
+ ebegin "Stopping grey"
+ ${DCC_LIBEXEC}/stop-dccd -G >/dev/null 2>&1
+ eend ${?}
+ fi
+}
diff --git a/mail-filter/dcc/files/dcc.initd-1.3.140 b/mail-filter/dcc/files/dcc.initd-1.3.140
new file mode 100644
index 00000000000..f6fa080338c
--- /dev/null
+++ b/mail-filter/dcc/files/dcc.initd-1.3.140
@@ -0,0 +1,101 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use logger
+ need net
+ before mta
+}
+
+checkconfig() {
+ if [ ! -f "/etc/dcc/dcc_conf" ]; then
+ eerror "You need a DCC configuration in /etc/dcc/dcc_conf"
+ return 1
+ fi
+ for i in DCCD_ENABLE GREY_ENABLE DCCM_ENABLE DCCIFD_ENABLE DCC_LIBEXEC DCC_RUNDIR \
+ SOCKET_USER SOCKET_GROUP SOCKET_MODE; do
+ read -r ${i} <<-EOF
+ $( grep ^[[:space:]]*${i} /etc/dcc/dcc_conf | sed s/.*=// )
+ EOF
+ done
+ DCC_RUNDIR="${DCC_RUNDIR:-/var/run/dcc}"
+ if [ ! -d "${DCC_RUNDIR}" ]; then
+ checkpath -q -d -o root:root -m 0755 "${DCC_RUNDIR}" || return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ local atleastone="${DCCD_ENABLE}${GREY_ENABLE}${DCCM_ENABLE}${DCCIFD_ENABLE}"
+ atleastone=$( echo ${atleastone} | tr -d 'off' )
+ if [ -z "${atleastone}" ]; then
+ eend 1 "At least one service should be 'on' in /etc/dcc/dcc_conf"
+ return 1
+ fi
+
+ if [ "${DCCD_ENABLE}" = "on" ] && [ -x "${DCC_LIBEXEC}/start-dccd" ]; then
+ ebegin "Starting dccd"
+ ${DCC_LIBEXEC}/start-dccd >/dev/null 2>&1
+ eend ${?}
+ fi
+
+ if [ "${GREY_ENABLE}" = "on" ] && [ -x "${DCC_LIBEXEC}/start-grey" ]; then
+ ebegin "Starting grey"
+ ${DCC_LIBEXEC}/start-grey >/dev/null 2>&1
+ eend ${?}
+ fi
+
+ if [ "${DCCM_ENABLE}" = "on" ] && [ -x "${DCC_LIBEXEC}/start-dccm" ]; then
+ ebegin "Starting dccm"
+ ${DCC_LIBEXEC}/start-dccm >/dev/null 2>&1
+ eend ${?}
+ local dccmtimeout=0
+ while [ ${dcctimeout} -le 20 ] ; do
+ if [ -S "${DCC_RUNDIR}/dccm" ] || [ -r "${DCC_RUNDIR}/dccm" ]; then
+ break
+ else
+ sleep 1
+ dcctimeout=$(($dcctimeout + 1))
+ fi
+ done
+ chown ${SOCKET_USER:-milter}:${SOCKET_GROUP:-milter} ${DCC_RUNDIR}/dccm 1>/dev/null 2>&1
+ chmod ${SOCKET_MODE:-664} ${DCC_RUNDIR}/dccm 1>/dev/null 2>&1
+ sed -i -e "s:^\-::" ${DCC_RUNDIR}/dccm.pid 1>/dev/null 2>&1 || return 1
+ fi
+
+ if [ "${DCCIFD_ENABLE}" = "on" ] && [ -x "${DCC_LIBEXEC}/start-dccifd" ]; then
+ ebegin "Starting dccif"
+ ${DCC_LIBEXEC}/start-dccifd >/dev/null 2>&1
+ eend ${?}
+ fi
+}
+
+stop() {
+ checkconfig || return 1
+
+ if [ -r "${DCC_RUNDIR}/dccifd.pid" ]; then
+ ebegin "Stopping dccif"
+ kill -15 $(< ${DCC_RUNDIR}/dccifd.pid) 2>/dev/null
+ eend ${?}
+ fi
+
+ if [ -r "${DCC_RUNDIR}/dccm.pid" ]; then
+ ebegin "Stopping dccm"
+ kill -15 $(< ${DCC_RUNDIR}/dccm.pid) 2>/dev/null
+ eend ${?}
+ fi
+
+ if (pidof dccd >/dev/null 2>&1) && [ -x "${DCC_LIBEXEC}/stop-dccd" ]; then
+ ebegin "Stopping dccd"
+ ${DCC_LIBEXEC}/stop-dccd >/dev/null 2>&1
+ eend ${?}
+ fi
+
+ if (pidof dccd >/dev/null 2>&1) && [ -x "${DCC_LIBEXEC}/stop-dccd" ]; then
+ ebegin "Stopping grey"
+ ${DCC_LIBEXEC}/stop-dccd -G >/dev/null 2>&1
+ eend ${?}
+ fi
+}
diff --git a/mail-filter/dcc/files/dcc.initd-1.3.154 b/mail-filter/dcc/files/dcc.initd-1.3.154
new file mode 100644
index 00000000000..a810d05f881
--- /dev/null
+++ b/mail-filter/dcc/files/dcc.initd-1.3.154
@@ -0,0 +1,103 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use logger
+ need net
+ before mta
+}
+
+checkconfig() {
+ if [ ! -f "/etc/dcc/dcc_conf" ]; then
+ eerror "You need a DCC configuration in /etc/dcc/dcc_conf"
+ return 1
+ fi
+ for i in DCCD_ENABLE GREY_ENABLE DCCM_ENABLE DCCM_ARGS DCCIFD_ENABLE DCC_LIBEXEC DCC_RUNDIR \
+ SOCKET_USER SOCKET_GROUP SOCKET_MODE; do
+ read -r ${i} <<-EOF
+ $( grep ^[[:space:]]*${i} /etc/dcc/dcc_conf | sed s/.*=// )
+ EOF
+ done
+ DCC_RUNDIR="${DCC_RUNDIR:-/var/run/dcc}"
+ if [ ! -d "${DCC_RUNDIR}" ]; then
+ checkpath -q -d -o root:root -m 0755 "${DCC_RUNDIR}" || return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ local atleastone="${DCCD_ENABLE}${GREY_ENABLE}${DCCM_ENABLE}${DCCIFD_ENABLE}"
+ atleastone=$( echo ${atleastone} | tr -d 'off' )
+ if [ -z "${atleastone}" ]; then
+ eend 1 "At least one service should be 'on' in /etc/dcc/dcc_conf"
+ return 1
+ fi
+
+ if [ "${DCCD_ENABLE}" = "on" ] && [ -x "${DCC_LIBEXEC}/start-dccd" ]; then
+ ebegin "Starting dccd"
+ ${DCC_LIBEXEC}/start-dccd >/dev/null 2>&1
+ eend ${?}
+ fi
+
+ if [ "${GREY_ENABLE}" = "on" ] && [ -x "${DCC_LIBEXEC}/start-grey" ]; then
+ ebegin "Starting grey"
+ ${DCC_LIBEXEC}/start-grey >/dev/null 2>&1
+ eend ${?}
+ fi
+
+ if [ "${DCCM_ENABLE}" = "on" ] && [ -x "${DCC_LIBEXEC}/start-dccm" ]; then
+ ebegin "Starting dccm"
+ ${DCC_LIBEXEC}/start-dccm >/dev/null 2>&1
+ eend ${?}
+ if !(echo ${DCCM_ARGS}|grep -q "^\-p\|[[:space:]]\-p"); then
+ local dccmtimeout=0
+ while [ ${dccmtimeout} -le 20 ] ; do
+ if [ -S "${DCC_RUNDIR}/dccm" ] || [ -r "${DCC_RUNDIR}/dccm" ]; then
+ break
+ else
+ sleep 1
+ dccmtimeout=$(($dccmtimeout + 1))
+ fi
+ done
+ chown ${SOCKET_USER:-milter}:${SOCKET_GROUP:-milter} ${DCC_RUNDIR}/dccm 1>/dev/null 2>&1
+ chmod ${SOCKET_MODE:-664} ${DCC_RUNDIR}/dccm 1>/dev/null 2>&1
+ fi
+ sed -i -e "s:^\-::" ${DCC_RUNDIR}/dccm.pid 1>/dev/null 2>&1 || return 1
+ fi
+
+ if [ "${DCCIFD_ENABLE}" = "on" ] && [ -x "${DCC_LIBEXEC}/start-dccifd" ]; then
+ ebegin "Starting dccif"
+ ${DCC_LIBEXEC}/start-dccifd >/dev/null 2>&1
+ eend ${?}
+ fi
+}
+
+stop() {
+ checkconfig || return 1
+
+ if [ -r "${DCC_RUNDIR}/dccifd.pid" ]; then
+ ebegin "Stopping dccif"
+ kill -s 15 $(cat ${DCC_RUNDIR}/dccifd.pid) 2>/dev/null
+ eend ${?}
+ fi
+
+ if [ -r "${DCC_RUNDIR}/dccm.pid" ]; then
+ ebegin "Stopping dccm"
+ kill -s 15 $(cat ${DCC_RUNDIR}/dccm.pid) 2>/dev/null
+ eend ${?}
+ fi
+
+ if (pidof dccd >/dev/null 2>&1) && [ -x "${DCC_LIBEXEC}/stop-dccd" ]; then
+ ebegin "Stopping dccd"
+ ${DCC_LIBEXEC}/stop-dccd >/dev/null 2>&1
+ eend ${?}
+ fi
+
+ if (pidof dccd >/dev/null 2>&1) && [ -x "${DCC_LIBEXEC}/stop-dccd" ]; then
+ ebegin "Stopping grey"
+ ${DCC_LIBEXEC}/stop-dccd -G >/dev/null 2>&1
+ eend ${?}
+ fi
+}
diff --git a/mail-filter/dcc/metadata.xml b/mail-filter/dcc/metadata.xml
new file mode 100644
index 00000000000..e64b530dee2
--- /dev/null
+++ b/mail-filter/dcc/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-mail</herd>
+<maintainer>
+ <email>robbat2@gentoo.org</email>
+</maintainer>
+<use>
+ <flag name='rrdtool'>Enable <pkg>net-analyzer/rrdtool</pkg> interface
+ scripts</flag>
+</use>
+</pkgmetadata>
diff --git a/mail-filter/disspam/Manifest b/mail-filter/disspam/Manifest
new file mode 100644
index 00000000000..a23ff0bf1e7
--- /dev/null
+++ b/mail-filter/disspam/Manifest
@@ -0,0 +1 @@
+DIST disspam-0.14.tar.gz 14080 SHA256 28232f79a756d406285f6d698ea73bdadd1bbcc19070f6b0b9d4dabbf8d466ce SHA512 549210d7a5aacd62cdf3ce7384c5d35e011147355388fdfde14ee1f951752ebd3f1f4844c4c2016ee3b1cb0cf88242d0bb7dccbc9dfa6ec2ca3e39e2f1b7195b WHIRLPOOL 2bc514afaad0d09515235b19e89625a0084cd3bd0a24c71ba41cf6c3ee99f18fb0fbfbd642bafb0194de9d2219419a471f041977d659c4df8ae697c53f9456bb
diff --git a/mail-filter/disspam/disspam-0.14.ebuild b/mail-filter/disspam/disspam-0.14.ebuild
new file mode 100644
index 00000000000..25fa154347c
--- /dev/null
+++ b/mail-filter/disspam/disspam-0.14.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="A Perl script that removes spam from POP3 mailboxes based on RBLs"
+HOMEPAGE="http://www.topfx.com/"
+SRC_URI="http://www.topfx.com/dist/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="Artistic"
+KEYWORDS="alpha ~amd64 ~hppa ~mips ppc sparc x86"
+IUSE=""
+
+DEPEND=">=dev-lang/perl-5.6.1
+ >=virtual/perl-libnet-1.11
+ >=sys-apps/sed-4
+ >=dev-perl/Net-DNS-0.12"
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ #This doesnt look neat but makes it work
+ sed -i \
+ -e 's/\/usr\/local\/bin\/perl/\/usr\/bin\/perl/' disspam.pl || \
+ die "sed disspam.pl failed"
+}
+
+src_install() {
+ dobin disspam.pl
+ dodoc changes.txt configuration.txt readme.txt sample.conf
+}
diff --git a/mail-filter/disspam/files/0.12-sa302fix.patch b/mail-filter/disspam/files/0.12-sa302fix.patch
new file mode 100644
index 00000000000..58f99249705
--- /dev/null
+++ b/mail-filter/disspam/files/0.12-sa302fix.patch
@@ -0,0 +1,22 @@
+diff -bur disspam-orig/disspam.pl disspam/disspam.pl
+--- disspam-orig/disspam.pl 2003-05-07 00:46:14.000000000 +0200
++++ disspam/disspam.pl 2004-12-31 18:31:49.006478280 +0100
+@@ -144,7 +144,8 @@
+ if ($HEADERHASHES{$hash} =~ /S/) {
+
+ # It's old spam
+- $reason = "Message previously detected as spam";
++ #$reason = "Message previously detected as spam";
++ undef $reason
+ }
+ else {
+
+@@ -766,7 +767,7 @@
+
+ #give email SpamAssassin headers
+ $status->rewrite_mail();
+- $$messageref = $status->get_full_message_as_text();
++ $$messageref = $status->get_message();
+ }
+ }
+ else {
diff --git a/mail-filter/disspam/metadata.xml b/mail-filter/disspam/metadata.xml
new file mode 100644
index 00000000000..51f94e3fbe0
--- /dev/null
+++ b/mail-filter/disspam/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-mail</herd>
+</pkgmetadata>
diff --git a/mail-filter/dkimproxy/Manifest b/mail-filter/dkimproxy/Manifest
new file mode 100644
index 00000000000..12c15e0157a
--- /dev/null
+++ b/mail-filter/dkimproxy/Manifest
@@ -0,0 +1 @@
+DIST dkimproxy-1.4.1.tar.gz 109040 SHA256 e5345a1d3cefd32d1fb0face9fa73490118132767253b0ce643463f1e86185bd SHA512 ad5ac961ea25cdd7ccc763521d1fa5e143ef93056ca4bdace1d0d8f564ab85cb128b4c97ace310bcbf9e4d49430dd5baf1e9f836f5a44a4b3f1e7498ebc352b6 WHIRLPOOL 4121f198b4c8406c310ecede8bfb7fec7c0368c637a66c5484f66b873de03dabd34a6a415a01cb285ae131699da37a8cce36168c8a73d7fc32086e73c0690af1
diff --git a/mail-filter/dkimproxy/dkimproxy-1.4.1.ebuild b/mail-filter/dkimproxy/dkimproxy-1.4.1.ebuild
new file mode 100644
index 00000000000..2dac62fbb25
--- /dev/null
+++ b/mail-filter/dkimproxy/dkimproxy-1.4.1.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="An SMTP proxy server for adding DKIM headers"
+HOMEPAGE="http://dkimproxy.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="dev-perl/Mail-DKIM
+ >=dev-perl/net-server-2.7.0
+ dev-perl/Error
+ dev-perl/MIME-tools"
+RDEPEND="${DEPEND}"
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/dkimproxy.in.initd dkimproxy.in
+ newinitd "${FILESDIR}"/dkimproxy.out.initd dkimproxy.out
+}
diff --git a/mail-filter/dkimproxy/files/dkimproxy.in.initd b/mail-filter/dkimproxy/files/dkimproxy.in.initd
new file mode 100644
index 00000000000..a7a5ac6c1a0
--- /dev/null
+++ b/mail-filter/dkimproxy/files/dkimproxy.in.initd
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting dkimproxy.in"
+ start-stop-daemon --start --exec /usr/bin/dkimproxy.in --pidfile /var/run/dkimproxy.in.pid -- --conf_file /etc/dkimproxy_in.conf --daemonize --group=nobody --user=nobody --pidfile=/var/run/dkimproxy.in.pid
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping dkimproxy.in"
+ start-stop-daemon --stop --exec /usr/bin/dkimproxy.in --pidfile /var/run/dkimproxy.in.pid
+ eend $?
+}
diff --git a/mail-filter/dkimproxy/files/dkimproxy.out.initd b/mail-filter/dkimproxy/files/dkimproxy.out.initd
new file mode 100644
index 00000000000..8002fd38713
--- /dev/null
+++ b/mail-filter/dkimproxy/files/dkimproxy.out.initd
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting dkimproxy.out"
+ start-stop-daemon --start --exec /usr/bin/dkimproxy.out --pidfile /var/run/dkimproxy.out.pid -- --conf_file /etc/dkimproxy_out.conf --daemonize --group=nobody --user=nobody --pidfile=/var/run/dkimproxy.out.pid
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping dkimproxy.out"
+ start-stop-daemon --stop --exec /usr/bin/dkimproxy.out --pidfile /var/run/dkimproxy.out.pid
+ eend $?
+}
diff --git a/mail-filter/dkimproxy/metadata.xml b/mail-filter/dkimproxy/metadata.xml
new file mode 100644
index 00000000000..95d1a131392
--- /dev/null
+++ b/mail-filter/dkimproxy/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>zx2c4@gentoo.org</email>
+ <name>Jason A. Donenfeld</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">dkimproxy</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/dovecot-antispam/Manifest b/mail-filter/dovecot-antispam/Manifest
new file mode 100644
index 00000000000..61ad1931280
--- /dev/null
+++ b/mail-filter/dovecot-antispam/Manifest
@@ -0,0 +1 @@
+DIST dovecot-antispam-2.0_pre20130429.tar.bz2 56113 SHA256 bd3511a88a06bba488be3bae4f5d970cd22805e096d7524b5d4de507770c3ddb SHA512 0e054127f6519f3be76a4a580717413789f6d49db45d451902a2aa1da1809202364b4b3b4d527d2ab803f3d0d92da55d65e429ca1150696cb8e4227d6258e8d4 WHIRLPOOL 76abf38e56696415529dfa17813e207565c95a189769c4b292be562824a97feca5f2f0dc8909ec9ae601f4428321fb9608236f8f4f65a4cfaf548a0c6de65475
diff --git a/mail-filter/dovecot-antispam/dovecot-antispam-2.0_pre20130429.ebuild b/mail-filter/dovecot-antispam/dovecot-antispam-2.0_pre20130429.ebuild
new file mode 100644
index 00000000000..f8b06e67a11
--- /dev/null
+++ b/mail-filter/dovecot-antispam/dovecot-antispam-2.0_pre20130429.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools
+
+DESCRIPTION="A dovecot antispam plugin supporting multiple backends"
+HOMEPAGE="http://wiki2.dovecot.org/Plugins/Antispam/"
+SRC_URI="http://dev.gentoo.org/~radhermit/distfiles/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+
+DEPEND=">=net-mail/dovecot-2.1.16"
+RDEPEND="${DEPEND}"
+
+DOCS=( README )
+
+src_prepare() {
+ AT_M4DIR="m4" eautoreconf
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog
+ elog "You will need to install mail-filter/dspam or app-text/crm114"
+ elog "if you want to use the related backends in dovecot-antispam."
+ elog
+ fi
+}
diff --git a/mail-filter/dovecot-antispam/metadata.xml b/mail-filter/dovecot-antispam/metadata.xml
new file mode 100644
index 00000000000..157326a7e89
--- /dev/null
+++ b/mail-filter/dovecot-antispam/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>radhermit@gentoo.org</email>
+ <name>Tim Harder</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/mail-filter/dovecot_deleted_to_trash/Manifest b/mail-filter/dovecot_deleted_to_trash/Manifest
new file mode 100644
index 00000000000..626e99de6f5
--- /dev/null
+++ b/mail-filter/dovecot_deleted_to_trash/Manifest
@@ -0,0 +1 @@
+DIST dovecot_deleted_to_trash-0.6.tar.gz 4805 SHA256 68d128092a42ad1a0aecaf273a59aee22c9b23e9697203fd7e629ab327d638cb SHA512 41da1b622f30ee137ac8c06a687466a36c21035fd54b83393543c944b4e7cb4f3576556f220734d934033e6804d371eb5a1ec4f1d2491f3bf808782a59e2cb12 WHIRLPOOL 1c9e6e516b9f2c350a087aaf525c6e7f2d879fe240797a6f38b088a5c0bd4d8232592900a250b0e64486870a92d52c6badfabc2da5628d789923951108037b58
diff --git a/mail-filter/dovecot_deleted_to_trash/dovecot_deleted_to_trash-0.6.ebuild b/mail-filter/dovecot_deleted_to_trash/dovecot_deleted_to_trash-0.6.ebuild
new file mode 100644
index 00000000000..d9eb9b473eb
--- /dev/null
+++ b/mail-filter/dovecot_deleted_to_trash/dovecot_deleted_to_trash-0.6.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="Deleted to trash IMAP plugin for Dovecot"
+HOMEPAGE="https://github.com/lexbrugman/dovecot_deleted_to_trash"
+SRC_URI="https://github.com/lexbrugman/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="ZLIB"
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+
+RDEPEND="=net-mail/dovecot-2.2*
+ !!<net-mail/dovecot-2.2.0
+ !!<=mail-filter/dovecot_deleted_to_trash-0.3
+ "
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ tc-export CC
+ sed -i \
+ -e "/DOVECOT_IMAP_PLUGIN_PATH/s:lib/dovecot/modules:$(get_libdir)/dovecot:" \
+ -e "/PLUGIN_NAME/s/lib/lib99/" \
+ Makefile || die
+ epatch_user
+}
+
+src_install() {
+ default
+ insinto /etc/dovecot/conf.d
+ doins "${FILESDIR}"/29-delete-to-trash.conf
+}
diff --git a/mail-filter/dovecot_deleted_to_trash/files/29-delete-to-trash.conf b/mail-filter/dovecot_deleted_to_trash/files/29-delete-to-trash.conf
new file mode 100644
index 00000000000..65f9a31e7a0
--- /dev/null
+++ b/mail-filter/dovecot_deleted_to_trash/files/29-delete-to-trash.conf
@@ -0,0 +1,13 @@
+## Copyright 2012 A.Vinogradovs aka slepnoga
+## Wrote for Gentoo ebuild
+## Distributed under the terms of the GNU General Public License v2
+##
+## Delete to Trash plugin specific settings
+##
+
+# mail_plugins = $mail_plugins deleted_to_trash
+
+#plugin {
+# deleted_to_trash_folder = Trash
+#}
+
diff --git a/mail-filter/dovecot_deleted_to_trash/metadata.xml b/mail-filter/dovecot_deleted_to_trash/metadata.xml
new file mode 100644
index 00000000000..357afc8de0a
--- /dev/null
+++ b/mail-filter/dovecot_deleted_to_trash/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>andreis.vinogradovs@gmail.com</email>
+ <name>Andreis Vinogradovs</name>
+ </maintainer>
+ <maintainer>
+ <email>maksbotan@gentoo.org</email>
+ <name>Maxim Koltsov</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">lexbrugman/dovecot_deleted_to_trash</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/dspam/Manifest b/mail-filter/dspam/Manifest
new file mode 100644
index 00000000000..170c2991bb0
--- /dev/null
+++ b/mail-filter/dspam/Manifest
@@ -0,0 +1 @@
+DIST dspam-3.10.2.tar.gz 1035054 SHA256 ae76569604021f35b741fb95198a1e611a8c64c3838661973a6cf360bba593a9 SHA512 5fe53e1d0d7cabb3983f5c67274b074b7c647c1bae10ebc7ea3805542f99dbfb39abd4697e344e6eb80554522319a1253e1082ed6b389364bbaec1d6ddd43856 WHIRLPOOL 7195f295e786d0b327670ebcb292dc5d9fe98d94e48a5b4e3dd231aae88d55c19dfcf2c04df65bb969fdd8f1210ec125d6aa84d602623cb20964a170f95b880e
diff --git a/mail-filter/dspam/dspam-3.10.2-r1.ebuild b/mail-filter/dspam/dspam-3.10.2-r1.ebuild
new file mode 100644
index 00000000000..9bb6a703bba
--- /dev/null
+++ b/mail-filter/dspam/dspam-3.10.2-r1.ebuild
@@ -0,0 +1,222 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils user
+
+DESCRIPTION="A statistical-algorithmic hybrid anti-spam filter"
+HOMEPAGE="http://dspam.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~ppc x86"
+DRIVERS_IUSE="+hash mysql postgres sqlite"
+SCALES_IUSE="small-scale +domain-scale large-scale"
+IUSE="clamav daemon debug ldap static-libs syslog virtual-users user-homedirs ${DRIVERS_IUSE} ${SCALES_IUSE}"
+
+DEPEND="
+ net-mail/mailbase
+ ldap? ( net-nds/openldap )
+ mysql? ( >=virtual/mysql-5.0 )
+ postgres? ( dev-db/postgresql )
+ sqlite? ( dev-db/sqlite:3 )
+"
+RDEPEND="
+ ${DEPEND}
+ clamav? ( app-antivirus/clamav )
+ syslog? ( virtual/logger )
+"
+
+# Demands on sane USE flags:
+# - find out what driver to use: select at least one
+# - if static-libs is set, only one driver may be selected
+# - find out what scale to use: select exactly one
+# - user-homedirs does not work with virtual-users
+REQUIRED_USE="
+ || ( ${DRIVERS_IUSE//+} )
+ static-libs? ( ^^ ( ${DRIVERS_IUSE//+} ) )
+ ^^ ( ${SCALES_IUSE//+} )
+ virtual-users? ( !user-homedirs )
+"
+
+# dspam setup defaults
+DSPAM_HOME=/var/spool/dspam
+DSPAM_CONF=/etc/dspam
+DSPAM_LOG=/var/log/dspam
+DSPAM_MODE=2510
+DSPAM_DRIVERS=
+DSPAM_DRIVERS_EXTRAS=
+
+pkg_setup() {
+ # setup storage, this sets DSPAM_DRIVERS
+ dspam_setup_storage_drivers
+
+ # create dspam user and group
+ dspam_setup_user
+}
+
+src_configure() {
+ econf \
+ --sysconfdir=${DSPAM_CONF} \
+ --with-dspam-home=${DSPAM_HOME} \
+ --with-dspam-home-group=dspam \
+ --with-dspam-mode=${DSPAM_MODE} \
+ --with-dspam-group=dspam \
+ --with-logdir=${DSPAM_LOG} \
+ --enable-external-lookup \
+ --enable-long-usernames \
+ --enable-split-configuration \
+ $(use_enable clamav) \
+ $(use_enable daemon) \
+ $(use_enable debug) \
+ $(use_enable debug bnr-debug) \
+ $(use_enable debug verbose-debug) \
+ $(use_enable domain-scale) \
+ $(use_enable large-scale) \
+ $(use_enable static-libs static) \
+ $(use_enable syslog) \
+ $(use_enable user-homedirs homedir) \
+ $(use_enable virtual-users) \
+ --with-storage-driver=${DSPAM_DRIVERS} ${DSPAM_DRIVERS_EXTRAS} \
+ $(use mysql || use postgres && echo "--enable-preferences-extension") \
+ $(use syslog || echo "--with-logfile=${DSPAM_LOG}/dspam.log")
+}
+
+dspam_setup_user() {
+ # DSPAM CGI web gui (www-apps/dspam-web) needs to run as a regular user
+ # under suexec in apache, so DSPAM user/group need to be regular users too
+
+ local euid egid
+ for euid in {1000..5000} ; do
+ [ -z "$(egetent passwd ${euid})" ] && break
+ done
+ for egid in {1000..5000} ; do
+ [ -z "$(egetent group ${egid})" ] && break
+ done
+ enewgroup dspam ${egid}
+ enewuser dspam ${euid} -1 "${DSPAM_HOMEDIR}" dspam,mail
+}
+
+dspam_setup_storage_drivers() {
+ # Find out which storage drivers need to be enabled, and set some
+ # variables so that src_configure can pick them up
+
+ if use hash; then
+ DSPAM_DRIVERS+=",hash_drv"
+ fi
+
+ if use mysql; then
+ DSPAM_DRIVERS+=",mysql_drv"
+ DSPAM_DRIVERS_EXTRAS+="--with-mysql-includes=/usr/include/mysql "
+ fi
+
+ if use postgres; then
+ DSPAM_DRIVERS+=",pgsql_drv"
+ fi
+
+ if use sqlite; then
+ DSPAM_DRIVERS+=",sqlite3_drv"
+ fi
+
+ if ! use static-libs; then
+ # set the driver name twice to avoid a static build
+ DSPAM_DRIVERS+=${DSPAM_DRIVERS}
+ fi
+
+ # remove first comma separator
+ DSPAM_DRIVERS=${DSPAM_DRIVERS:1}
+ einfo "Building with drivers: ${DSPAM_DRIVERS}"
+ #echo DSPAM_DRIVERS_EXTRAS=$DSPAM_DRIVERS_EXTRAS
+}
+
+src_install() {
+ default
+
+ if use daemon; then
+ newinitd "${FILESDIR}/dspam.initd" dspam
+ newconfd "${FILESDIR}/dspam.confd" dspam
+ fi
+
+ if use mysql; then
+ insinto "/usr/share/${PN}/mysql"
+
+ local files="mysql_objects-4.1.sql mysql_objects-space.sql mysql_objects-speed.sql purge-4.1.sql purge.sql"
+ if use virtual-users; then
+ files+=" virtual_user_aliases.sql virtual_users.sql"
+ fi
+
+ for file in $files; do
+ doins src/tools.mysql_drv/${file}
+ done
+ fi
+
+ if use postgres; then
+ insinto "/usr/share/${PN}/pgsql"
+
+ local files="pgsql_objects.sql purge-pe.sql purge.sql"
+ if use virtual-users; then
+ files+=" virtual_users.sql"
+ fi
+
+ for file in $files; do
+ doins src/tools.pgsql_drv/${file}
+ done
+ fi
+
+ if use sqlite; then
+ insinto "/usr/share/${PN}/sqlite"
+ newins src/tools.sqlite_drv/purge-3.sql purge.sql
+ fi
+
+ insinto "${DSPAM_HOME}/txt"
+ doins txt/*.txt
+ for i in spam nonspam; do
+ echo "Scanned and tagged with DSPAM ${PV} on Gentoo Linux as ${i} by ISP" > "${T}/msgtag.${i}"
+ doins "${T}/msgtag.${i}"
+ done
+
+ newbin contrib/dspam_maintenance/dspam_maintenance.sh dspam_maintenance
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}/dspam.cron-r4" dspam
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/dspam.logrotate" dspam
+
+ dodoc CHANGELOG README* RELEASE.NOTES UPGRADING doc/*.txt
+
+ # stop logrotate-3.8 from complaining
+ dodir /var/log/dspam
+ fowners dspam:dspam /var/log/dspam
+ fperms 0750 /var/log/dspam
+
+ # Install dspamc setgid
+ fowners root:dspam /usr/bin/dspamc &&
+ fperms g+s /usr/bin/dspamc ||
+ die "failed to alter dspamc owner:group or mode"
+}
+
+pkg_preinst() {
+ # dspam-3.10.0: config dir change, should be removed at some later point
+ if [ -d "${ROOT}/etc/mail/dspam" ]; then
+ ewarn "The configuration directory of DSPAM has been relocated from /etc/mail/dspam to ${DSPAM_CONF}."
+ if [ -h "${ROOT}${DSPAM_CONF}" ]; then
+ # symlink, this is the setup in older ebuilds
+ ewarn "Moving contents of /etc/mail/dspam to ${DSPAM_CONF} ..."
+ rm "${ROOT}${DSPAM_CONF}" && mv "${ROOT}/etc/mail/dspam" "${DSPAM_CONF}"
+ eend $?
+
+ elif [ -d "${ROOT}${DSPAM_CONF}" ]; then
+ # directory and no symlink, do it manually since we cannot decide.
+ ewarn "You have both /etc/mail/dspam and ${DSPAM_CONF} directories, please delete the former."
+
+ else
+ # nothing interesting in /etc/dspam
+ ewarn "Moving contents of /etc/mail/dspam to ${DSPAM_CONF} ..."
+ mv "${ROOT}/etc/mail/dspam" "${DSPAM_CONF}"
+ eend $?
+ fi
+ fi
+}
diff --git a/mail-filter/dspam/files/dspam.confd b/mail-filter/dspam/files/dspam.confd
new file mode 100644
index 00000000000..75e0d4bda7d
--- /dev/null
+++ b/mail-filter/dspam/files/dspam.confd
@@ -0,0 +1,7 @@
+# Change this to the user:group you want to run the dspam daemon as.
+# If you need dspam to switch uids, this is root:root.
+# If you use virtual users and deliver via LMTP, this can be nonprivileged such as dspam:dspam.
+DAEMON_USER_GROUP="root:root"
+
+# Pid file
+PID_FILE="/var/run/dspam/dspam.pid"
diff --git a/mail-filter/dspam/files/dspam.cron-r4 b/mail-filter/dspam/files/dspam.cron-r4
new file mode 100644
index 00000000000..edf97dce541
--- /dev/null
+++ b/mail-filter/dspam/files/dspam.cron-r4
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# See dspam_maintenance --help for a list additional parameters
+
+/usr/bin/dspam_maintenance --verbose --purgescriptdir=/usr/share/dspam 1> /dev/null
diff --git a/mail-filter/dspam/files/dspam.initd b/mail-filter/dspam/files/dspam.initd
new file mode 100644
index 00000000000..4e8acf60ec8
--- /dev/null
+++ b/mail-filter/dspam/files/dspam.initd
@@ -0,0 +1,45 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_started_commands="reload"
+PIDFILE=${PID_FILE:-/var/run/dspam/dspam.pid}
+
+depend() {
+ use logger
+ before mta
+ after postgresql mysql ldap
+}
+
+checkconfig() {
+ local PIDDIR
+ PIDDIR=${PIDFILE%/*}
+ if [ ! -d "${PIDDIR:-/var/run/dspam}" ]; then
+ checkpath -q -d -o dspam:dspam -m 0755 "${PIDDIR}" || return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting dspam"
+ start-stop-daemon --start --quiet \
+ --user ${DAEMON_USER_GROUP} \
+ --pidfile ${PIDFILE} \
+ --exec /usr/bin/dspam -- --daemon
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping dspam"
+ start-stop-daemon --stop \
+ --pidfile ${PIDFILE} \
+ --exec /usr/bin/dspam
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading dspam"
+ start-stop-daemon --signal SIGHUP /usr/bin/dspam
+ eend $?
+}
diff --git a/mail-filter/dspam/files/dspam.logrotate b/mail-filter/dspam/files/dspam.logrotate
new file mode 100644
index 00000000000..f5e13067cfc
--- /dev/null
+++ b/mail-filter/dspam/files/dspam.logrotate
@@ -0,0 +1,10 @@
+/var/log/dspam/bnr.log
+/var/log/dspam/dspam.debug
+/var/log/dspam/dspam.log
+/var/log/dspam/dspam.messages
+/var/log/dspam/sql.errors {
+ weekly
+ compress
+ missingok
+ copytruncate
+}
diff --git a/mail-filter/dspam/metadata.xml b/mail-filter/dspam/metadata.xml
new file mode 100644
index 00000000000..a8b33acb205
--- /dev/null
+++ b/mail-filter/dspam/metadata.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <longdescription>A statistical-algorithmic hybrid anti-spam filter</longdescription>
+ <use>
+ <flag name="daemon">
+ Enable support for DSPAM to run in --daemon mode
+ </flag>
+ <flag name="debug">
+ Enable debugging support (don't enable this unless something needs testing!)
+ </flag>
+ <flag name="user-homedirs">
+ Build with user homedir support
+ </flag>
+ <flag name="virtual-users">
+ Build with virtual-users support
+ </flag>
+ <flag name="small-scale">
+ Build for small scale setups - puts data to $HOME/data/user
+ </flag>
+ <flag name="domain-scale">
+ Build for domain scale setups - puts data to $HOME/data/domain.com/user
+ </flag>
+ <flag name="large-scale">
+ Build for large scale setups - puts data to $HOME/data/u/s/user
+ </flag>
+ <flag name="hash">
+ Enable support for the file-orientated hash driver
+ </flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">dspam</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/exim-geoip/Manifest b/mail-filter/exim-geoip/Manifest
new file mode 100644
index 00000000000..e54de91d989
--- /dev/null
+++ b/mail-filter/exim-geoip/Manifest
@@ -0,0 +1 @@
+DIST exim-geoipv6-dlfunc-0.1.tar.gz 306380 SHA256 96129c051a835dd5247a5822a6c180c5928f6bb3342a2328bf346be6a3e82b42 SHA512 ab10cf8ccd89772c1b925115d45cbd429f9ad577b4b951b120162516f0702331b8f8cca780d4aa1714435a907deed52f50acb06e9be888136a1745834d73215e WHIRLPOOL 81ea9ad2a6b774120e44c64f55b98ba3caf537b25b6587bfc2329d6bb0aa45b062dd8379570529973dbd239055317f9f88c97cdb7436ae2645085d6c03273476
diff --git a/mail-filter/exim-geoip/exim-geoip-0.1.ebuild b/mail-filter/exim-geoip/exim-geoip-0.1.ebuild
new file mode 100644
index 00000000000..4155cb3ce74
--- /dev/null
+++ b/mail-filter/exim-geoip/exim-geoip-0.1.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils flag-o-matic
+
+DESCRIPTION="This is an IPv4 and IPv6 capable GeoIP dlfunc library for Exim"
+HOMEPAGE="http://dist.epipe.com/exim/"
+SRC_URI="http://dist.epipe.com/exim/exim-geoipv6-dlfunc-${PV}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="dev-libs/geoip
+ mail-mta/exim[dlfunc]"
+RDEPEND="${DEPEND}"
+S="${WORKDIR}/exim-geoipv6-dlfunc-${PV}"
+
+src_configure() {
+ append-cppflags "-I/usr/include/exim"
+ econf
+}
+
+src_install() {
+ default
+ prune_libtool_files --all
+}
diff --git a/mail-filter/exim-geoip/metadata.xml b/mail-filter/exim-geoip/metadata.xml
new file mode 100644
index 00000000000..dad318e43a0
--- /dev/null
+++ b/mail-filter/exim-geoip/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <maintainer>
+ <email>grobian@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">This is an IPv6 capable GeoIP dlfunc library for
+ Exim. It implements an interface between Exim access control lists and
+ MaxMind's GeoIP/GeoLite database. This can be useful for greylisting
+ or scoring IP addresses of SMTP senders according to the country code
+ of the sender's IP address.
+ </longdescription>
+</pkgmetadata>
diff --git a/mail-filter/exim-p0f/Manifest b/mail-filter/exim-p0f/Manifest
new file mode 100644
index 00000000000..65bddb9fb00
--- /dev/null
+++ b/mail-filter/exim-p0f/Manifest
@@ -0,0 +1 @@
+DIST exim-p0f3-dlfunc-0.1.tar.gz 307851 SHA256 9d22741ddd2452b7bf25488b86cd3ad55056aeeb82cf7e45cf38b0a13eef71be SHA512 9f913ba303bb42f6599ed044bb65954f993c2964d84ea0ff4e01e515c35ac7b58118fa6a304cba984499136438ad8f65bfe8c08e22c3be2d4c95f2950ab380b2 WHIRLPOOL 9801e8298c389871db0c9e83f6d800e1744529b15dbefc57260775022f4886741e93680b523d45fdbff29b3a173e6a88299d14c88918fc1fa48f681fb7112eb2
diff --git a/mail-filter/exim-p0f/exim-p0f-0.1.ebuild b/mail-filter/exim-p0f/exim-p0f-0.1.ebuild
new file mode 100644
index 00000000000..8e71af49472
--- /dev/null
+++ b/mail-filter/exim-p0f/exim-p0f-0.1.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils flag-o-matic
+
+DESCRIPTION="This is p0f version 3 dlfunc library for Exim"
+HOMEPAGE="http://dist.epipe.com/exim/"
+SRC_URI="http://dist.epipe.com/exim/exim-p0f3-dlfunc-${PV}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="mail-mta/exim[dlfunc]"
+RDEPEND=">=net-analyzer/p0f-3.05_beta
+ ${DEPEND}"
+S="${WORKDIR}/exim-p0f3-dlfunc-${PV}"
+
+src_configure() {
+ append-cppflags "-I/usr/include/exim"
+ econf
+}
+
+src_install() {
+ default
+ prune_libtool_files --all
+}
diff --git a/mail-filter/exim-p0f/metadata.xml b/mail-filter/exim-p0f/metadata.xml
new file mode 100644
index 00000000000..48bb76108d0
--- /dev/null
+++ b/mail-filter/exim-p0f/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <maintainer>
+ <email>grobian@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">This is p0f version 3 dlfunc library for Exim.
+ It implements an interface between Exim access control lists and the
+ p0f daemon which does passive OS fingerprinting. This can be useful
+ for greylisting or scoring IP addresses of SMTP senders according to
+ sender's operating system. This dlfunc supports IPv6.
+ </longdescription>
+</pkgmetadata>
diff --git a/mail-filter/gld/Manifest b/mail-filter/gld/Manifest
new file mode 100644
index 00000000000..1ce6037527c
--- /dev/null
+++ b/mail-filter/gld/Manifest
@@ -0,0 +1 @@
+DIST gld-1.7.tgz 40241 SHA256 c0776f6841afa73b6579e355522d79fd15467de2936f1a4464265e6415cae14b SHA512 68bbfd03295c2895608f8404ca1a0942c53003af66d70fda0e2515717ab8e6836f2b609942633b6d70a15b49338a887b5b1082ed1d9bc7c2c0aa3a7735abb13e WHIRLPOOL 815bbf2dc565695ca14eeee5821477e35c5d804c00f33c5e988462b3e6f8f3550c24f56cf6bc77ec9378d7a0cbdc1ba76cd47ae27a40e1cdcc2b3e6ffdd06785
diff --git a/mail-filter/gld/files/gld.rc b/mail-filter/gld/files/gld.rc
new file mode 100644
index 00000000000..91d92e4d189
--- /dev/null
+++ b/mail-filter/gld/files/gld.rc
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net # in case mysql daemon is not local
+ use dns mysql postgresql
+ before postfix
+ provide postfix_greylist
+}
+
+start() {
+ ebegin "Starting gld"
+ start-stop-daemon --start --quiet --exec /usr/bin/gld
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping gld"
+ start-stop-daemon --stop --quiet --name gld
+ eend $?
+}
diff --git a/mail-filter/gld/files/tables.sql b/mail-filter/gld/files/tables.sql
new file mode 100644
index 00000000000..245e9a059e3
--- /dev/null
+++ b/mail-filter/gld/files/tables.sql
@@ -0,0 +1,15 @@
+CREATE TABLE `greylist` (
+ `ip` CHAR( 39 ) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL COMMENT 'IP of Sending Host',
+ `sender` CHAR( 242 ) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Address of Sender',
+ `recipient` CHAR( 242 ) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Address of Recipient',
+ `first` INT( 11 ) NOT NULL DEFAULT '0' COMMENT 'Date, when this Sender has first been seen',
+ `last` INT( 11 ) NOT NULL DEFAULT '0' COMMENT 'Date, when this sender has last been seen',
+ `n` INT( 11 ) NOT NULL DEFAULT '0' COMMENT 'Sequence number',
+ PRIMARY KEY ( `ip` , `sender` , `recipient` )
+) ENGINE = MYISAM CHARACTER SET latin1 COLLATE latin1_general_ci COMMENT = 'GLD Greylist Table';
+
+CREATE TABLE `whitelist` (
+ `mail` CHAR( 242 ) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Adress which is whitelisted',
+ `comment` CHAR( 242 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'A comment, about why this adress is whitelisted',
+ PRIMARY KEY ( `mail` )
+) ENGINE = MYISAM CHARACTER SET latin1 COLLATE latin1_general_ci COMMENT = 'GLD Whitelist Table';
diff --git a/mail-filter/gld/gld-1.7-r2.ebuild b/mail-filter/gld/gld-1.7-r2.ebuild
new file mode 100644
index 00000000000..4041e32d2d1
--- /dev/null
+++ b/mail-filter/gld/gld-1.7-r2.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+DESCRIPTION="A standalone anti-spam greylisting algorithm on top of Postfix"
+HOMEPAGE="http://www.gasmi.net/gld.html"
+SRC_URI="http://www.gasmi.net/down/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="postgres"
+# Not adding a mysql USE flag. The package defaults to it, so we will too.
+DEPEND="sys-libs/zlib
+ >=dev-libs/openssl-0.9.6
+ postgres? ( dev-db/postgresql[server] )
+ !postgres? ( virtual/mysql )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ sed -i gld.conf \
+ -e 's:^LOOPBACKONLY=.*:LOOPBACKONLY=1:' \
+ -e 's:^#USER=.*:USER=nobody:' \
+ -e 's:^#GROUP=.*:GROUP=nobody:' \
+ || die "sed gld.conf failed"
+
+ sed -i Makefile.in \
+ -e '/ -c /{s|-O2|$(CFLAGS)|g}' \
+ -e '/ -o /{s|-O2|$(CFLAGS) $(LDFLAGS)|g}' \
+ -e '/strip/d' \
+ || die "sed Makefile.in failed"
+
+ sed -i tables.{my,pg}sql \
+ -e '/ip char/s/16/39/' \
+ || die "sed sql tables failed"
+}
+
+src_configure() {
+ tc-export CC
+ # It's kind of weird. $(use_with postgres pgsql) won't work if you don't
+ # use it...
+ if use postgres ; then
+ myconf="${myconf} --with-pgsql"
+ fi
+
+ econf ${myconf}
+}
+
+src_install() {
+ dobin gld
+
+ insinto /etc
+ newins gld.conf gld.conf.example
+
+ dodoc HISTORY README*
+
+ insinto /usr/share/${PN}/sql
+ doins *.pgsql *-whitelist.sql "${FILESDIR}"/tables.sql
+
+ newinitd "${FILESDIR}"/gld.rc gld
+}
+
+pkg_preinst() {
+ elog "Please read the README file in /usr/share/doc/${PF} for"
+ elog "details on how to setup gld."
+ elog
+ elog "The sql files have been installed to /usr/share/${PN}/sql."
+ if [[ $REPLACING_VERSIONS == "1.7-r1" ]]; then
+ elog "You might want to use the ALTER_TABLE command to change the"
+ elog "ip field width to 39 chars to accomodate ipv6 addresses."
+ elog "Please see your sql server documentation."
+ fi
+}
diff --git a/mail-filter/gld/metadata.xml b/mail-filter/gld/metadata.xml
new file mode 100644
index 00000000000..51f94e3fbe0
--- /dev/null
+++ b/mail-filter/gld/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-mail</herd>
+</pkgmetadata>
diff --git a/mail-filter/imapfilter/Manifest b/mail-filter/imapfilter/Manifest
new file mode 100644
index 00000000000..053aea1c6eb
--- /dev/null
+++ b/mail-filter/imapfilter/Manifest
@@ -0,0 +1,3 @@
+DIST imapfilter-2.5.4.tar.gz 52585 SHA256 e5a9ee0e57e16d02ff2cbb37b67202a514121d2eb7fc63863174644ca8248769 SHA512 33d8cc822a4ccd02ede6df7f30b5d2893088b352b9d1900df6597fd6443ae51ceb9ff22cd0100f9ec9e28dc84ac294bb717e0a85c4670677dfb09b5e5da76915 WHIRLPOOL 773e73fdae4b7b8f70f22d968f97d383eab444dcd8f39d417b2893408b94fc46be39fc4808e82d38c5e244ac21258a9faedeb0b564f07c9056e3c9f471146703
+DIST imapfilter-2.5.6.tar.gz 53579 SHA256 064d4da9b3b6458e3f9e061174ae4da07e57bdca6b7e1a9d6863cc6959eb2431 SHA512 98bca5cea00cdbbd0bcb3b98c381ae75ec43a3b6651a171cce47df38948d6d7f043f5bd6f42c8f9e30297db17f5d542bb0174dfbd46fc83d25cb5ea6e60d962c WHIRLPOOL 2c636d11f9533c7f8f46e64dc6626447760a49b3b7596deb6ebeb43d5caef5a948d1760d5d0ef8a5c40811cbf7da5f34aaa24c0975228022c8335cbb8bdfe1a3
+DIST imapfilter-2.5.7.tar.gz 54861 SHA256 c792d6a3a187cdc14fc38470837b45722a3750dabd2c6f71672806eeef79fad0 SHA512 9297e98812312fbf2c92aa5477bdfecb522048e45b4bc4922e312bd89a72b020a98f5547e3f0882ae665c24db21e6995eda839b762947adc48bc413ab0c882f1 WHIRLPOOL 514507840c9bc4d53823e5233704fb60815fc964bd938acd6bffe7457d786892ba259e84894a3e51e43a710346b55ab9cc4113bbfdf9b66a984438138b37faf0
diff --git a/mail-filter/imapfilter/imapfilter-2.5.4.ebuild b/mail-filter/imapfilter/imapfilter-2.5.4.ebuild
new file mode 100644
index 00000000000..e8f21e493bc
--- /dev/null
+++ b/mail-filter/imapfilter/imapfilter-2.5.4.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs
+
+DESCRIPTION="An IMAP mail filtering utility"
+HOMEPAGE="http://imapfilter.hellug.gr"
+SRC_URI="https://github.com/lefcha/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+
+RDEPEND="dev-libs/openssl
+ dev-libs/libpcre
+ >=dev-lang/lua-5.1"
+DEPEND="${RDEPEND}"
+
+DOCS="AUTHORS NEWS README samples/*"
+
+src_prepare() {
+ sed -i -e "/^PREFIX/s:/local::" \
+ -e "/^MANDIR/s:man:share/man:" \
+ -e "/^CFLAGS/s:CFLAGS =:CFLAGS +=:" \
+ -e "/^CFLAGS/s/-O//" \
+ src/Makefile || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ default
+ doman doc/imapfilter.1 doc/imapfilter_config.5
+}
diff --git a/mail-filter/imapfilter/imapfilter-2.5.6.ebuild b/mail-filter/imapfilter/imapfilter-2.5.6.ebuild
new file mode 100644
index 00000000000..a2886a4a9a3
--- /dev/null
+++ b/mail-filter/imapfilter/imapfilter-2.5.6.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs
+
+DESCRIPTION="An IMAP mail filtering utility"
+HOMEPAGE="http://imapfilter.hellug.gr"
+SRC_URI="https://github.com/lefcha/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+
+RDEPEND="dev-libs/openssl
+ dev-libs/libpcre
+ >=dev-lang/lua-5.1"
+DEPEND="${RDEPEND}"
+
+DOCS="AUTHORS NEWS README samples/*"
+
+src_prepare() {
+ sed -i -e "/^PREFIX/s:/local::" \
+ -e "/^MANDIR/s:man:share/man:" \
+ -e "/^CFLAGS/s:CFLAGS =:CFLAGS +=:" \
+ -e "/^CFLAGS/s/-O//" \
+ src/Makefile || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ default
+ doman doc/imapfilter.1 doc/imapfilter_config.5
+}
diff --git a/mail-filter/imapfilter/imapfilter-2.5.7.ebuild b/mail-filter/imapfilter/imapfilter-2.5.7.ebuild
new file mode 100644
index 00000000000..0fafc178a58
--- /dev/null
+++ b/mail-filter/imapfilter/imapfilter-2.5.7.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs
+
+DESCRIPTION="An IMAP mail filtering utility"
+HOMEPAGE="http://imapfilter.hellug.gr"
+SRC_URI="https://github.com/lefcha/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+
+RDEPEND="dev-libs/openssl
+ dev-libs/libpcre
+ >=dev-lang/lua-5.1"
+DEPEND="${RDEPEND}"
+
+DOCS="AUTHORS NEWS README samples/*"
+
+src_prepare() {
+ sed -i -e "/^PREFIX/s:/usr/local:${EPREFIX}/usr:" \
+ -e "/^MANDIR/s:man:share/man:" \
+ -e "/^CFLAGS/s:CFLAGS =:CFLAGS +=:" \
+ -e "/^CFLAGS/s/-O//" \
+ src/Makefile || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ default
+ doman doc/imapfilter.1 doc/imapfilter_config.5
+}
diff --git a/mail-filter/imapfilter/metadata.xml b/mail-filter/imapfilter/metadata.xml
new file mode 100644
index 00000000000..389142a3fce
--- /dev/null
+++ b/mail-filter/imapfilter/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <upstream>
+ <remote-id type="github">lefcha/imapfilter</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/isbg/Manifest b/mail-filter/isbg/Manifest
new file mode 100644
index 00000000000..d5d1ec1545a
--- /dev/null
+++ b/mail-filter/isbg/Manifest
@@ -0,0 +1 @@
+DIST isbg_0.99_20100303.tgz 7562 SHA256 cf47d36645e588132acb51459b767c9c31ea6d4322de341364034b4e669dcc42 SHA512 cea6bf34c07e34e3a640f680561f0a6aeb5dca7b82c745749f71adcdc4b117226b5a6b7b5f0208d51d4426477f13d93d984c6a4bdfd55baa9a80c8c82e31a15b WHIRLPOOL caee5a61260914495ca7730a9c7ff4fbe16e86389e89b14c76958a74a9adee4bcc45d55889ced2f59fbf619a204cdade6775f3f08ca0d1fa0f7af7224b7a3acd
diff --git a/mail-filter/isbg/isbg-0.99-r1.ebuild b/mail-filter/isbg/isbg-0.99-r1.ebuild
new file mode 100644
index 00000000000..ecce7ff1331
--- /dev/null
+++ b/mail-filter/isbg/isbg-0.99-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+PYTHON_DEPEND="2"
+
+inherit python
+
+MY_P="${P/-/_}_20100303"
+DESCRIPTION="IMAP Spam Begone: a script that makes it easy to scan an IMAP inbox for spam using SpamAssassin"
+HOMEPAGE="http://redmine.ookook.fr/projects/isbg"
+SRC_URI="http://github.com/downloads/ook/${PN}/${MY_P}.tgz"
+
+# upstream says:
+# You may use isbg under any OSI approved open source license
+# such as those listed at http://opensource.org/licenses/alphabetical
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}
+ mail-filter/spamassassin
+"
+
+pkg_setup() {
+ python_set_active_version 2
+}
+
+src_prepare() {
+ python_convert_shebangs 2 isbg.py
+}
+
+src_install() {
+ dobin isbg.py || die "script installation failed"
+ dodoc CHANGELOG CONTRIBUTORS README || die "doc installation failed"
+}
diff --git a/mail-filter/isbg/metadata.xml b/mail-filter/isbg/metadata.xml
new file mode 100644
index 00000000000..00aaecbcf35
--- /dev/null
+++ b/mail-filter/isbg/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>wired@gentoo.org</email>
+ <name>Alex Alexander</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">downloads/ook</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/libdkim/Manifest b/mail-filter/libdkim/Manifest
new file mode 100644
index 00000000000..282a030d2c2
--- /dev/null
+++ b/mail-filter/libdkim/Manifest
@@ -0,0 +1 @@
+DIST libdkim-1.0.21.zip 55049 SHA256 dc685c8c47384c5d0379a1bcc0c96c8b7877a01e0c3bfedd6a54ae4ebdfa0323 SHA512 3996c64398151dc9c07d357e8f3ac9b94e3c8d06ce5d83ebbe546416f361349d869b0b73216f28d0b732319731f31e61afd9eab0f540471760b944a90130a094 WHIRLPOOL bb95cb2e0cb02192996116a7bcc27221f275f6f8a88ecdbce6c6f70d6f15a4a23fee445706cbbf5d3ac6211d8d999c723aff5f1a673247f12929b285e23602f8
diff --git a/mail-filter/libdkim/files/debianize/Makefile.in b/mail-filter/libdkim/files/debianize/Makefile.in
new file mode 100644
index 00000000000..862f9b8478c
--- /dev/null
+++ b/mail-filter/libdkim/files/debianize/Makefile.in
@@ -0,0 +1,93 @@
+# libdkim makefile for UNIX
+#
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+libdir = @libdir@
+includedir = @includedir@
+
+OBJEXT = @OBJEXT@
+LIBS = @LIBS@ @libcrypto_LIBS@
+
+CC = @CC@
+CXX = @CXX@
+
+CFLAGS = @CFLAGS@
+CXXFLAGS = @CXXFLAGS@
+CPPFLAGS = @CPPFLAGS@
+
+INCL =
+LDFLAGS = @LDFLAGS@
+
+libdkim_SOURCES = dkim.cpp dns.cpp dkimbase.cpp dkimsign.cpp dkimverify.cpp
+HEADERS = dkim.h dns.h dkimbase.h dkimsign.h dkimverify.h
+
+libdkim_OBJS = $(libdkim_SOURCES:.cpp=.$(OBJEXT))
+libdkim_PURE_OBJS = $(libdkim_SOURCES:.cpp=.p$(OBJEXT))
+
+libdkimtest_SOURCES = libdkimtest.cpp
+libdkimtest_OBJS = libdkimtest.$(OBJEXT)
+
+SHLIBFORLINK = libdkim.so
+SHLIBSONAME = $(SHLIBFORLINK).$(SHLIBMAJOR)
+SHLIBTARGET = $(SHLIBFORLINK)
+SHLIBLINK = $(CXX) $(LDFLAGS) -shared -Wl,-soname=$(SHLIBSONAME) -Wl,-version-script=libdkim.ver
+SHLIBMAJOR = 1d
+SHLIBMINOR = 1
+SHLIBFILE = $(SHLIBSONAME).$(SHLIBMINOR)
+SHLIBCFLAGS = -fPIC
+
+ARFLAGS = crs
+
+TARGETS = libdkim.a $(SHLIBTARGET) libdkimtest
+
+all: $(TARGETS)
+
+libdkim.a: $(libdkim_OBJS)
+ -rm -f $@
+ $(AR) $(ARFLAGS) $@ $(libdkim_OBJS)
+
+$(SHLIBFORLINK): $(libdkim_PURE_OBJS)
+ $(SHLIBLINK) -o $@ $(libdkim_PURE_OBJS) $(LIBS)
+ -mkdir .lib 2>/dev/null
+ [ -z "$(SHLIBSONAME)" ] || (cd .lib \
+ && ln -sf ../$(SHLIBFORLINK) $(SHLIBSONAME))
+
+libdkimtest: $(libdkimtest_OBJS) $(SHLIBFORLINK)
+ $(CXX) ${LDFLAGS} -L. -o $@ libdkimtest.o -ldkim $(LIBS)
+
+libdkimtest.o: $(libdkimtest_SOURCES) $(HDRS)
+ $(CXX) $(CXXFLAGS) -o $@ -c $<
+
+%.$(OBJEXT): %.cpp $(HDRS)
+ $(CXX) $(CXXFLAGS) -o $@ -c $<
+
+%.p$(OBJEXT): %.cpp $(HDRS)
+ $(CXX) $(SHLIBCFLAGS) $(CXXFLAGS) -o $@ -c $<
+
+clean:
+ -rm -f *.$(OBJEXT) *.p$(OBJEXT) $(TARGETS)
+ -rm -rf .lib
+
+distclean: clean
+ -rm -f config.status config.log Makefile libdkim.pc
+
+install: all
+ install -m 755 -d $(DESTDIR)$(libdir)
+ install -m 755 -d $(DESTDIR)$(libdir)/pkgconfig
+ install -m 755 -d $(DESTDIR)$(includedir)
+ install -m 644 libdkim.a $(DESTDIR)$(libdir)
+ install -m 755 $(SHLIBFORLINK) $(DESTDIR)$(libdir)/$(SHLIBFILE)
+ [ -z "$(SHLIBSONAME)" ] \
+ || (cd $(DESTDIR)$(libdir) \
+ && ln -sf $(SHLIBFILE) $(SHLIBSONAME) \
+ && ln -sf $(SHLIBFILE) $(SHLIBFORLINK) )
+ install -m 644 $(srcdir)/dkim.h $(DESTDIR)$(includedir)
+ install -m 644 libdkim.pc $(DESTDIR)$(libdir)/pkgconfig
+ install -m 755 -d $(DESTDIR)$(bindir)
+ install -m 755 libdkimtest $(DESTDIR)$(bindir)
+
+.PHONY: all install clean distclean
diff --git a/mail-filter/libdkim/files/debianize/aclocal.m4 b/mail-filter/libdkim/files/debianize/aclocal.m4
new file mode 100644
index 00000000000..92a0b0dd943
--- /dev/null
+++ b/mail-filter/libdkim/files/debianize/aclocal.m4
@@ -0,0 +1,171 @@
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+#
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists. Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+#
+# Similar to PKG_CHECK_MODULES, make sure that the first instance of
+# this or PKG_CHECK_MODULES is called, or make sure to call
+# PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_ifval([$2], [$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$PKG_CONFIG"; then
+ if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ else
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+ [pkg_failed=yes])
+ fi
+else
+ pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT
+])],
+ [AC_MSG_RESULT([no])
+ $4])
+elif test $pkg_failed = untried; then
+ ifelse([$4], , [AC_MSG_FAILURE(dnl
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
+ [$4])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ ifelse([$3], , :, [$3])
+fi[]dnl
+])# PKG_CHECK_MODULES
+
diff --git a/mail-filter/libdkim/files/debianize/configure.ac b/mail-filter/libdkim/files/debianize/configure.ac
new file mode 100644
index 00000000000..045fd33fcb6
--- /dev/null
+++ b/mail-filter/libdkim/files/debianize/configure.ac
@@ -0,0 +1,39 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.61)
+AC_INIT(libdkim, 1.0.21)
+LT_INIT
+AC_CONFIG_SRCDIR([dkim.cpp])
+##AC_CONFIG_HEADER([config.h])
+
+# Checks for programs.
+AC_PROG_CXX
+PKG_PROG_PKG_CONFIG
+
+# Checks for libraries.
+#AC_CHECK_LIB([crypto], [PEM_read_PrivateKey])
+PKG_CHECK_MODULES([libcrypto], [libcrypto])
+AC_SEARCH_LIBS([res_query], [resolv c],,
+ [AC_SEARCH_LIBS(__res_query,resolv bind)])
+
+# Checks for header files.
+AC_HEADER_RESOLV
+AC_HEADER_STDC
+AC_CHECK_HEADERS([netdb.h netinet/in.h inttypes.h stdlib.h string.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_CONST
+AC_C_INLINE
+AC_HEADER_TIME
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+
+# Checks for library functions.
+AC_FUNC_MEMCMP
+AC_FUNC_SELECT_ARGTYPES
+AC_CHECK_FUNCS([select socket strchr])
+
+AC_CONFIG_FILES([Makefile libdkim.pc])
+AC_OUTPUT
diff --git a/mail-filter/libdkim/files/debianize/libdkim.pc.in b/mail-filter/libdkim/files/debianize/libdkim.pc.in
new file mode 100644
index 00000000000..d8d914ac439
--- /dev/null
+++ b/mail-filter/libdkim/files/debianize/libdkim.pc.in
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: @PACKAGE_NAME@
+Description: DomainKeys Identified Mail library from Alt-N Inc.
+Version: @PACKAGE_VERSION@
+Requires.private: libcrypto
+Libs: -L${libdir} -ldkim
+Libs.private: @LIBS@
+Cflags: -I${includedir}
diff --git a/mail-filter/libdkim/files/debianize/libdkim.ver b/mail-filter/libdkim/files/debianize/libdkim.ver
new file mode 100644
index 00000000000..d2049046aff
--- /dev/null
+++ b/mail-filter/libdkim/files/debianize/libdkim.ver
@@ -0,0 +1,4 @@
+{
+ global: DKIM*;
+ local: *;
+};
diff --git a/mail-filter/libdkim/files/libdkim-extra-options.patch b/mail-filter/libdkim/files/libdkim-extra-options.patch
new file mode 100644
index 00000000000..5c8a240fdbe
--- /dev/null
+++ b/mail-filter/libdkim/files/libdkim-extra-options.patch
@@ -0,0 +1,87 @@
+diff -Naur libdkim.orig/src/libdkimtest.cpp libdkim/src/libdkimtest.cpp
+--- libdkim.orig/src/libdkimtest.cpp 2009-03-13 16:17:45.000000000 -0500
++++ libdkim/src/libdkimtest.cpp 2009-03-13 16:26:02.000000000 -0500
+@@ -55,8 +55,23 @@
+ return 0;
+ }
+
++void usage()
++{
+
+-
++ printf( "usage: libdkimtest [-b<allman|ietf|both>] [-c<r|s|t|u>] [-d<domain>] [-l] [-h] [-i<you@yourdomain.com>] [-q] [-s] [-t] [-v] [-x<expire time>] [-z<hash>] <msgfile> <privkeyfile> <outfile>\n");
++ printf( "-b<standard> allman , ietf or both\n");
++ printf( "-c<canonicalization> r for relaxed [DEFAULT], s - simple, t relaxed/simple, u - simple/relaxed\n");
++ printf( "-d<domain> the domain tag, if not provided it will be determined from the sender/from header\n");
++ printf( "-l include body length tag\n");
++ printf( "-h this help\n");
++ printf( "-i<identity> the identity, if not provided it will not be included\n");
++ printf( "-s sign the message\n");
++ printf( "-t include a timestamp tag\n");
++ printf( "-v verify the message\n");
++ printf( "-x<expire_time> the expire time in seconds since epoch ( DEFAULT = current time + 604800)\n\t if set to - then it will not be included");
++ printf( "-z<hash> 1 for sha1, 2 for sha256, 3 for both\n");
++ printf( "-y<selector> the selector tag DEFAULT=MDaemon\n");
++}
+ int main(int argc, char* argv[])
+ {
+ int n;
+@@ -77,7 +92,7 @@
+ time(&t);
+
+ opts.nCanon = DKIM_SIGN_RELAXED;
+- opts.nIncludeBodyLengthTag = 1;
++ opts.nIncludeBodyLengthTag = 0;
+ opts.nIncludeQueryMethod = 0;
+ opts.nIncludeTimeStamp = 0;
+ opts.expireTime = t + 604800; // expires in 1 week
+@@ -92,6 +107,11 @@
+ int nArgParseState = 0;
+ bool bSign = true;
+
++ if(argc<2){
++ usage();
++ exit(1);
++ }
++
+ for( n = 1; n < argc; n++ )
+ {
+ if( argv[n][0] == '-' && strlen(argv[n]) > 1 )
+@@ -121,14 +141,16 @@
+ }
+ break;
+
+-
++ case 'd':
++ strncpy(opts.szDomain,(const char*)(argv[n]+2),sizeof(opts.szDomain)-1);
++ break;
+ case 'l': // body length tag
+ opts.nIncludeBodyLengthTag = 1;
+ break;
+
+
+ case 'h':
+- printf( "usage: \n" );
++ usage();
+ return 0;
+
+ case 'i': // identity
+@@ -138,7 +160,7 @@
+ }
+ else
+ {
+- strcpy( opts.szIdentity, argv[n] + 2 );
++ strncpy( opts.szIdentity, argv[n] + 2,sizeof(opts.szIdentity)-1 );
+ }
+ break;
+
+@@ -169,6 +191,9 @@
+ }
+ break;
+
++ case 'y':
++ strncpy( opts.szSelector, argv[n]+2, sizeof(opts.szSelector)-1);
++ break;
+
+ case 'z': // sign w/ sha1, sha256 or both
+ opts.nHash = atoi( &argv[n][2] );
diff --git a/mail-filter/libdkim/files/patches/fix_warnings.patch b/mail-filter/libdkim/files/patches/fix_warnings.patch
new file mode 100644
index 00000000000..56ed6ffc8a1
--- /dev/null
+++ b/mail-filter/libdkim/files/patches/fix_warnings.patch
@@ -0,0 +1,293 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 02_fix_warnings.dpatch by Russell Coker <russell@coker.com.au>
+##
+## DP: Get rid of warnings through the use of const and more correct types
+
+@DPATCH@
+
+diff -ru libdkim-1.0.19.orig/src/dkim.cpp libdkim-1.0.19/src/dkim.cpp
+--- libdkim-1.0.19.orig/src/dkim.cpp 2008-05-12 20:07:32.000000000 +1000
++++ libdkim-1.0.19/src/dkim.cpp 2009-04-15 19:38:08.000000000 +1000
+@@ -172,7 +172,7 @@
+ }
+
+
+-int DKIM_CALL DKIMVerifyProcess( DKIMContext* pVerifyContext, char* szBuffer, int nBufLength )
++int DKIM_CALL DKIMVerifyProcess( DKIMContext* pVerifyContext, const char* const szBuffer, int nBufLength )
+ {
+ CDKIMVerify* pVerify = (CDKIMVerify*)ValidateContext( pVerifyContext, false );
+
+@@ -226,13 +226,13 @@
+ }
+
+
+-char* DKIM_CALL DKIMVersion()
++const char* DKIM_CALL DKIMVersion()
+ {
+ return VERSION_STRING;
+ }
+
+
+-static char* DKIMErrorStrings[-1-DKIM_MAX_ERROR] = {
++static const char* DKIMErrorStrings[-1-DKIM_MAX_ERROR] = {
+ "DKIM_FAIL",
+ "DKIM_BAD_SYNTAX",
+ "DKIM_SIGNATURE_BAD",
+@@ -254,7 +254,7 @@
+ };
+
+
+-char* DKIM_CALL DKIMGetErrorString( int ErrorCode )
++const char* DKIM_CALL DKIMGetErrorString( int ErrorCode )
+ {
+ if (ErrorCode >= 0 || ErrorCode <= DKIM_MAX_ERROR)
+ return "Unknown";
+diff -ru libdkim-1.0.19.orig/src/dkim.h libdkim-1.0.19/src/dkim.h
+--- libdkim-1.0.19.orig/src/dkim.h 2009-04-15 19:37:48.000000000 +1000
++++ libdkim-1.0.19/src/dkim.h 2009-04-15 19:38:08.000000000 +1000
+@@ -155,14 +155,14 @@
+ void DKIM_CALL DKIMSignFree( DKIMContext* pSignContext );
+
+ int DKIM_CALL DKIMVerifyInit( DKIMContext* pVerifyContext, DKIMVerifyOptions* pOptions );
+-int DKIM_CALL DKIMVerifyProcess( DKIMContext* pVerifyContext, char* szBuffer, int nBufLength );
++int DKIM_CALL DKIMVerifyProcess( DKIMContext* pVerifyContext, const char* szBuffer, int nBufLength );
+ int DKIM_CALL DKIMVerifyResults( DKIMContext* pVerifyContext );
+ int DKIM_CALL DKIMVerifyGetDetails( DKIMContext* pVerifyContext, int* nSigCount, DKIMVerifyDetails** pDetails, char* szPractices );
+ void DKIM_CALL DKIMVerifyFree( DKIMContext* pVerifyContext );
+
+-char *DKIM_CALL DKIMVersion();
++const char *DKIM_CALL DKIMVersion();
+
+-char *DKIM_CALL DKIMGetErrorString( int ErrorCode );
++const char *DKIM_CALL DKIMGetErrorString( int ErrorCode );
+
+ #ifdef __cplusplus
+ }
+diff -ru libdkim-1.0.19.orig/src/dkimbase.cpp libdkim-1.0.19/src/dkimbase.cpp
+--- libdkim-1.0.19.orig/src/dkimbase.cpp 2008-05-12 20:07:36.000000000 +1000
++++ libdkim-1.0.19/src/dkimbase.cpp 2009-04-15 19:49:32.000000000 +1000
+@@ -118,10 +118,10 @@
+ // Process - split buffers into lines without any CRs or LFs at the end.
+ //
+ ////////////////////////////////////////////////////////////////////////////////
+-int CDKIMBase::Process( char* szBuffer, int nBufLength, bool bEOF )
++int CDKIMBase::Process( const char* szBuffer, int nBufLength, bool bEOF )
+ {
+- char* p = szBuffer;
+- char* e = szBuffer + nBufLength;
++ const char* p = szBuffer;
++ const char* e = szBuffer + nBufLength;
+
+ while( p < e )
+ {
+@@ -208,7 +208,8 @@
+ {
+ m_InHeaders = false;
+ ProcessHeaders();
+- ProcessBody("", 0, true);
++ /* type conversion should be safe as length is zero */
++ ProcessBody((char *)"", 0, true);
+ }
+
+ return DKIM_SUCCESS;
+@@ -338,9 +339,9 @@
+
+ CompressSWSP(sTemp);
+
+- unsigned cpos = sTemp.find(':');
++ string::size_type cpos = sTemp.find(':');
+
+- if (cpos == -1)
++ if (cpos == string::npos)
+ {
+ // no colon?!
+ }
+diff -ru libdkim-1.0.19.orig/src/dkimbase.h libdkim-1.0.19/src/dkimbase.h
+--- libdkim-1.0.19.orig/src/dkimbase.h 2008-05-12 20:07:24.000000000 +1000
++++ libdkim-1.0.19/src/dkimbase.h 2009-04-15 19:49:32.000000000 +1000
+@@ -41,7 +41,7 @@
+
+ int Init(void);
+
+- int Process( char* szBuffer, int nBufLength, bool bEOF );
++ int Process( const char* szBuffer, int nBufLength, bool bEOF );
+ int ProcessFinal(void);
+
+ int Alloc( char*& szBuffer, int nRequiredSize );
+diff -ru libdkim-1.0.19.orig/src/dkimsign.cpp libdkim-1.0.19/src/dkimsign.cpp
+--- libdkim-1.0.19.orig/src/dkimsign.cpp 2008-05-12 20:07:46.000000000 +1000
++++ libdkim-1.0.19/src/dkimsign.cpp 2009-04-15 19:49:32.000000000 +1000
+@@ -144,7 +144,7 @@
+
+ fwrite( szBuffer, 1, nBufLength, fpdebug );
+
+- /** END DEBUG CODE **/
++ ** END DEBUG CODE **/
+
+ if( bAllmanOnly )
+ {
+@@ -555,7 +555,7 @@
+ // if bFold, fold at cbrk char
+ //
+ ////////////////////////////////////////////////////////////////////////////////
+-void CDKIMSign::AddTagToSig( char* Tag, const string &sValue, char cbrk, bool bFold )
++void CDKIMSign::AddTagToSig( const char* const Tag, const string &sValue, char cbrk, bool bFold )
+ {
+ int nTagLen = strlen(Tag);
+
+@@ -583,10 +583,10 @@
+ // AddTagToSig - add tag and numeric value to signature folding if necessary
+ //
+ ////////////////////////////////////////////////////////////////////////////////
+-void CDKIMSign::AddTagToSig( char* Tag, unsigned long nValue )
++void CDKIMSign::AddTagToSig( const char* const Tag, unsigned long nValue )
+ {
+ char szValue[64];
+- sprintf( szValue, "%u", nValue );
++ sprintf( szValue, "%lu", nValue );
+ AddTagToSig( Tag, szValue, 0, false );
+ }
+
+@@ -686,7 +686,7 @@
+ // GetSig - compute hash and return signature header in szSignature
+ //
+ ////////////////////////////////////////////////////////////////////////////////
+-int CDKIMSign::GetSig( char* szPrivKey, char* szSignature, int nSigLength )
++int CDKIMSign::GetSig( char* szPrivKey, char* szSignature, unsigned nSigLength )
+ {
+ if( szPrivKey == NULL )
+ {
+@@ -794,7 +794,6 @@
+ int size;
+ int len;
+ char* buf;
+- int pos = 0;
+
+ // construct the DKIM-Signature: header and add to hash
+ InitSig();
+@@ -879,7 +878,7 @@
+ }
+ BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
+ BIO_push(b64, bio);
+- if (BIO_write(b64, Hash, nHashLen) < nHashLen)
++ if (BIO_write(b64, Hash, nHashLen) < (int)nHashLen)
+ {
+ BIO_free_all(b64);
+ return DKIM_OUT_OF_MEMORY;
+@@ -993,7 +992,7 @@
+ }
+ BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
+ BIO_push(b64, bio);
+- if (BIO_write(b64, sig, siglen) < siglen)
++ if (BIO_write(b64, sig, siglen) < (int)siglen)
+ {
+ OPENSSL_free(sig);
+ BIO_free_all(b64);
+diff -ru libdkim-1.0.19.orig/src/dkimsign.h libdkim-1.0.19/src/dkimsign.h
+--- libdkim-1.0.19.orig/src/dkimsign.h 2008-05-12 20:07:58.000000000 +1000
++++ libdkim-1.0.19/src/dkimsign.h 2009-04-15 19:49:32.000000000 +1000
+@@ -32,7 +32,7 @@
+
+ int Init( DKIMSignOptions* pOptions );
+
+- int GetSig( char* szPrivKey, char* szSignature, int nSigLength );
++ int GetSig( char* szPrivKey, char* szSignature, unsigned nSigLength );
+ int GetSig2( char* szPrivKey, char** pszSignature );
+
+ virtual int ProcessHeaders(void);
+@@ -50,8 +50,8 @@
+ bool ParseFromAddress( void );
+
+ void InitSig(void);
+- void AddTagToSig( char* Tag, const string &sValue, char cbrk, bool bFold );
+- void AddTagToSig( char* Tag, unsigned long nValue );
++ void AddTagToSig( const char* const Tag, const string &sValue, char cbrk, bool bFold );
++ void AddTagToSig( const char* const Tag, unsigned long nValue );
+ void AddInterTagSpace( int nSizeOfNextTag );
+ void AddFoldedValueToSig( const string &sValue, char cbrk );
+
+diff -ru libdkim-1.0.19.orig/src/dkimverify.cpp libdkim-1.0.19/src/dkimverify.cpp
+--- libdkim-1.0.19.orig/src/dkimverify.cpp 2009-04-15 19:37:48.000000000 +1000
++++ libdkim-1.0.19/src/dkimverify.cpp 2009-04-15 19:49:32.000000000 +1000
+@@ -440,7 +440,7 @@
+ {
+ ProcessFinal();
+
+- int SuccessCount=0;
++ unsigned int SuccessCount=0;
+ int TestingFailures=0;
+ int RealFailures=0;
+
+@@ -646,7 +646,7 @@
+ /** END DEBUG CODE **/
+ #endif
+
+- if (IsBody && BodyLength != -1)
++ if (IsBody && BodyLength != (unsigned)-1)
+ {
+ VerifiedBodyCount += nBufLength;
+ if (VerifiedBodyCount > BodyLength)
+@@ -1019,7 +1019,7 @@
+ // body count
+ if (values[8] == NULL || !m_HonorBodyLengthTag)
+ {
+- sig.BodyLength = -1;
++ sig.BodyLength = (unsigned)-1;
+ }
+ else
+ {
+@@ -1057,17 +1057,17 @@
+ // expiration time
+ if (values[11] == NULL)
+ {
+- sig.ExpireTime = -1;
++ sig.ExpireTime = (unsigned)-1;
+ }
+ else
+ {
+ if (!ParseUnsigned(values[11], &sig.ExpireTime))
+ return DKIM_BAD_SYNTAX;
+
+- if (sig.ExpireTime != -1)
++ if (sig.ExpireTime != (unsigned)-1)
+ {
+ // the value of x= MUST be greater than the value of t= if both are present
+- if (SignedTime != -1 && sig.ExpireTime <= SignedTime)
++ if (SignedTime != (unsigned)-1 && sig.ExpireTime <= SignedTime)
+ return DKIM_BAD_SYNTAX;
+
+ // todo: if possible, use the received date/time instead of the current time
+@@ -1169,7 +1169,7 @@
+ }
+
+
+-SelectorInfo::SelectorInfo(const string &sSelector, const string &sDomain) : Selector(sSelector), Domain(sDomain)
++SelectorInfo::SelectorInfo(const string &sSelector, const string &sDomain) : Domain(sDomain), Selector(sSelector)
+ {
+ AllowSHA1 = true;
+ AllowSHA256 = true;
+@@ -1207,7 +1207,7 @@
+ return DKIM_SELECTOR_INVALID; // todo: maybe create a new error code for unsupported selector version
+
+ // make sure v= is the first tag in the response // todo: maybe don't enforce this, it seems unnecessary
+- for (int j=1; j<sizeof(values)/sizeof(values[0]); j++)
++ for (unsigned j=1; j<sizeof(values)/sizeof(values[0]); j++)
+ {
+ if (values[j] != NULL && values[j] < values[0])
+ {
+diff -ru libdkim-1.0.19.orig/src/libdkimtest.cpp libdkim-1.0.19/src/libdkimtest.cpp
+--- libdkim-1.0.19.orig/src/libdkimtest.cpp 2008-05-12 20:08:54.000000000 +1000
++++ libdkim-1.0.19/src/libdkimtest.cpp 2009-04-15 19:38:08.000000000 +1000
+@@ -60,9 +60,9 @@
+ int main(int argc, char* argv[])
+ {
+ int n;
+- char* PrivKeyFile = "test.pem";
+- char* MsgFile = "test.msg";
+- char* OutFile = "signed.msg";
++ const char* PrivKeyFile = "test.pem";
++ const char* MsgFile = "test.msg";
++ const char* OutFile = "signed.msg";
+ int nPrivKeyLen;
+ char PrivKey[2048];
+ char Buffer[1024];
diff --git a/mail-filter/libdkim/files/patches/series b/mail-filter/libdkim/files/patches/series
new file mode 100644
index 00000000000..57acbdb1e7d
--- /dev/null
+++ b/mail-filter/libdkim/files/patches/series
@@ -0,0 +1,2 @@
+strtok_r.patch
+fix_warnings.patch
diff --git a/mail-filter/libdkim/files/patches/strtok_r.patch b/mail-filter/libdkim/files/patches/strtok_r.patch
new file mode 100644
index 00000000000..b3b4999aaf5
--- /dev/null
+++ b/mail-filter/libdkim/files/patches/strtok_r.patch
@@ -0,0 +1,119 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_strtok_r.dpatch by Russell Coker <russell@coker.com.au>
+##
+## DP: Use strtok_r() instead of strtok().
+
+@DPATCH@
+
+diff -ru libdkim-1.0.19/src/dkimverify.cpp libdkim-1.0.19-new/src/dkimverify.cpp
+--- libdkim-1.0.19/src/dkimverify.cpp 2008-05-12 20:08:06.000000000 +1000
++++ libdkim-1.0.19-new/src/dkimverify.cpp 2009-06-11 18:28:10.000000000 +1000
+@@ -855,6 +855,9 @@
+ ////////////////////////////////////////////////////////////////////////////////
+ int CDKIMVerify::ParseDKIMSignature( const string& sHeader, SignatureInfo &sig )
+ {
++ // for strtok_r()
++ char *saveptr;
++
+ // save header for later
+ sig.Header = sHeader;
+
+@@ -1032,7 +1035,7 @@
+ {
+ // make sure "dns" is in the list
+ bool HasDNS = false;
+- char *s = strtok(values[9], ":");
++ char *s = strtok_r(values[9], ":", &saveptr);
+ while (s != NULL)
+ {
+ if (strncmp(s, "dns", 3) == 0 && (s[3] == '\0' || s[3] == '/'))
+@@ -1040,7 +1043,7 @@
+ HasDNS = true;
+ break;
+ }
+- s = strtok(NULL, ": \t");
++ s = strtok_r(NULL, ": \t", &saveptr);
+ }
+ if (!HasDNS)
+ return DKIM_BAD_SYNTAX; // todo: maybe create a new error code for unknown query method
+@@ -1080,7 +1083,7 @@
+ // parse the signed headers list
+ bool HasFrom = false, HasSubject = false;
+ RemoveSWSP(values[4]); // header names shouldn't have spaces in them so this should be ok...
+- char *s = strtok(values[4], ":");
++ char *s = strtok_r(values[4], ":", &saveptr);
+ while (s != NULL)
+ {
+ if (_stricmp(s, "From") == 0)
+@@ -1090,7 +1093,7 @@
+
+ sig.SignedHeaders.push_back(s);
+
+- s = strtok(NULL, ":");
++ s = strtok_r(NULL, ":", &saveptr);
+ }
+
+ if (!HasFrom)
+@@ -1194,6 +1197,9 @@
+ ////////////////////////////////////////////////////////////////////////////////
+ int SelectorInfo::Parse( char* Buffer )
+ {
++ // for strtok_r()
++ char *saveptr;
++
+ static const char *tags[] = {"v","g","h","k","p","s","t","n",NULL};
+ char *values[sizeof(tags)/sizeof(tags[0])] = {NULL};
+
+@@ -1235,14 +1241,14 @@
+ else
+ {
+ // MUST include "sha1" or "sha256"
+- char *s = strtok(values[2], ":");
++ char *s = strtok_r(values[2], ":", &saveptr);
+ while (s != NULL)
+ {
+ if (strcmp(s, "sha1") == 0)
+ AllowSHA1 = true;
+ else if (strcmp(s, "sha256") == 0)
+ AllowSHA256 = true;
+- s = strtok(NULL, ":");
++ s = strtok_r(NULL, ":", &saveptr);
+ }
+ if ( !(AllowSHA1 || AllowSHA256) )
+ return DKIM_SELECTOR_INVALID; // todo: maybe create a new error code for unsupported hash algorithm
+@@ -1261,7 +1267,7 @@
+ {
+ // make sure "*" or "email" is in the list
+ bool ServiceTypeMatch = false;
+- char *s = strtok(values[5], ":");
++ char *s = strtok_r(values[5], ":", &saveptr);
+ while (s != NULL)
+ {
+ if (strcmp(s, "*") == 0 || strcmp(s, "email") == 0)
+@@ -1269,7 +1275,7 @@
+ ServiceTypeMatch = true;
+ break;
+ }
+- s = strtok(NULL, ":");
++ s = strtok_r(NULL, ":", &saveptr);
+ }
+ if (!ServiceTypeMatch)
+ return DKIM_SELECTOR_INVALID;
+@@ -1278,7 +1284,7 @@
+ // flags
+ if (values[6] != NULL)
+ {
+- char *s = strtok(values[6], ":");
++ char *s = strtok_r(values[6], ":", &saveptr);
+ while (s != NULL)
+ {
+ if (strcmp(s, "y") == 0)
+@@ -1289,7 +1295,7 @@
+ {
+ SameDomain = true;
+ }
+- s = strtok(NULL, ":");
++ s = strtok_r(NULL, ":", &saveptr);
+ }
+ }
+
diff --git a/mail-filter/libdkim/libdkim-1.0.21-r1.ebuild b/mail-filter/libdkim/libdkim-1.0.21-r1.ebuild
new file mode 100644
index 00000000000..eac4e656248
--- /dev/null
+++ b/mail-filter/libdkim/libdkim-1.0.21-r1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AUTOTOOLS_AUTORECONF=1
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+inherit eutils autotools-utils
+
+DESCRIPTION="DomainKeys Identified Mail library from Alt-N Inc"
+HOMEPAGE="http://libdkim.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.zip"
+
+LICENSE="Apache-2.0 yahoo-patent-license-1.2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="dev-libs/openssl
+ app-arch/unzip"
+RDEPEND="!mail-filter/libdkim-exim
+ dev-libs/openssl"
+
+S="${WORKDIR}/${PN}/src"
+
+src_prepare() {
+ ecvs_clean
+ cp "${FILESDIR}"/debianize/* "${S}"
+ epatch "${FILESDIR}"/patches/*.patch
+ epatch "${FILESDIR}"/libdkim-extra-options.patch
+ autotools-utils_src_prepare
+
+}
+
+src_install() {
+ autotools-utils_src_install
+ dodoc ../README
+}
diff --git a/mail-filter/libdkim/libdkim-1.0.21-r2.ebuild b/mail-filter/libdkim/libdkim-1.0.21-r2.ebuild
new file mode 100644
index 00000000000..9d0c2f37eee
--- /dev/null
+++ b/mail-filter/libdkim/libdkim-1.0.21-r2.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+inherit autotools-utils eutils toolchain-funcs
+
+DESCRIPTION="DomainKeys Identified Mail library from Alt-N Inc"
+HOMEPAGE="http://libdkim.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.zip"
+
+LICENSE="Apache-2.0 yahoo-patent-license-1.2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="static-libs"
+
+DEPEND="dev-libs/openssl
+ app-arch/unzip"
+RDEPEND="!mail-filter/libdkim-exim
+ dev-libs/openssl"
+
+S="${WORKDIR}/${PN}/src"
+
+src_prepare() {
+ ecvs_clean
+ cp "${FILESDIR}"/debianize/* "${S}"
+ epatch "${FILESDIR}"/patches/*.patch
+ epatch "${FILESDIR}"/libdkim-extra-options.patch
+
+ # Bug 476772
+ if ! use static-libs; then
+ sed -i \
+ -e '/^TARGETS/s/libdkim.a//' \
+ -e '/install -m 644 libdkim.a/d' \
+ Makefile.in || die 'sed on Makefile.in failed'
+ fi
+
+ # Bug 476770
+ tc-export AR
+
+ autotools-utils_src_prepare
+}
+
+src_install() {
+ autotools-utils_src_install
+ dodoc ../README
+}
diff --git a/mail-filter/libdkim/metadata.xml b/mail-filter/libdkim/metadata.xml
new file mode 100644
index 00000000000..514b6de10ce
--- /dev/null
+++ b/mail-filter/libdkim/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>andreis.vinogradovs@gmail.com</email>
+ <name>Andreis Vinogradovs</name>
+ </maintainer>
+ <maintainer>
+ <email>qnikst@gentoo.org</email>
+ <name>Alexander Vershilov</name>
+ </maintainer>
+ <longdescription>DomainKeys Identified Mail library from Alt-N Inc.</longdescription>
+ <use>
+</use>
+ <upstream>
+ <remote-id type="sourceforge">libdkim</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/libmilter/Manifest b/mail-filter/libmilter/Manifest
new file mode 100644
index 00000000000..51477a73368
--- /dev/null
+++ b/mail-filter/libmilter/Manifest
@@ -0,0 +1 @@
+DIST sendmail.8.14.5.tar.gz 2092508 SHA256 fb65a86a0f87f12aefb933ee8990540f7a680a594f7fedfdd28918f3934bfb88 SHA512 178addd247f1c7c8ca90d70b9240db4cad4e55f0710d5df0fe979e5473a182d2035150c352836576a28bb2b9660b0d5ebfcd95269a156ac0d2c3dba3edb60452 WHIRLPOOL 2e073759a44d535629d9cce91da4a7082e085defeb9491a4470a8a8c8b18e1545129527c0138a74edb405a9c9724e5a597ee99c7852a423696c495ad8fef783f
diff --git a/mail-filter/libmilter/files/gentoo.config.m4 b/mail-filter/libmilter/files/gentoo.config.m4
new file mode 100644
index 00000000000..5e1b55faa58
--- /dev/null
+++ b/mail-filter/libmilter/files/gentoo.config.m4
@@ -0,0 +1,5 @@
+define(`confOPTIMIZE', `@@CFLAGS@@')
+define(`confLDOPTS', `@@LDFLAGS@@')
+define(`confCC', `@@CC@@')
+define(`confENVDEF', `@@ENVDEF@@')
+define(`confCCOPTS_SO', `-fPIC')
diff --git a/mail-filter/libmilter/files/libmilter-build-system.patch b/mail-filter/libmilter/files/libmilter-build-system.patch
new file mode 100644
index 00000000000..d9991d3d409
--- /dev/null
+++ b/mail-filter/libmilter/files/libmilter-build-system.patch
@@ -0,0 +1,89 @@
+diff -Nru sendmail-8.14.3.orig/devtools/M4/UNIX/defines.m4 sendmail-8.14.3/devtools/M4/UNIX/defines.m4
+--- sendmail-8.14.3.orig/devtools/M4/UNIX/defines.m4 2006-10-06 07:44:44.000000000 +0200
++++ sendmail-8.14.3/devtools/M4/UNIX/defines.m4 2009-09-20 10:16:43.000000000 +0200
+@@ -26,7 +26,7 @@
+ CCLINK = ifdef(`confCCLINK', `confCCLINK', `confCC')
+ # Linker for libraries
+ LD= ifdef(`confLD', `confLD', `confCC')
+-LDOPTS= ifdef(`confLDOPTS', `confLDOPTS') ifdef(`confMT', ifdef(`confMTLDOPTS', `confMTLDOPTS', `'), `')
++LDOPTS= ifdef(`confLDOPTS', `confLDOPTS')
+ LDOPTS_SO= ${LDOPTS} ifdef(`confLDOPTS_SO', `confLDOPTS_SO', `-shared')
+
+ # Shell
+@@ -71,7 +71,7 @@
+ LIBADD= ifdef(`conf_'bldCURRENT_PRD`_LIBS', `conf_'bldCURRENT_PRD`_LIBS')
+
+ # libraries required on your system
+-LIBS= ${LIBADD} ifdef(`confLIBS', `confLIBS') ifdef(`conf_'bldCURRENT_PRD`_LIB_POST', `conf_'bldCURRENT_PRD`_LIB_POST')
++LIBS= ${LIBADD} ifdef(`confLIBS', `confLIBS') ifdef(`conf_'bldCURRENT_PRD`_LIB_POST', `conf_'bldCURRENT_PRD`_LIB_POST') ifdef(`confMT', ifdef(`confMTLDOPTS', `confMTLDOPTS', `'), `')
+
+ # location of sendmail binary (usually /usr/sbin or /usr/lib)
+ BINDIR= ifdef(`confMBINDIR', `confMBINDIR', `/usr/sbin')
+diff -Nru sendmail-8.14.3.orig/devtools/M4/UNIX/executable.m4 sendmail-8.14.3/devtools/M4/UNIX/executable.m4
+--- sendmail-8.14.3.orig/devtools/M4/UNIX/executable.m4 2006-10-06 07:44:44.000000000 +0200
++++ sendmail-8.14.3/devtools/M4/UNIX/executable.m4 2009-09-20 10:16:43.000000000 +0200
+@@ -30,12 +30,12 @@
+
+ ifdef(`bldNO_INSTALL', ,
+ `install-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT ifdef(`bldTARGET_INST_DEP', `bldTARGET_INST_DEP')
+- ifdef(`confMKDIR', `if [ ! -d ${DESTDIR}${bldINSTALL_DIR`'BINDIR} ]; then confMKDIR -p ${DESTDIR}${bldINSTALL_DIR`'BINDIR}; else :; fi ')
+- ${INSTALL} -c -o ${bldBIN_TYPE`'BINOWN} -g ${bldBIN_TYPE`'BINGRP} -m ${bldBIN_TYPE`'BINMODE} bldCURRENT_PRODUCT ${DESTDIR}${bldINSTALL_DIR`'BINDIR}
++ ifdef(`confMKDIR', `if [ ! -d "${DESTDIR}${bldINSTALL_DIR`'BINDIR}" ]; then confMKDIR -p "${DESTDIR}${bldINSTALL_DIR`'BINDIR}"; else :; fi ')
++ ${INSTALL} -c -o ${bldBIN_TYPE`'BINOWN} -g ${bldBIN_TYPE`'BINGRP} -m ${bldBIN_TYPE`'BINMODE} bldCURRENT_PRODUCT "${DESTDIR}${bldINSTALL_DIR`'BINDIR}"
+ ifdef(`bldTARGET_LINKS', `bldMAKE_TARGET_LINKS(${bldINSTALL_DIR`'BINDIR}/bldCURRENT_PRODUCT, ${bldCURRENT_PRODUCT`'TARGET_LINKS})')')
+
+ strip-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT
+- ${STRIP} ${STRIPOPTS} ${DESTDIR}${bldINSTALL_DIR`'BINDIR}`'/bldCURRENT_PRODUCT
++ ${STRIP} ${STRIPOPTS} "${DESTDIR}${bldINSTALL_DIR`'BINDIR}`'/bldCURRENT_PRODUCT"
+
+ bldCURRENT_PRODUCT-clean:
+ rm -f ${OBJS} bldCURRENT_PRODUCT ${MANPAGES}
+diff -Nru sendmail-8.14.3.orig/devtools/M4/UNIX/library.m4 sendmail-8.14.3/devtools/M4/UNIX/library.m4
+--- sendmail-8.14.3.orig/devtools/M4/UNIX/library.m4 2006-09-06 00:56:53.000000000 +0200
++++ sendmail-8.14.3/devtools/M4/UNIX/library.m4 2009-09-20 10:16:43.000000000 +0200
+@@ -27,8 +27,8 @@
+ ifdef(`bldLINK_SOURCES', `bldMAKE_SOURCE_LINKS(bldLINK_SOURCES)')
+
+ install-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT.a
+-ifdef(`bldINSTALLABLE', ` ifdef(`confMKDIR', `if [ ! -d ${DESTDIR}${bldINSTALL_DIR`'LIBDIR} ]; then confMKDIR -p ${DESTDIR}${bldINSTALL_DIR`'LIBDIR}; else :; fi ')
+- ${INSTALL} -c -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} bldCURRENT_PRODUCT.a ${DESTDIR}${LIBDIR}')
++ifdef(`bldINSTALLABLE', ` ifdef(`confMKDIR', `if [ ! -d "${DESTDIR}${LIBDIR}" ]; then confMKDIR -p "${DESTDIR}${LIBDIR}"; else :; fi ')
++ ${INSTALL} -c -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} bldCURRENT_PRODUCT.a "${DESTDIR}${LIBDIR}"')
+
+ bldCURRENT_PRODUCT-clean:
+ rm -f ${OBJS} bldCURRENT_PRODUCT.a ${MANPAGES}
+diff -Nru sendmail-8.14.3.orig/devtools/M4/UNIX/manpage.m4 sendmail-8.14.3/devtools/M4/UNIX/manpage.m4
+--- sendmail-8.14.3.orig/devtools/M4/UNIX/manpage.m4 2006-09-08 00:13:07.000000000 +0200
++++ sendmail-8.14.3/devtools/M4/UNIX/manpage.m4 2009-09-20 10:16:43.000000000 +0200
+@@ -68,11 +68,11 @@
+ ifdef(`confNO_MAN_INSTALL', `divert(-1)', `dnl')
+ define(`bldMAN_INSTALL_CMD',
+ `ifdef(`confDONT_INSTALL_CATMAN', `dnl',
+-` ifdef(`confMKDIR', `if [ ! -d ${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`SRC} ]; then confMKDIR -p ${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`SRC}; else :; fi ')
+- ${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} bldGET_MAN_BASE_NAME($1).`${MAN'bldGET_MAN_SOURCE_NUM($1)`SRC}' `${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)}/bldGET_MAN_BASE_NAME($1)`.${MAN'bldGET_MAN_SOURCE_NUM($1)`EXT}'')
++` ifdef(`confMKDIR', `if [ ! -d "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)}" ]; then confMKDIR -p "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)}"; else :; fi ')
++ ${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} bldGET_MAN_BASE_NAME($1).`${MAN'bldGET_MAN_SOURCE_NUM($1)`SRC}' "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)}/bldGET_MAN_BASE_NAME($1)`.${MAN'bldGET_MAN_SOURCE_NUM($1)`EXT}''")
+ ifdef(`confINSTALL_RAWMAN',
+-` ifdef(`confMKDIR', `if [ ! -d ${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN} ]; then confMKDIR -p ${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN}; else :; fi ')
+- ${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} bldGET_MAN_BASE_NAME($1).bldGET_MAN_SOURCE_NUM($1) `${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN}'/bldGET_MAN_BASE_NAME($1)`.${MAN'bldGET_MAN_SOURCE_NUM($1)`EXT}'', `dnl')'
++` ifdef(`confMKDIR', `if [ ! -d "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN}'" ]; then confMKDIR -p "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN}'"; else :; fi ')
++ ${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} bldGET_MAN_BASE_NAME($1).bldGET_MAN_SOURCE_NUM($1) "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN}'/bldGET_MAN_BASE_NAME($1)`.${MAN'bldGET_MAN_SOURCE_NUM($1)`EXT}''", `dnl')'
+ )dnl
+ bldFOREACH(`bldMAN_INSTALL_CMD(', `bldMAN_PAGES')
+ ifdef(`confNO_MAN_INSTALL', `divert(0)', `dnl')
+diff -Nru sendmail-8.14.3.orig/libmilter/Makefile.m4 sendmail-8.14.3/libmilter/Makefile.m4
+--- sendmail-8.14.3.orig/libmilter/Makefile.m4 2009-09-20 09:53:44.000000000 +0200
++++ sendmail-8.14.3/libmilter/Makefile.m4 2009-09-20 10:18:35.000000000 +0200
+@@ -32,9 +32,9 @@
+ MFAPI= ${SRCDIR}/inc`'lude/libmilter/mfapi.h
+ MFDEF= ${SRCDIR}/inc`'lude/libmilter/mfdef.h
+ install-mfapi: ${MFAPI}
+- if [ ! -d ${DESTDIR}${INCLUDEDIR}/libmilter ]; then mkdir -p ${DESTDIR}${INCLUDEDIR}/libmilter; else :; fi
+- ${INSTALL} -c -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} ${MFAPI} ${DESTDIR}${INCLUDEDIR}/libmilter/mfapi.h
+- ${INSTALL} -c -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} ${MFDEF} ${DESTDIR}${INCLUDEDIR}/libmilter/mfdef.h
++ if [ ! -d "${DESTDIR}${INCLUDEDIR}/libmilter" ]; then mkdir -p "${DESTDIR}${INCLUDEDIR}/libmilter"; else :; fi
++ ${INSTALL} -c -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} ${MFAPI} "${DESTDIR}${INCLUDEDIR}/libmilter/mfapi.h"
++ ${INSTALL} -c -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} ${MFDEF} "${DESTDIR}${INCLUDEDIR}/libmilter/mfdef.h"
+ divert(0)
+
+ bldFINISH
diff --git a/mail-filter/libmilter/files/libmilter-sharedlib.patch b/mail-filter/libmilter/files/libmilter-sharedlib.patch
new file mode 100644
index 00000000000..43ec7861219
--- /dev/null
+++ b/mail-filter/libmilter/files/libmilter-sharedlib.patch
@@ -0,0 +1,55 @@
+diff -Nru sendmail-8.14.3.orig/devtools/M4/UNIX/milterlibrary.m4 sendmail-8.14.3/devtools/M4/UNIX/milterlibrary.m4
+--- sendmail-8.14.3.orig/devtools/M4/UNIX/milterlibrary.m4 1970-01-01 01:00:00.000000000 +0100
++++ sendmail-8.14.3/devtools/M4/UNIX/milterlibrary.m4 2009-08-22 21:51:10.000000000 +0200
+@@ -0,0 +1,39 @@
++divert(-1)
++#
++# Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.
++# All rights reserved.
++#
++# By using this file, you agree to the terms and conditions set
++# forth in the LICENSE file which can be found at the top level of
++# the sendmail distribution.
++#
++#
++# Definitions for Makefile construction for sendmail
++#
++divert(0)dnl
++include(confBUILDTOOLSDIR`/M4/'bldM4_TYPE_DIR`/links.m4')dnl
++bldLIST_PUSH_ITEM(`bldC_PRODUCTS', bldCURRENT_PRODUCT)dnl
++bldPUSH_TARGET(bldCURRENT_PRODUCT`.so' bldCURRENT_PRODUCT`.a')dnl
++bldPUSH_INSTALL_TARGET(`install-'bldCURRENT_PRODUCT)dnl
++bldPUSH_CLEAN_TARGET(bldCURRENT_PRODUCT`-clean')dnl
++
++include(confBUILDTOOLSDIR`/M4/'bldM4_TYPE_DIR`/defines.m4')
++divert(bldTARGETS_SECTION)
++bldCURRENT_PRODUCT.so: ${BEFORE} ${bldCURRENT_PRODUCT`OBJS'}
++ ${CCLINK} ${LDOPTS_SO} -o bldCURRENT_PRODUCT.so -Wl,confSONAME,bldCURRENT_PRODUCT.so.${MILTER_SOVER} ${bldCURRENT_PRODUCT`OBJS'} -lc ${LIBS}
++bldCURRENT_PRODUCT.a: ${BEFORE} ${bldCURRENT_PRODUCT`OBJS'}
++ ${AR} ${AROPTS} bldCURRENT_PRODUCT.a ${bldCURRENT_PRODUCT`OBJS'}
++ ${RANLIB} ${RANLIBOPTS} bldCURRENT_PRODUCT.a
++ifdef(`bldLINK_SOURCES', `bldMAKE_SOURCE_LINKS(bldLINK_SOURCES)')
++
++install-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT.so bldCURRENT_PRODUCT.a
++ifdef(`bldINSTALLABLE', ` ifdef(`confMKDIR', `if [ ! -d "${DESTDIR}${bldINSTALL_DIR`'LIBDIR}" ]; then confMKDIR -p "${DESTDIR}${bldINSTALL_DIR`'LIBDIR}"; else :; fi ')
++ ${INSTALL} -c -o ${LIBOWN} -g ${LIBGRP} -m ${UBINMODE} bldCURRENT_PRODUCT.so "${DESTDIR}${LIBDIR}/bldCURRENT_PRODUCT.so.${MILTER_SOVER}"
++ ${LN} ${LNOPTS} bldCURRENT_PRODUCT.so.${MILTER_SOVER} "${DESTDIR}${LIBDIR}/bldCURRENT_PRODUCT.so"
++ ${INSTALL} -c -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} bldCURRENT_PRODUCT.a "${DESTDIR}${LIBDIR}"')
++
++bldCURRENT_PRODUCT-clean:
++ rm -f ${OBJS} bldCURRENT_PRODUCT.so bldCURRENT_PRODUCT.a ${MANPAGES}
++
++divert(0)
++COPTS+= confCCOPTS_SO
+diff -Nru sendmail-8.14.3.orig/libmilter/Makefile.m4 sendmail-8.14.3/libmilter/Makefile.m4
+--- sendmail-8.14.3.orig/libmilter/Makefile.m4 2008-04-08 07:23:44.000000000 +0200
++++ sendmail-8.14.3/libmilter/Makefile.m4 2009-08-22 21:53:35.000000000 +0200
+@@ -9,7 +9,7 @@
+ SMSRCDIR=ifdef(`confSMSRCDIR', `confSMSRCDIR', `${SRCDIR}/sendmail')
+ PREPENDDEF(`confINCDIRS', `-I${SMSRCDIR} ')
+
+-bldPRODUCT_START(`library', `libmilter')
++bldPRODUCT_START(`milterlibrary', `libmilter')
+ define(`bldINSTALLABLE', `true')
+ define(`LIBMILTER_EXTRAS', `errstring.c strl.c')
+ APPENDDEF(`confENVDEF', `-DNOT_SENDMAIL -Dsm_snprintf=snprintf')
diff --git a/mail-filter/libmilter/libmilter-1.0.2.ebuild b/mail-filter/libmilter/libmilter-1.0.2.ebuild
new file mode 100644
index 00000000000..2fd2c1753af
--- /dev/null
+++ b/mail-filter/libmilter/libmilter-1.0.2.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils multilib toolchain-funcs
+
+# This library is part of sendmail, but it does not share the version number with it.
+# In order to find the right libmilter version number, check SMFI_VERSION definition
+# that can be found in ${S}/include/libmilter/mfapi.h (see also SM_LM_VRS_* defines).
+# For example, version 1.0.1 has a SMFI_VERSION of 0x01000001.
+SENDMAIL_VER=8.14.5
+
+DESCRIPTION="The Sendmail Filter API (Milter)"
+HOMEPAGE="http://www.sendmail.org/"
+SRC_URI="ftp://ftp.sendmail.org/pub/sendmail/sendmail.${SENDMAIL_VER}.tar.gz"
+
+LICENSE="Sendmail"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc x86 ~x86-fbsd"
+IUSE="ipv6 poll"
+
+DEPEND="!mail-mta/sendmail
+ !mail-mta/sendmail"
+RDEPEND="!mail-mta/sendmail"
+
+S="${WORKDIR}/sendmail-${SENDMAIL_VER}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-build-system.patch
+ epatch "${FILESDIR}"/${PN}-sharedlib.patch
+
+ local CC="$(tc-getCC)"
+ local ENVDEF="-DNETUNIX -DNETINET"
+ use ipv6 && ENVDEF="${ENVDEF} -DNETINET6"
+ use poll && ENVDEF="${ENVDEF} -DSM_CONF_POLL=1"
+
+ sed -e "s:@@CFLAGS@@:${CFLAGS}:" \
+ -e "s:@@LDFLAGS@@:${LDFLAGS}:" \
+ -e "s:@@CC@@:${CC}:" \
+ -e "s:@@ENVDEF@@:${ENVDEF}:" \
+ "${FILESDIR}/gentoo.config.m4" > "${S}/devtools/Site/site.config.m4" \
+ || die "failed to generate site.config.m4"
+}
+
+src_compile() {
+ pushd libmilter
+ emake -j1 MILTER_SOVER=${PV} || die "libmilter compilation failed"
+ popd
+}
+
+src_install () {
+ local MY_LIBDIR=/usr/$(get_libdir)
+ dodir "${MY_LIBDIR}"
+ emake DESTDIR="${D}" LIBDIR="${MY_LIBDIR}" MANROOT=/usr/share/man/man \
+ SBINOWN=root SBINGRP=0 UBINOWN=root UBINGRP=0 \
+ LIBOWN=root LIBGRP=0 GBINOWN=root GBINGRP=0 \
+ MANOWN=root MANGRP=0 INCOWN=root INCGRP=0 \
+ MSPQOWN=root CFOWN=root CFGRP=0 \
+ MILTER_SOVER=${PV} \
+ install -C obj.*/libmilter \
+ || die "install failed"
+
+ dodoc libmilter/README
+ dohtml libmilter/docs/*
+}
diff --git a/mail-filter/libmilter/metadata.xml b/mail-filter/libmilter/metadata.xml
new file mode 100644
index 00000000000..a1e561b3b2d
--- /dev/null
+++ b/mail-filter/libmilter/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-mail</herd>
+<longdescription>The Sendmail filter API (Milter)</longdescription>
+<use>
+ <flag name='poll'>Use poll instead of select</flag>
+</use>
+</pkgmetadata>
diff --git a/mail-filter/libsieve/Manifest b/mail-filter/libsieve/Manifest
new file mode 100644
index 00000000000..201df342cfe
--- /dev/null
+++ b/mail-filter/libsieve/Manifest
@@ -0,0 +1 @@
+DIST libsieve-2.2.7.tar.gz 569646 SHA256 41645ad28d25388925f352858ea23a17ff2a25897b98c72e864d8cde899a6723
diff --git a/mail-filter/libsieve/libsieve-2.2.7.ebuild b/mail-filter/libsieve/libsieve-2.2.7.ebuild
new file mode 100644
index 00000000000..09b98a3e3c4
--- /dev/null
+++ b/mail-filter/libsieve/libsieve-2.2.7.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="A library for parsing, sorting and filtering your mail"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+HOMEPAGE="http://libsieve.sourceforge.net/"
+
+SLOT="0"
+LICENSE="MIT LGPL-2"
+KEYWORDS="~alpha amd64 ~ppc ~sparc x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="!<net-mail/mailutils-2.1"
+
+src_compile() {
+ cd "${S}"/src
+ econf || die "econf failed"
+ emake || die "emake failed"
+}
+
+src_install () {
+ cd "${S}"/src
+ emake DESTDIR="${D}" install || die "emake install failed"
+}
diff --git a/mail-filter/libsieve/metadata.xml b/mail-filter/libsieve/metadata.xml
new file mode 100644
index 00000000000..5b379a1483c
--- /dev/null
+++ b/mail-filter/libsieve/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">
+libSieve provides a library to interpret Sieve scripts, and to execute those
+scripts over a given set of messages. The return codes from the libSieve
+functions let your program know how to handle the message, and then it's up to
+you to make it so.
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">libsieve</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/libspf2/Manifest b/mail-filter/libspf2/Manifest
new file mode 100644
index 00000000000..7f425ee09ce
--- /dev/null
+++ b/mail-filter/libspf2/Manifest
@@ -0,0 +1,2 @@
+DIST libspf2-1.2.10.tar.gz 508842 SHA256 d91e3de81ae287a2976c44f60283bd3000d720e6a112dc7142eedf1831b821c9 SHA512 162ce382628c6fcadac3e11f5a12442db622bb23f7ec503e16f5ba7fc88afdd777bce6b093c12a58210355985fd11b74b140f08fab347334d82d953dd183b130 WHIRLPOOL 0bc14a6c3e6ddf431cc98ed4b9dbd4e2ca381f6e408c8ea57d9a74d55a6079731d42644f6e60a3138996a9728137721cfb438463b36c18e89c7c381f9ed18e69
+DIST libspf2-1.2.9.tar.gz 518001 SHA256 4837f6b063b1431673754cbf6bef8979de5ffc4d7f26f6b93abd42787ba04862 SHA512 3137571f438704c176c5251e7b93fd0a8b6b04e52ad37218685b42b1fc5da6286baee578da1a14291d185216bd2a909cca3e55d64ffe580e71be059d1043a248 WHIRLPOOL 6579abf5080c319030ed7200d21b7bdfd3d4cf8207b4f3e6132be485024959bc06536fadf9d8c6898911ffa19977f738ec6a65d268d64d8aea06f89e94278e5e
diff --git a/mail-filter/libspf2/files/libspf2-1.2.9-ipv6.patch b/mail-filter/libspf2/files/libspf2-1.2.9-ipv6.patch
new file mode 100644
index 00000000000..76e8cd37c27
--- /dev/null
+++ b/mail-filter/libspf2/files/libspf2-1.2.9-ipv6.patch
@@ -0,0 +1,61 @@
+$NetBSD: patch-aa,v 1.1 2009/09/08 10:36:27 tron Exp $
+
+Fix an abort() caused by miscalculating the size of an internal buffer.
+This can crash applications using "libspf2" (e.g. "milter-greylist")
+in an e-mail gets delivered via SMTP over IPv6 depending on the
+remote machine's IPv6 address.
+
+--- src/libspf2/spf_expand.c.orig 2008-11-03 21:29:00.000000000 +0000
++++ src/libspf2/spf_expand.c 2009-09-08 11:27:52.000000000 +0100
+@@ -245,7 +245,7 @@
+ case PARM_CLIENT_IP: /* SMTP client IP */
+ #ifdef COMPUTE
+ if (compute_length) {
+- len = sizeof(ip6_buf);
++ len = sizeof(ip6_rbuf);
+ if (d->dv.url_encode)
+ len *= 3;
+ buflen += len;
+
+http://www.gossamer-threads.com/lists/spf/devel/35098
+
+--- src/libspf2/spf_compile.c 2008-11-03 15:37:33.000000000 -0500
++++ src/libspf2/spf_compile.c 2009-09-07 23:46:02.000000000 -0400
+@@ -778,7 +778,7 @@
+ const char *end;
+ const char *p;
+
+- char buf[ INET_ADDRSTRLEN ];
++ char buf[ INET6_ADDRSTRLEN ];
+ size_t len;
+ int err;
+
+--- src/libspf2/spf_interpret.c 2008-10-22 11:47:43.000000000 -0400
++++ src/libspf2/spf_interpret.c 2009-09-08 00:42:25.000000000 -0400
+@@ -505,7 +505,7 @@
+ char dst_ip6_buf[ INET6_ADDRSTRLEN ];
+
+ struct in6_addr src_ipv6;
+- int cidr, mask;
++ int cidr, cidr_save, mask;
+ int i;
+ int match;
+
+@@ -517,6 +517,7 @@
+ cidr = SPF_i_mech_cidr(spf_request, mech);
+ if ( cidr == 0 )
+ cidr = 128;
++ cidr_save = cidr;
+
+ match = TRUE;
+ for( i = 0; i < array_elem( ipv6.s6_addr ) && match; i++ )
+@@ -538,7 +539,7 @@
+ INET_NTOP(AF_INET6, &ipv6.s6_addr,
+ dst_ip6_buf, sizeof(dst_ip6_buf));
+ SPF_debugf( "ip_match: %s == %s (/%d): %d",
+- src_ip6_buf, dst_ip6_buf, cidr, match );
++ src_ip6_buf, dst_ip6_buf, cidr_save, match );
+ }
+
+ return match;
+
diff --git a/mail-filter/libspf2/libspf2-1.2.10.ebuild b/mail-filter/libspf2/libspf2-1.2.10.ebuild
new file mode 100644
index 00000000000..36f940e9bb6
--- /dev/null
+++ b/mail-filter/libspf2/libspf2-1.2.10.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools
+
+DESCRIPTION="libspf2 implements the Sender Policy Framework, a part of the SPF/SRS protocol pair"
+HOMEPAGE="http://www.libspf2.org"
+SRC_URI="http://www.libspf2.org/spf/libspf2-${PV}.tar.gz"
+
+LICENSE="|| ( LGPL-2.1 BSD-2 )"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ia64 ppc ~ppc64 sparc x86 ~x86-fbsd"
+IUSE="static static-libs"
+
+DEPEND=""
+RDEPEND="!dev-perl/Mail-SPF-Query"
+REQUIRED_USE="static? ( static-libs )"
+
+src_prepare() {
+ if ! use static; then
+ sed -i -e '/bin_PROGRAMS/s/spfquery_static//' src/spfquery/Makefile.am \
+ -e '/bin_PROGRAMS/s/spftest_static//' src/spftest/Makefile.am \
+ -e '/bin_PROGRAMS/s/spfd_static//' src/spfd/Makefile.am \
+ -e '/bin_PROGRAMS/s/spf_example_static//' src/spf_example/Makefile.am \
+ || die
+ #eautoreconf
+ fi
+
+ sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.ac || die
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README TODO INSTALL
+
+ use static-libs || rm -f "${D}"/usr/lib*/libspf2.la
+}
diff --git a/mail-filter/libspf2/libspf2-1.2.9-r3.ebuild b/mail-filter/libspf2/libspf2-1.2.9-r3.ebuild
new file mode 100644
index 00000000000..03a72f617c3
--- /dev/null
+++ b/mail-filter/libspf2/libspf2-1.2.9-r3.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils autotools
+
+DESCRIPTION="libspf2 implements the Sender Policy Framework, a part of the SPF/SRS protocol pair"
+HOMEPAGE="http://www.libspf2.org"
+SRC_URI="http://www.libspf2.org/spf/libspf2-${PV}.tar.gz"
+
+LICENSE="|| ( LGPL-2.1 BSD-2 )"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd"
+IUSE="static static-libs"
+
+DEPEND=""
+RDEPEND="!dev-perl/Mail-SPF-Query"
+REQUIRED_USE="static? ( static-libs )"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-ipv6.patch"
+ if ! use static; then
+ sed -i -e '/bin_PROGRAMS/s/spfquery_static//' src/spfquery/Makefile.am \
+ -e '/bin_PROGRAMS/s/spftest_static//' src/spftest/Makefile.am \
+ -e '/bin_PROGRAMS/s/spfd_static//' src/spfd/Makefile.am \
+ -e '/bin_PROGRAMS/s/spf_example_static//' src/spf_example/Makefile.am \
+ || die
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README TODO INSTALL
+
+ use static-libs || rm -f "${D}"/usr/lib*/libspf2.la
+}
diff --git a/mail-filter/libspf2/metadata.xml b/mail-filter/libspf2/metadata.xml
new file mode 100644
index 00000000000..b511e7fe1c4
--- /dev/null
+++ b/mail-filter/libspf2/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-mail</herd>
+<longdescription>libspf2 implements the Sender Policy Framework, a part of the SPF/SRS protocol pair. libspf2 is a library which allows email systems such as Sendmail, Postfix, Exim, Zmailer and MS Exchange to check SPF records and make sure that the email is authorized by the domain name that it is coming from. This prevents email forgery, commonly used by spammers, scammers and email viruses/worms.</longdescription>
+</pkgmetadata>
diff --git a/mail-filter/libsrs2/Manifest b/mail-filter/libsrs2/Manifest
new file mode 100644
index 00000000000..3500ec00457
--- /dev/null
+++ b/mail-filter/libsrs2/Manifest
@@ -0,0 +1 @@
+DIST libsrs2-1.0.18.tar.gz 295748 SHA256 9d1191b705d7587a5886736899001d04168392bbb6ed6345a057ade50943a492 SHA512 b9c189caa227487e90566f65430345f09a3d545fc286a3eb0c445aee3a74905c1a9248ce78b36a7cfb6a2936f6cd1efbe99ba7b8df49a613a81c6435396f5422 WHIRLPOOL 8f6854365f21940a35f23c5c252183eadd248bec22ef16cb003a55fca333efa89fbaac28353dc3ec52b3abdbb65f6bd43890f6e8d60f86b7eadc9452cabdbc3c
diff --git a/mail-filter/libsrs2/files/libsrs2-1.0.18-parallel-make.diff b/mail-filter/libsrs2/files/libsrs2-1.0.18-parallel-make.diff
new file mode 100644
index 00000000000..a5ce4d5a002
--- /dev/null
+++ b/mail-filter/libsrs2/files/libsrs2-1.0.18-parallel-make.diff
@@ -0,0 +1,13 @@
+diff -Naur libsrs2-1.0.18/libsrs2/Makefile.am libsrs2-1.0.18-1/libsrs2/Makefile.am
+--- libsrs2-1.0.18/libsrs2/Makefile.am 2004-06-10 11:33:28.000000000 +0200
++++ libsrs2-1.0.18-1/libsrs2/Makefile.am 2009-09-29 16:08:29.000000000 +0200
+@@ -3,9 +3,6 @@
+ include_HEADERS = srs2.h
+ noinst_HEADERS = win32.h
+
+-lib_LIBRARIES = libsrs2.a
+-libsrs2_a_SOURCES = srs2.c sha1.c
+-
+ lib_LTLIBRARIES = libsrs2.la
+ libsrs2_la_LDFLAGS = -version-info 0:0:0
+ libsrs2_la_SOURCES = srs2.c sha1.c
diff --git a/mail-filter/libsrs2/libsrs2-1.0.18.ebuild b/mail-filter/libsrs2/libsrs2-1.0.18.ebuild
new file mode 100644
index 00000000000..df462c4a0bb
--- /dev/null
+++ b/mail-filter/libsrs2/libsrs2-1.0.18.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils autotools
+
+DESCRIPTION="libsrs2 is the next generation Sender Rewriting Scheme library"
+HOMEPAGE="http://www.libsrs2.org/"
+SRC_URI="http://www.libsrs2.org/srs/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="static-libs"
+
+DEPEND="!dev-perl/Mail-SRS"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-parallel-make.diff"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ use static-libs || find "${D}" -name '*.la' -delete
+}
diff --git a/mail-filter/libsrs2/metadata.xml b/mail-filter/libsrs2/metadata.xml
new file mode 100644
index 00000000000..75fd672f9b5
--- /dev/null
+++ b/mail-filter/libsrs2/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-mail</herd>
+<longdescription>
+ libsrs2 is the next generation SRS library from the original designer of
+ SRS. It implements the Sender Rewriting Scheme, a part of the SPF/SRS
+ protocol pair. Libsrs2 has been written from an entirely clean codebase with
+ compliance, speed and versatility in mind. It is platform independent and
+ has no external dependencies. It is thread-safe and heap-safe, and is
+ suitable for large scale applications and embedded systems and can operate
+ without many standard system facilities.
+</longdescription>
+</pkgmetadata>
diff --git a/mail-filter/libsrs_alt/Manifest b/mail-filter/libsrs_alt/Manifest
new file mode 100644
index 00000000000..b4b73c57279
--- /dev/null
+++ b/mail-filter/libsrs_alt/Manifest
@@ -0,0 +1 @@
+DIST libsrs_alt-1.0.tar.gz 337225 SHA256 97ee41246f55cb59b24a5b5ccb16af83b036e54502b1f9360a7f912866fba41e
diff --git a/mail-filter/libsrs_alt/files/libsrs_alt-1.0-ftime.patch b/mail-filter/libsrs_alt/files/libsrs_alt-1.0-ftime.patch
new file mode 100644
index 00000000000..290c90d6c5d
--- /dev/null
+++ b/mail-filter/libsrs_alt/files/libsrs_alt-1.0-ftime.patch
@@ -0,0 +1,12 @@
+diff --git a/configure.ac b/configure.ac
+index 5a43896..d0e106c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -31,6 +31,7 @@ AC_FUNC_FORK
+ AC_TYPE_SIGNAL
+ AC_FUNC_STRNLEN
+ AC_CHECK_LIB(socket, bind)
++AC_CHECK_LIB(compat, ftime)
+ AC_CHECK_FUNCS([ftime memset socket strchr strdup strncasecmp])
+ AC_TYPE_SIZE_T
+
diff --git a/mail-filter/libsrs_alt/libsrs_alt-1.0.ebuild b/mail-filter/libsrs_alt/libsrs_alt-1.0.ebuild
new file mode 100644
index 00000000000..7077e5fe131
--- /dev/null
+++ b/mail-filter/libsrs_alt/libsrs_alt-1.0.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils autotools
+
+MY_PV=${PV}
+MY_RC=${PV}
+S=${WORKDIR}/${PN}-${MY_PV}
+
+DESCRIPTION="Sender Rewriting Scheme library"
+HOMEPAGE="http://srs.mirtol.com/"
+SRC_URI="http://srs.mirtol.com/libsrs_alt-${MY_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd"
+IUSE=""
+
+RDEPEND="!dev-perl/Mail-SRS"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-ftime.patch
+ eautoreconf
+}
+
+src_compile() {
+ # add missing header
+ sed -i -e '/timeb.h>/ a #include <stdlib.h>' test.c
+
+ # Since the primary intended consumers of this library are MTAs,
+ # use non-standard separator characters (--with-base64compat).
+ # This breaks "SRS Compliancy", which is a rough standard at
+ # best.
+ econf --with-base64compat || die "econf failed"
+ emake -j1 || die "emake failed"
+}
+
+src_install() {
+ make install DESTDIR="${D}" || die "make install failed"
+ dodoc "${S}"/MTAs/README.EXIM
+}
diff --git a/mail-filter/libsrs_alt/metadata.xml b/mail-filter/libsrs_alt/metadata.xml
new file mode 100644
index 00000000000..0064ac998f5
--- /dev/null
+++ b/mail-filter/libsrs_alt/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-mail</herd>
+<longdescription>
+This is a complete standalone C implementation of the SRS (Sender Rewriting
+Scheme) and includes a command line utility and daemon, test utility and static
+and dynamic libraries. SRS is a stop-gap for users of SPF (Sender Policy
+Framework).
+</longdescription>
+</pkgmetadata>
diff --git a/mail-filter/maildrop/Manifest b/mail-filter/maildrop/Manifest
new file mode 100644
index 00000000000..35a779783dd
--- /dev/null
+++ b/mail-filter/maildrop/Manifest
@@ -0,0 +1 @@
+DIST maildrop-2.6.0.tar.bz2 2174922 SHA256 afc115119b2d3197c565002e158c2cb69d525288bf72c71919c3c74096b824a9 SHA512 210841add8aff389589802f15ea74776815ecfd0dd9d5fb4f244d101e3d3f5dbb833a38f1d539b869c49685cfe34b0e6e014a5888c2537c9d89c68d754248db4 WHIRLPOOL c6d8f2be69a02fa757ac4dd653c22c79c8da6c2c1c112d48e0d4c491238d20e4c093d01f728ea337b1ba12bc75d88c5a252ff036114fe2339666776f2be44e80
diff --git a/mail-filter/maildrop/files/maildrop-1.8.1-disable-fam.patch b/mail-filter/maildrop/files/maildrop-1.8.1-disable-fam.patch
new file mode 100644
index 00000000000..49d1cc7a532
--- /dev/null
+++ b/mail-filter/maildrop/files/maildrop-1.8.1-disable-fam.patch
@@ -0,0 +1,56 @@
+diff -ruBb maildrop-1.8.1.orig/configure.in maildrop-1.8.1/configure.in
+--- maildrop-1.8.1.orig/configure.in 2005-05-12 16:45:57.000000000 +0200
++++ maildrop-1.8.1/configure.in 2005-09-10 20:05:28.000000000 +0200
+@@ -145,6 +145,7 @@
+ --enable-tempdir=.tmp directory for temp files (in user's home dir)
+ --disable-tempdir disable temp files in home directory (use
+ the tmpfile function)
++ --disable-fam disable libfam.a for maildir operations
+ --enable-smallmsg=8192 size of buffer for small messages
+ --enable-global-timeout=300 global watchdog timer (seconds)
+ --enable-crlf-term=0 enable <CR><LF> line termination
+diff -ruBb maildrop-1.8.1.orig/maildir/configure.in maildrop-1.8.1/maildir/configure.in
+--- maildrop-1.8.1.orig/maildir/configure.in 2005-03-21 13:11:24.000000000 +0100
++++ maildrop-1.8.1/maildir/configure.in 2005-09-10 20:10:55.000000000 +0200
+@@ -58,26 +58,30 @@
+ AC_STRUCT_TM
+
+ dnl Checks for library functions.
+-AC_CHECK_HEADER(fam.h, :, :)
+-AC_CHECK_FUNCS(symlink readlink strcasecmp utime utimes)
+-AC_CHECK_LIB(fam, FAMOpen, [
++AC_ARG_ENABLE(fam, [ --disable-fam Do not use libfam.a library.])
++if test x$enableval = xyes
++then
++ AC_CHECK_HEADER(fam.h, :, :)
++ AC_CHECK_FUNCS(symlink readlink strcasecmp utime utimes)
++ AC_CHECK_LIB(fam, FAMOpen, [
+ LIBFAM=-lfam
+ AC_DEFINE_UNQUOTED(HAVE_FAM,1,
+ [ Whether libfam.a is available ])
+
+ AC_CHECK_HEADER(fam.h, : , [
+-AC_MSG_WARN([[The development header files and libraries for fam,]])
+-AC_MSG_WARN([[the File Alteration Monitor, are not installed.]])
+-AC_MSG_WARN([[You appear to have the FAM runtime libraries installed,]])
+-AC_MSG_WARN([[so you need to simply install the additional development]])
+-AC_MSG_WARN([[package for your operating system.]])
+-AC_MSG_ERROR([[FAM development libraries not found.]]) ]
++ AC_MSG_WARN([[The development header files and libraries for fam,]])
++ AC_MSG_WARN([[the File Alteration Monitor, are not installed.]])
++ AC_MSG_WARN([[You appear to have the FAM runtime libraries installed,]])
++ AC_MSG_WARN([[so you need to simply install the additional development]])
++ AC_MSG_WARN([[package for your operating system.]])
++ AC_MSG_ERROR([[FAM development libraries not found.]]) ]
+ )
+ ])
+
+-AC_SUBST(LIBFAM)
++ AC_SUBST(LIBFAM)
+
+-echo "$LIBFAM" >maildir.libdeps
++ echo "$LIBFAM" >maildir.libdeps
++fi
+
+ AC_CACHE_CHECK([for missing gethostname prototype],maildir_cv_SYS_GETHOSTNAME,
+
diff --git a/mail-filter/maildrop/files/maildrop-2.5.1-db.patch b/mail-filter/maildrop/files/maildrop-2.5.1-db.patch
new file mode 100644
index 00000000000..4930fb0d155
--- /dev/null
+++ b/mail-filter/maildrop/files/maildrop-2.5.1-db.patch
@@ -0,0 +1,63 @@
+--- maildrop/bdbobj/configure.in
++++ maildrop/bdbobj/configure.in
+@@ -23,15 +23,19 @@
+ dnl Checks for libraries.
+
+ saveLIBS="$LIBS"
+-AC_CHECK_LIB(db, dbopen, [ LIBDB=-ldb ; LIBS="-ldb $LIBS" ],
+- AC_CHECK_LIB(db, db_open, [ LIBDB=-ldb ; LIBS="-ldb $LIBS"],
+- AC_CHECK_LIB(db, db_env_create, [ LIBDB=-ldb; LIBS="-ldb $LIBS"])
+- ))
++for dbname in db-5.2 db-5.1 db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db
++ do
++ AC_CHECK_LIB($dbname, db_create_4002, [ LIBDB=-l$dbname ; LIBS="-l$dbname $LIBS"; break ],
++ AC_CHECK_LIB($dbname, db_create_4001, [ LIBDB=-l$dbname ; LIBS="-l$dbname $LIBS"; break ],
++ AC_CHECK_LIB($dbname, db_create_4000, [ LIBDB=-l$dbname ; LIBS="-l$dbname $LIBS"; break ],
++ AC_CHECK_LIB($dbname, db_create, [ LIBDB=-l$dbname ; LIBS="-l$dbname $LIBS"; break ]))))
+
++ done
+ FOUND_DB=0
+-AC_CHECK_FUNC(dbopen, FOUND_DB=1)
+-AC_CHECK_FUNC(db_open, FOUND_DB=1)
+-AC_CHECK_FUNC(db_env_create, FOUND_DB=1)
++AC_CHECK_FUNC(db_create, FOUND_DB=1)
++AC_CHECK_FUNC(db_create_4002, FOUND_DB=1)
++AC_CHECK_FUNC(db_create_4001, FOUND_DB=1)
++AC_CHECK_FUNC(db_create_4000, FOUND_DB=1)
+
+ LIBS="$saveLIBS"
+
+--- maildrop/configure.in
++++ maildrop/configure.in
+@@ -115,18 +115,21 @@
+ USE_GDBM=1
+ ;;
+ db)
+- AC_CHECK_LIB(db, dbopen, [ LIBDB=-ldb ; LIBS="-ldb $LIBS" ],
+- AC_CHECK_LIB(db, db_open, [ LIBDB=-ldb ; LIBS="-ldb $LIBS"],
+- AC_CHECK_LIB(db, db_env_create,
+- [ LIBDB=-ldb; LIBS="-ldb $LIBS"])
+- ))
+-
+- AC_CHECK_FUNC(dbopen, HAVE_BDB=1)
+- AC_CHECK_FUNC(db_open, HAVE_BDB=1)
+- AC_CHECK_FUNC(db_env_create, HAVE_BDB=1)
++ for dbname in db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db
++ do
++ AC_CHECK_LIB($dbname, db_create_4002, [ LIBDB=-l$dbname ; LIBS="-l$dbname $LIBS"; break ],
++ AC_CHECK_LIB($dbname, db_create_4001, [ LIBDB=-l$dbname ; LIBS="-l$dbname $LIBS"; break ],
++ AC_CHECK_LIB($dbname, db_create_4000, [ LIBDB=-l$dbname ; LIBS="-l$dbname $LIBS"; break ],
++ AC_CHECK_LIB($dbname, db_create, [ LIBDB=-l$dbname ; LIBS="-l$dbname $LIBS"; break ]))))
++ done
++ AC_CHECK_FUNC(db_create, HAVE_BDB=1)
++ AC_CHECK_FUNC(db_create_4002, HAVE_BDB=1)
++ AC_CHECK_FUNC(db_create_4001, HAVE_BDB=1)
++ AC_CHECK_FUNC(db_create_4000, HAVE_BDB=1)
++
+ if test "$HAVE_BDB" != "1"
+ then
+- AC_MSG_ERROR(GDBM library not found)
++ AC_MSG_ERROR(DB library not found)
+ fi
+ dblibrary=bdbobj/libbdbobj.la
+ USE_DB=1
diff --git a/mail-filter/maildrop/files/maildrop-testsuite.patch b/mail-filter/maildrop/files/maildrop-testsuite.patch
new file mode 100644
index 00000000000..377fb19d151
--- /dev/null
+++ b/mail-filter/maildrop/files/maildrop-testsuite.patch
@@ -0,0 +1,67 @@
+Need en_US.utf8 to run some tests - bug #376667
+
+--- maildrop/Makefile.am 2011-04-04 15:58:58.000000000 +0000
++++ maildrop/Makefile.am 2011-07-28 10:29:43.000000000 +0000
+@@ -75,8 +75,12 @@
+ maildrop.lsm testsuite.txt.idn testsuite.txt.noidn
+
+ check-am:
++if HAS_EN_US
+ @chmod +x testsuite
+ ./testsuite | cmp -s - $(srcdir)/$(TESTSUITE)
++else
++ echo ' Need en_US.utf8 to run tests'
++endif
+
+ noinst_DATA=maildrop.html maildrop.1 maildropfilter.html maildropfilter.7 \
+ maildropgdbm.html maildropgdbm.7
+--- maildrop/configure.in 2011-05-17 20:36:04.000000000 +0000
++++ maildrop/configure.in 2011-07-28 10:58:57.000000000 +0000
+@@ -200,6 +200,15 @@
+ AC_TYPE_SIGNAL
+ AC_CHECK_FUNCS(setgroups setlocale)
+
++check_en_US() {
++locale -a | grep en_US.utf8 > /dev/null
++return $?
++}
++
++AC_MSG_CHECKING([for en_US.utf8])
++AM_CONDITIONAL([HAS_EN_US], [check_en_US])
++AM_COND_IF([HAS_EN_US],[AC_MSG_RESULT([yes])],[AC_MSG_RESULT([not found])])
++
+ AC_CHECK_FUNC(getpgrp, HAS_GETPGRP=1, HAS_GETPGRP=0)
+ AC_DEFINE_UNQUOTED(HAS_GETPGRP,$HAS_GETPGRP,
+ [ Whether getpgrp() is available ])
+--- rfc2045/Makefile.am 2011-04-04 15:59:47.000000000 +0000
++++ rfc2045/Makefile.am 2011-07-29 09:28:41.000000000 +0000
+@@ -76,7 +76,11 @@
+ TESTSUITE=testsuite.txt.noidn
+ endif
+
++if HAS_EN_US
+ check-am:
+ @SHELL@ $(srcdir)/testsuite | cmp -s - $(srcdir)/$(TESTSUITE)
+ @SHELL@ $(srcdir)/testsuitemm | cmp -s - $(srcdir)/testsuitemm.txt
+ @SHELL@ $(srcdir)/testrfc3676parsersuite | diff -U 3 $(srcdir)/testrfc3676parsersuite.txt -
++else
++ echo ' Need en_US.utf8 to run tests'
++endif
+--- rfc2045/configure.in 2011-04-04 15:59:47.000000000 +0000
++++ rfc2045/configure.in 2011-07-29 09:28:34.000000000 +0000
+@@ -59,6 +59,15 @@
+ AC_CHECK_FUNC(strncasecmp,,CFLAGS="$CFLAGS -Dstrncasecmp=strnicmp")
+ AC_CHECK_FUNC(strcasecmp,,CFLAGS="$CFLAGS -Dstrcasecmp=stricmp")
+
++check_en_US() {
++locale -a | grep en_US.utf8 > /dev/null
++return $?
++}
++
++AC_MSG_CHECKING([for en_US.utf8])
++AM_CONDITIONAL([HAS_EN_US], [check_en_US])
++AM_COND_IF([HAS_EN_US],[AC_MSG_RESULT([yes])],[AC_MSG_RESULT([not found])])
++
+ AC_ARG_WITH(package, [], package="$withval",
+ [
+ package="$PACKAGE"
diff --git a/mail-filter/maildrop/files/maildroprc b/mail-filter/maildrop/files/maildroprc
new file mode 100644
index 00000000000..0b72d552668
--- /dev/null
+++ b/mail-filter/maildrop/files/maildroprc
@@ -0,0 +1,3 @@
+# Global maildrop filter file
+
+#DEFAULT="$HOME/.maildir/"
diff --git a/mail-filter/maildrop/maildrop-2.6.0.ebuild b/mail-filter/maildrop/maildrop-2.6.0.ebuild
new file mode 100644
index 00000000000..dd22bf2b296
--- /dev/null
+++ b/mail-filter/maildrop/maildrop-2.6.0.ebuild
@@ -0,0 +1,141 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils flag-o-matic autotools
+
+DESCRIPTION="Mail delivery agent/filter"
+[[ -z ${PV/?.?/} ]] && SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
+[[ -z ${PV/?.?.?/} ]] && SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
+[[ -z ${SRC_URI} ]] && SRC_URI="http://www.courier-mta.org/beta/${PN}/${P%%_pre}.tar.bz2"
+HOMEPAGE="http://www.courier-mta.org/maildrop/"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86"
+IUSE="berkdb debug fam gdbm ldap mysql postgres static-libs authlib +tools trashquota"
+
+CDEPEND="!mail-mta/courier
+ net-mail/mailbase
+ dev-libs/libpcre
+ net-dns/libidn
+ gdbm? ( >=sys-libs/gdbm-1.8.0 )
+ mysql? ( net-libs/courier-authlib )
+ postgres? ( net-libs/courier-authlib )
+ ldap? ( net-libs/courier-authlib )
+ authlib? ( net-libs/courier-authlib )
+ fam? ( virtual/fam )
+ !gdbm? (
+ berkdb? ( >=sys-libs/db-3 )
+ )
+ tools? (
+ !mail-mta/netqmail
+ !net-mail/courier-imap
+ !mail-mta/mini-qmail
+ )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ dev-lang/perl"
+REQUIRED_USE="mysql? ( authlib )
+ postgres? ( authlib )
+ ldap? ( authlib )"
+
+S=${WORKDIR}/${P%%_pre}
+
+src_prepare() {
+ # Prefer gdbm over berkdb
+ if use gdbm ; then
+ use berkdb && elog "Both gdbm and berkdb selected. Using gdbm."
+ elif use berkdb ; then
+ epatch "${FILESDIR}"/${PN}-2.5.1-db.patch
+ fi
+
+ if ! use fam ; then
+ epatch "${FILESDIR}"/${PN}-1.8.1-disable-fam.patch
+ fi
+
+ # no need to error out if no default - it will be given to econf anyway
+ sed -i -e \
+ 's~AC_MSG_ERROR(Cannot determine default mailbox)~SPOOLDIR="./.maildir"~' \
+ "${S}"/maildrop/configure.in || die "sed failed"
+ epatch "${FILESDIR}"/${PN}-testsuite.patch
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ local mytrustedusers="apache dspam root mail fetchmail"
+ mytrustedusers+=" daemon postmaster qmaild mmdf vmail alias"
+
+ # These flags make maildrop cry
+ replace-flags -Os -O2
+ filter-flags -fomit-frame-pointer
+
+ if use gdbm ; then
+ myconf="${myconf} --with-db=gdbm"
+ elif use berkdb ; then
+ myconf="${myconf} --with-db=db"
+ else
+ myconf="${myconf} --without-db"
+ fi
+
+ if ! use mysql && ! use postgres && ! use ldap && ! use authlib ; then
+ myconf="${myconf} --disable-authlib"
+ fi
+
+ # Default mailbox is $HOME/.maildir for Gentoo
+ maildrop_cv_SYS_INSTALL_MBOXDIR="./.maildir" econf \
+ $(use_enable fam) \
+ --disable-dependency-tracker \
+ --with-devel \
+ --disable-tempdir \
+ --enable-syslog=1 \
+ --enable-use-flock=1 \
+ --enable-use-dotlock=1 \
+ --enable-restrict-trusted=1 \
+ --enable-trusted-users="${mytrustedusers}" \
+ --enable-maildrop-uid=root \
+ --enable-maildrop-gid=mail \
+ --enable-sendmail=/usr/sbin/sendmail \
+ --cache-file="${S}"/configuring.cache \
+ $(use_enable static-libs static) \
+ $(use_with trashquota) \
+ ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ fperms 4755 /usr/bin/maildrop
+
+ dodoc AUTHORS ChangeLog INSTALL NEWS README \
+ README.postfix UPGRADE maildroptips.txt
+ docinto unicode
+ dodoc unicode/README
+ docinto maildir
+ dodoc maildir/AUTHORS maildir/INSTALL maildir/README*.txt
+
+ # bugs #61116 #374009
+ if ! use tools ; then
+ for tool in "maildirmake" "deliverquota"; do
+ rm "${D}/usr/bin/${tool}"
+ rm "${D}/usr/share/man/man"[0-9]"/${tool}."[0-9]
+ rm "${D}/usr/share/maildrop/html/${tool}.html"
+ done
+ rm "${D}/usr/share/man/man5/maildir.5"
+ fi
+
+ dodir "/usr/share/doc/${PF}"
+ mv "${D}/usr/share/maildrop/html" "${D}/usr/share/doc/${PF}/" || die
+ rm -rf "${D}"/usr/share/maildrop
+
+ dohtml *.html maildir/*.html
+
+ insinto /etc
+ doins "${FILESDIR}"/maildroprc
+
+ use static-libs || find "${D}"/usr/lib* -name '*.la' -delete
+}
diff --git a/mail-filter/maildrop/metadata.xml b/mail-filter/maildrop/metadata.xml
new file mode 100644
index 00000000000..75e94b28412
--- /dev/null
+++ b/mail-filter/maildrop/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <use>
+ <flag name="authlib">Add courier-authlib support</flag>
+ <flag name="tools">Install maildirmake and deliverquota tools</flag>
+ <flag name="trashquota">Count deleted messages as part of the maildir quota</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">courier</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/mailfilter/Manifest b/mail-filter/mailfilter/Manifest
new file mode 100644
index 00000000000..7287278f8c0
--- /dev/null
+++ b/mail-filter/mailfilter/Manifest
@@ -0,0 +1 @@
+DIST mailfilter-0.8.2.tar.gz 382966 SHA256 4822fdfc4c7db543539a96429086b4d01ac22629396896ee7e52e6edce43fdec SHA512 fc988fe8e36204e4041ce10d6a87f06c8fd48c311aee0d838c2eec08c0d26c13c082fb44a63e7d9c0610d8be52dbf69e340247241f3c76a209319391969ec387 WHIRLPOOL 678c3bd237fa79840f1296ec70b79110bed4fe843ab0894d2e55abdb910302c3096924e897cebaa49b6284ea3df1e9f6c70ef0ad2443a371873581d29648084f
diff --git a/mail-filter/mailfilter/files/0.8.2-gcc44.patch b/mail-filter/mailfilter/files/0.8.2-gcc44.patch
new file mode 100644
index 00000000000..f1545d5b911
--- /dev/null
+++ b/mail-filter/mailfilter/files/0.8.2-gcc44.patch
@@ -0,0 +1,26 @@
+diff -ur mailfilter-0.8.2_orig/src/header.cc mailfilter-0.8.2/src/header.cc
+--- mailfilter-0.8.2_orig/src/header.cc 2009-06-07 03:49:57.000000000 +0200
++++ mailfilter-0.8.2/src/header.cc 2009-08-15 13:05:05.968397778 +0200
+@@ -63,7 +63,6 @@
+ * domain-literal = "[" *(dtext / quoted-pair) "]"
+ */
+
+- char* dom;
+ unsigned int l, i;
+
+ if (!msgid || !*msgid)
+@@ -74,12 +73,12 @@
+ return -1;
+ if (msgid[0] != '<' || msgid[l-1] != '>')
+ return -1;
+- if (!(dom = strrchr (msgid, '@')))
++ if (!(strrchr (msgid, '@')))
+ return -1;
+
+ /* TODO: complete parser */
+ for (i = 0; i < l; i++)
+- if (msgid[i] > 127)
++ if ((unsigned char)msgid[i] > 127)
+ return -1;
+
+ return 0;
diff --git a/mail-filter/mailfilter/files/0.8.2-gcc46.patch b/mail-filter/mailfilter/files/0.8.2-gcc46.patch
new file mode 100644
index 00000000000..ef1ebe45eba
--- /dev/null
+++ b/mail-filter/mailfilter/files/0.8.2-gcc46.patch
@@ -0,0 +1,20 @@
+Fix building with gcc-4.6
+
+https://bugs.gentoo.org/show_bug.cgi?id=366191
+
+Part of debian patch by Ricardo Mones <mones@debian.org>
+Fix invalid conversion and addded Ubuntu patch (thanks Ilya Barygin <barygin@gmail.com>)
+
+--- a/src/preferences.cc
++++ b/src/preferences.cc
+@@ -82,8 +82,8 @@
+
+ void Preferences :: init (void)
+ {
+- ((Size_score)(Preferences :: size_score)).score = 0;
+- ((Size_score)(Preferences :: size_score)).size = 0;
++ size_score.score = 0;
++ size_score.size = 0;
+ }
+
+ void Preferences :: kill (void)
diff --git a/mail-filter/mailfilter/files/0.8.2-openssl-1.patch b/mail-filter/mailfilter/files/0.8.2-openssl-1.patch
new file mode 100644
index 00000000000..ad58bbb561f
--- /dev/null
+++ b/mail-filter/mailfilter/files/0.8.2-openssl-1.patch
@@ -0,0 +1,16 @@
+http://bugs.gentoo.org/330717
+
+--- src/socket.cc
++++ src/socket.cc
+@@ -64,7 +64,11 @@
+ #ifdef USE_SSL
+ SSL* ssl;
+ BIO* sbio;
++ #if OPENSSL_VERSION_NUMBER >= 0x10000000L
++ const SSL_METHOD* ssl_meth;
++ #else
+ SSL_METHOD* ssl_meth;
++ #endif
+ SSL_CTX* ssl_ctx;
+ #endif
+
diff --git a/mail-filter/mailfilter/files/rcfile.example1 b/mail-filter/mailfilter/files/rcfile.example1
new file mode 100644
index 00000000000..85d3a519cf0
--- /dev/null
+++ b/mail-filter/mailfilter/files/rcfile.example1
@@ -0,0 +1,127 @@
+# -----------------------------------------------------------
+# Example rcfile from the INSTALL document
+# -----------------------------------------------------------
+
+
+# -----------------------------------------------------------
+# Logile path (be sure you have write permission in this
+# directory; you MUST specify a logfile)
+
+LOGFILE = "$HOME/logs/mailfilter.log"
+
+
+# -----------------------------------------------------------
+# Level of verbosity
+#
+# 0 Silent, show nothing at all
+# 1 Only show errors
+# 2 Only show "Deleted..." messages and errors
+# 3 Default; Show "Deleted..." messages, errors
+# and "Examining..." messages
+# 4 Like (3), except this also shows the current
+# account's username
+# 5 Like (4), except this also shows which filter
+# matched which string of an e-mail header
+# 6 Debugging mode; prints almost everything
+
+VERBOSE = 3
+
+
+# -----------------------------------------------------------
+# Server list (Do not change the order of the fields!!)
+# Note: Port 110 is usually the port APOP and POP3 servers use,
+# port 995 is required if (say) POP3/SSL is specified.
+
+SERVER = "pop.server.com"
+USER = "username"
+PASS = "password"
+PROTOCOL = "pop3"
+PORT = 110
+
+SERVER = "pop.secondserver.com"
+USER = "anotherusername"
+PASS = "anotherusername"
+PROTOCOL = "pop3/ssl"
+PORT = 995
+
+
+# -----------------------------------------------------------
+# Do you want case sensitive e-mail filters? { yes | no }
+
+REG_CASE = "no"
+
+
+# -----------------------------------------------------------
+# Sets the type of Regular Expression used { extended | basic }
+#
+# (The default is 'basic', don't change unless you know what you
+# are doing. Extended REs are more complex to set up.)
+
+REG_TYPE = "basic"
+
+
+# -----------------------------------------------------------
+# Maximum e-mail size in bytes that should not be exceeded.
+
+MAXSIZE_DENY = 1000000
+
+
+# -----------------------------------------------------------
+# Set maximum line length of any field in the message header
+
+MAXLENGTH = 998
+
+
+# ----------------------------------------------------------
+# Filter rules for detecting spam (each rule must be placed
+# in a separate line)
+
+# These filters detect certain unpleasant e-mail subjects:
+DENY = "^Subject:.*Get penis enlargement"
+DENY = "^Subject:.*WIN MONEY"
+
+# This one filters mail from a certain person:
+DENY = "^From:.*spammer@any_spam_organisation\.com"
+
+# This one filters mail from everyone at a certain organisation:
+DENY = "^From:.*@any_provider_that_spams\.org"
+
+# We don't want any of those 'LEGAL' messages either
+# while stuff with 'legal' in the subject still interests us:
+DENY_CASE = "^Subject:.*LEGAL"
+
+
+# -----------------------------------------------------------
+# Normalises the subject strings before parsing, e.g.
+# ',L.E-G,A.L; ,C.A-B`L`E, +.B-O`X` ;D`E`S,C;R,A.MB;L,E.R-]'
+# becomes 'LEGAL CABLE BOX DESCRAMBLER' which can be filtered.
+#
+# If NORMAL is switched on, Mailfilter tries to apply filters
+# to both the normalised and the original subject.
+
+NORMAL = "yes"
+
+
+# -----------------------------------------------------------
+# The maximum e-mail size in bytes that messages from friends
+# should not exceed. Set this to 0 if all your friends (ALLOW)
+# can send messages as long as they want.
+
+MAXSIZE_ALLOW = 0
+
+
+# ----------------------------------------------------------
+# Set list of friends that always pass, if they do not
+# exceed the message length of MAXSIZE_ALLOW
+
+# This rule allows all mail from a friend who was unlucky enough
+# to have signed up with a spam organisation. With DENY we
+# block everyone else from that domain though! See above!
+ALLOW = "^From:.*a_friend_with_account@any_provider_that_spams.org"
+
+# Of course we allow e-mail from anyone who has something to say about
+# mailfilter:
+ALLOW = "^Subject:.*mailfilter"
+
+# We also let our girlfriend send any e-mail she wants:
+ALLOW = "^From:.*my_girlfriend@any_provider\.com"
diff --git a/mail-filter/mailfilter/files/rcfile.example2 b/mail-filter/mailfilter/files/rcfile.example2
new file mode 100644
index 00000000000..d4fab0f01a4
--- /dev/null
+++ b/mail-filter/mailfilter/files/rcfile.example2
@@ -0,0 +1,133 @@
+# -----------------------------------------------------------
+# Example rcfile from the INSTALL document
+# Example configuration based upon the INSTALL document, but
+# showing some advanced features such as 'Negative Filters',
+# extended Regular Expressions, etc.
+# -----------------------------------------------------------
+
+
+# -----------------------------------------------------------
+# Logile path (be sure you have write permission in this
+# directory; you MUST specify a logfile)
+
+LOGFILE = "$HOME/logs/mailfilter.log"
+
+
+# -----------------------------------------------------------
+# Level of verbosity
+#
+# 0 Silent, show nothing at all
+# 1 Only show errors
+# 2 Only show "Deleted..." messages and errors
+# 3 Default; Show "Deleted..." messages, errors
+# and "Examining..." messages
+# 4 Like (3), except this also shows the current
+# account's username
+# 5 Like (4), except this also shows which filter
+# matched which string of an e-mail header
+# 6 Debugging mode; prints almost everything
+
+VERBOSE = 4
+
+
+# -----------------------------------------------------------
+# Server list (Do not change the order of the fields!!)
+# Note: Port 110 is usually the port APOP and POP3 servers use,
+# port 995 is required if (say) POP3/SSL is specified.
+
+SERVER = "pop.server.com"
+USER = "username"
+PASS = "password"
+PROTOCOL = "pop3"
+PORT = 110
+
+SERVER = "pop.secondserver.com"
+USER = "anotherusername"
+PASS = "anotherusername"
+PROTOCOL = "pop3/ssl"
+PORT = 995
+
+
+# -----------------------------------------------------------
+# Do you want case sensitive e-mail filters? { yes | no }
+
+REG_CASE = "no"
+
+
+# -----------------------------------------------------------
+# Sets the type of Regular Expression used { extended | basic }
+#
+# (The default is 'basic', don't change unless you know what you
+# are doing. Extended REs are more complex to set up.)
+
+# We want some additional smartness in our rules. That's why only
+# extended Regular Expressions work for this sample set-up.
+REG_TYPE = "extended"
+
+
+# -----------------------------------------------------------
+# Maximum e-mail size in bytes that should not be exceeded.
+
+# Accept only 250 KBytes message size. Friends can send more though.
+# (See MAXSIZE_ALLOW for further information.)
+MAXSIZE_DENY = 250000
+
+
+# -----------------------------------------------------------
+# Set maximum line length of any field in the message header
+
+MAXLENGTH = 998
+
+
+# This one filters mail from a certain person.
+# (We need the back slash before the '.com' since we are using
+# extended Regular Expressions.)
+DENY="^From:.*spammer@any_spam_organisation\.com"
+
+# This one filters mail from everyone at a certain organisation:
+DENY = "^From:.*@any_provider_that_spams\.org"
+
+# We don't want any of those 'LEGAL' messages either
+# while stuff with 'legal' in the subject still interests us:
+DENY_CASE = "^Subject:.*LEGAL"
+
+# This one demonstrates the use of 'Negative Filters' and the
+# logical OR '|' in Regular Expressions.
+# (Again, the example works only with extended Regular Expressions.)
+# Kill everything not directly addressed to own account:
+DENY<>"(^To|^Cc):(.*username@server\.com|.*anotherusername@secondserver\.com)"
+
+# -----------------------------------------------------------
+# Normalises the subject strings before parsing, e.g.
+# ',L.E-G,A.L; ,C.A-B`L`E, +.B-O`X` ;D`E`S,C;R,A.MB;L,E.R-]'
+# becomes 'LEGAL CABLE BOX DESCRAMBLER' which can be filtered.
+#
+# If NORMAL is switched on, Mailfilter tries to apply filters
+# to both the normalised and the original subject.
+
+NORMAL = "yes"
+
+
+# -----------------------------------------------------------
+# The maximum e-mail size in bytes that messages from friends
+# should not exceed. Set this to 0 if all your friends (ALLOW)
+# can send messages as long as they want.
+
+MAXSIZE_ALLOW = 0
+
+
+# ----------------------------------------------------------
+# Set list of friends that always pass, if they do not
+# exceed the message length of MAXSIZE_ALLOW
+
+# This rule allows all mail from a friend who was unlucky enough
+# to have signed up with a spam organisation. With DENY we
+# block everyone else from that domain though! See above!
+ALLOW = "^From:.*a_friend_with_account@any_provider_that_spams\.org"
+
+# Of course we allow e-mail from anyone who has something to say about
+# mailfilter:
+ALLOW = "^Subject:.*mailfilter"
+
+# We also let our girlfriend send any e-mail she wants:
+ALLOW = "^From:.*my_girlfriend@any_provider\.com"
diff --git a/mail-filter/mailfilter/mailfilter-0.8.2.ebuild b/mail-filter/mailfilter/mailfilter-0.8.2.ebuild
new file mode 100644
index 00000000000..d857bfb8538
--- /dev/null
+++ b/mail-filter/mailfilter/mailfilter-0.8.2.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+inherit eutils
+
+DESCRIPTION="Mailfilter is a utility to get rid of unwanted spam mails"
+HOMEPAGE="http://mailfilter.sourceforge.net/"
+SRC_URI="mirror://sourceforge/mailfilter/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc sparc x86 ~x86-fbsd"
+IUSE=""
+
+DEPEND="sys-devel/flex"
+RDEPEND=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/0.8.2-gcc44.patch \
+ "${FILESDIR}"/0.8.2-openssl-1.patch \
+ "${FILESDIR}"/${PV}-gcc46.patch
+}
+
+src_compile() {
+ emake -j1 || die #281069
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc INSTALL doc/FAQ "${FILESDIR}"/rcfile.example{1,2} \
+ README THANKS ChangeLog AUTHORS NEWS || die
+}
diff --git a/mail-filter/mailfilter/metadata.xml b/mail-filter/mailfilter/metadata.xml
new file mode 100644
index 00000000000..35ed8f5cefd
--- /dev/null
+++ b/mail-filter/mailfilter/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <upstream>
+ <remote-id type="sourceforge">mailfilter</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/mapson/Manifest b/mail-filter/mapson/Manifest
new file mode 100644
index 00000000000..487f943926c
--- /dev/null
+++ b/mail-filter/mapson/Manifest
@@ -0,0 +1 @@
+DIST mapson-3.3.tar.gz 421820 SHA256 91e5cb1f39f58c71c182ccbd4fb9b0c2cf323030961ab7283276b14b5cf63850 SHA512 208d3b21d59689465a5c46619a53b3342c3ca96575d681b9ad01b1b6ffa05f05f56ab6e7ae38a8b2161e3f8d42b90b559baf8ff9db4ab4c83238d7adcb645fd0 WHIRLPOOL 66a7cb58f31105fcbb8cfaa63c1ad6ade9f3199f49b7f52e09ef1ac638b0b01c188c5251c14d9268faff6938093e4f0c2815f0c09fe87b0c422f3cb3bbf37286
diff --git a/mail-filter/mapson/mapson-3.3.ebuild b/mail-filter/mapson/mapson-3.3.ebuild
new file mode 100644
index 00000000000..2e2e3a720b7
--- /dev/null
+++ b/mail-filter/mapson/mapson-3.3.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="A challenge/response-based white-list spam filter"
+HOMEPAGE="http://mapson.sourceforge.net/"
+SRC_URI="mirror://sourceforge/mapson/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="debug"
+
+RDEPEND="virtual/mta"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ econf $(use_with debug)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc AUTHORS INSTALL NEWS README
+ doman doc/mapson.1
+ dohtml doc/mapson.html
+ dodir /etc/mapson
+ insinto /etc/mapson
+ newins sample-config mapson.config
+ dodir /usr/share/mapson
+ insinto /usr/share/mapson
+ newins sample-challenge-template challenge-template
+ rm -f "${D}"/etc/sample-config
+ rm -f "${D}"/usr/share/{mapson.html,sample-challenge-template}
+}
diff --git a/mail-filter/mapson/metadata.xml b/mail-filter/mapson/metadata.xml
new file mode 100644
index 00000000000..d4dc3ffd0a5
--- /dev/null
+++ b/mail-filter/mapson/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <upstream>
+ <remote-id type="sourceforge">mapson</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/metadata.xml b/mail-filter/metadata.xml
new file mode 100644
index 00000000000..11adcc49fd3
--- /dev/null
+++ b/mail-filter/metadata.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The mail-filter category contains email filtering software.
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie mail-filter enthält Programme zur Filterung von
+ Emails.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría mail-filter contiene programas para filtrar correo
+ electrónico.
+ </longdescription>
+ <longdescription lang="ja">
+ mail-filter カテゴリーにはメールフィルタリング・ソフトウェアが
+ 含まれています。
+ </longdescription>
+ <longdescription lang="nl">
+ De mail-filter categorie bevat filtersoftware voor e-mail.
+ </longdescription>
+ <longdescription lang="sk">
+ Kategória mail-filter obsahuje nástroje na filtrovanie elektronických
+ správ.
+ </longdescription>
+ <longdescription lang="vi">
+ Nhóm mail-filter chứa các phần mềm lọc email.
+ </longdescription>
+ <longdescription lang="it">
+ La categoria mail-filter contiene programmi per il filtraggio della
+ posta elettronica.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria mail-filter contém programas para a filtragem do
+ correio eletrônico.
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria mail-filter zawiera oprogramowanie służące do filtrowania poczty.
+ </longdescription>
+</catmetadata>
diff --git a/mail-filter/milter-regex/Manifest b/mail-filter/milter-regex/Manifest
new file mode 100644
index 00000000000..f95be296370
--- /dev/null
+++ b/mail-filter/milter-regex/Manifest
@@ -0,0 +1 @@
+DIST milter-regex-1.9.tar.gz 19880 SHA256 6a708b0ff31d9f6db0e5b96915354c15f65ca09a730c599970b37e30699b18e4 SHA512 55cb97eba01220eb57c29498a090152c05d259abbe6f771e47a67499e7c2a1d4121ec9d0bce84cc8b6490bcd20dea8eaaba753e61f1ce9002edd8440b13f7148 WHIRLPOOL a8c1d75c016f32ec357e80498b7de5a89da50cf8a32bcbfd9e0467c829870c468beb6b12f138a352f518ff26a3f95c83ed25892670bf1a7f76f2b728cf626f30
diff --git a/mail-filter/milter-regex/files/milter-regex-1.7-gentoo.patch b/mail-filter/milter-regex/files/milter-regex-1.7-gentoo.patch
new file mode 100644
index 00000000000..bd5d926ce21
--- /dev/null
+++ b/mail-filter/milter-regex/files/milter-regex-1.7-gentoo.patch
@@ -0,0 +1,52 @@
+diff -Nru milter-regex-1.7.orig/Makefile.linux milter-regex-1.7/Makefile.linux
+--- milter-regex-1.7.orig/Makefile.linux 2007-01-11 17:49:52.000000000 +0200
++++ milter-regex-1.7/Makefile.linux 2008-02-18 10:17:35.000000000 +0200
+@@ -6,13 +6,12 @@
+ # see milter-regex.init for an init script for RedHat/Fedora
+ # (contributed by admin@2ka.mipt.ru)
+
+-CFLAGS= -g
+-LDFLAGS= -lmilter -lpthread
++LIBS= -lmilter -lpthread
+
+ all: milter-regex milter-regex.cat8
+
+ milter-regex: milter-regex.o eval.o strlcpy.o y.tab.o
+- gcc -o milter-regex milter-regex.o eval.o strlcpy.o y.tab.o $(LDFLAGS)
++ gcc $(LDFLAGS) -o milter-regex milter-regex.o eval.o strlcpy.o y.tab.o $(LIBS)
+
+ milter-regex.o: milter-regex.c eval.h
+ gcc $(CFLAGS) -c milter-regex.c
+@@ -27,7 +26,7 @@
+ gcc $(CFLAGS) -c y.tab.c
+
+ y.tab.c: parse.y
+- yacc -d parse.y
++ yacc -d -y parse.y
+
+ milter-regex.cat8: milter-regex.8
+ nroff -Tascii -mandoc milter-regex.8 > milter-regex.cat8
+diff -Nru milter-regex-1.7.orig/parse.y milter-regex-1.7/parse.y
+--- milter-regex-1.7.orig/parse.y 2007-01-11 17:49:52.000000000 +0200
++++ milter-regex-1.7/parse.y 2008-02-18 10:16:02.000000000 +0200
+@@ -71,6 +71,7 @@
+ } v;
+ int lineno;
+ } YYSTYPE;
++#define YYSTYPE_IS_DECLARED 1
+
+ %}
+
+@@ -481,9 +482,9 @@
+ *r = rs;
+ return (0);
+ }
+-#ifdef __linux__
+- (void)&yyrcsid; /* warning about yyrcsid declared but unused */
+-#endif
++//#ifdef __linux__
++// (void)&yyrcsid; /* warning about yyrcsid declared but unused */
++//#endif
+ }
+
+ static int
diff --git a/mail-filter/milter-regex/files/milter-regex-1.7-rules.patch b/mail-filter/milter-regex/files/milter-regex-1.7-rules.patch
new file mode 100644
index 00000000000..2e85be4c28b
--- /dev/null
+++ b/mail-filter/milter-regex/files/milter-regex-1.7-rules.patch
@@ -0,0 +1,11 @@
+--- rules~ 2007-01-11 08:49:52.000000000 -0700
++++ rules 2008-01-28 11:52:49.629153456 -0700
+@@ -21,7 +21,7 @@
+ header /From/ /ebay\.com/i
+ header /From/ /sabresfc11@aol\.com/i
+ header /From/ /ictp\.ch/i
+-header /From/ /(sgi.org.uk/ei
++header /From/ /(sgi.org.uk)/ei
+ header /From/ /tera-byte/i
+ header /From/ /google\.com/i
+ header /Subject/ /item/i
diff --git a/mail-filter/milter-regex/files/milter-regex-1.7-yacc.patch b/mail-filter/milter-regex/files/milter-regex-1.7-yacc.patch
new file mode 100644
index 00000000000..880f05d1fa7
--- /dev/null
+++ b/mail-filter/milter-regex/files/milter-regex-1.7-yacc.patch
@@ -0,0 +1,12 @@
+diff -Nru milter-regex-1.7.orig/Makefile.linux milter-regex-1.7/Makefile.linux
+--- milter-regex-1.7.orig/Makefile.linux 2008-12-11 20:54:05.000000000 +0000
++++ milter-regex-1.7/Makefile.linux 2008-12-11 20:54:22.000000000 +0000
+@@ -26,7 +26,7 @@
+ gcc $(CFLAGS) -c y.tab.c
+
+ y.tab.c: parse.y
+- yacc -d -y parse.y
++ yacc -d parse.y
+
+ milter-regex.cat8: milter-regex.8
+ nroff -Tascii -mandoc milter-regex.8 > milter-regex.cat8
diff --git a/mail-filter/milter-regex/files/milter-regex-1.8-gentoo.patch b/mail-filter/milter-regex/files/milter-regex-1.8-gentoo.patch
new file mode 100644
index 00000000000..27caafb654c
--- /dev/null
+++ b/mail-filter/milter-regex/files/milter-regex-1.8-gentoo.patch
@@ -0,0 +1,129 @@
+diff -Nru milter-regex-1.8.orig/Makefile.linux milter-regex-1.8/Makefile.linux
+--- milter-regex-1.8.orig/Makefile.linux 2007-01-11 16:49:52.000000000 +0100
++++ milter-regex-1.8/Makefile.linux 2010-09-24 22:33:19.000000000 +0200
+@@ -6,13 +6,12 @@
+ # see milter-regex.init for an init script for RedHat/Fedora
+ # (contributed by admin@2ka.mipt.ru)
+
+-CFLAGS= -g
+-LDFLAGS= -lmilter -lpthread
++LIBS= -lmilter -lpthread
+
+ all: milter-regex milter-regex.cat8
+
+-milter-regex: milter-regex.o eval.o strlcpy.o y.tab.o
+- gcc -o milter-regex milter-regex.o eval.o strlcpy.o y.tab.o $(LDFLAGS)
++milter-regex: milter-regex.o eval.o strlcpy.o strlcat.o y.tab.o
++ gcc $(LDFLAGS) -o milter-regex milter-regex.o eval.o strlcpy.o strlcat.o y.tab.o $(LIBS)
+
+ milter-regex.o: milter-regex.c eval.h
+ gcc $(CFLAGS) -c milter-regex.c
+@@ -22,7 +21,10 @@
+
+ strlcpy.o: strlcpy.c
+ gcc $(CFLAGS) -c strlcpy.c
+-
++
++strlcat.o: strlcat.c
++ gcc $(CFLAGS) -c strlcat.c
++
+ y.tab.o: y.tab.c
+ gcc $(CFLAGS) -c y.tab.c
+
+diff -Nru milter-regex-1.8.orig/parse.y milter-regex-1.8/parse.y
+--- milter-regex-1.8.orig/parse.y 2007-01-11 16:49:52.000000000 +0100
++++ milter-regex-1.8/parse.y 2010-09-24 22:33:19.000000000 +0200
+@@ -71,6 +71,7 @@
+ } v;
+ int lineno;
+ } YYSTYPE;
++#define YYSTYPE_IS_DECLARED 1
+
+ %}
+
+@@ -481,9 +482,9 @@
+ *r = rs;
+ return (0);
+ }
+-#ifdef __linux__
+- (void)&yyrcsid; /* warning about yyrcsid declared but unused */
+-#endif
++//#ifdef __linux__
++// (void)&yyrcsid; /* warning about yyrcsid declared but unused */
++//#endif
+ }
+
+ static int
+diff -Nru milter-regex-1.8.orig/strlcat.c milter-regex-1.8/strlcat.c
+--- milter-regex-1.8.orig/strlcat.c 1970-01-01 01:00:00.000000000 +0100
++++ milter-regex-1.8/strlcat.c 2010-09-24 22:34:31.000000000 +0200
+@@ -0,0 +1,69 @@
++/* $OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp $ */
++
++/*-
++ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
++ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
++ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
++ * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
++ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
++ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
++ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
++ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#include <sys/types.h>
++#include <string.h>
++
++/*
++ * Appends src to string dst of size siz (unlike strncat, siz is the
++ * full size of dst, not space left). At most siz-1 characters
++ * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
++ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
++ * If retval >= siz, truncation occurred.
++ */
++size_t
++strlcat(dst, src, siz)
++ char *dst;
++ const char *src;
++ size_t siz;
++{
++ char *d = dst;
++ const char *s = src;
++ size_t n = siz;
++ size_t dlen;
++
++ /* Find the end of dst and adjust bytes left but don't go past end */
++ while (n-- != 0 && *d != '\0')
++ d++;
++ dlen = d - dst;
++ n = siz - dlen;
++
++ if (n == 0)
++ return(dlen + strlen(s));
++ while (*s != '\0') {
++ if (n != 1) {
++ *d++ = *s;
++ n--;
++ }
++ s++;
++ }
++ *d = '\0';
++
++ return(dlen + (s - src)); /* count does not include NUL */
++}
diff --git a/mail-filter/milter-regex/files/milter-regex-1.8-rules.patch b/mail-filter/milter-regex/files/milter-regex-1.8-rules.patch
new file mode 100644
index 00000000000..7103e7e6c59
--- /dev/null
+++ b/mail-filter/milter-regex/files/milter-regex-1.8-rules.patch
@@ -0,0 +1,12 @@
+diff -Nru milter-regex-1.8.orig/rules milter-regex-1.8/rules
+--- milter-regex-1.8.orig/rules 2007-01-11 16:49:52.000000000 +0100
++++ milter-regex-1.8/rules 2010-09-24 22:11:46.000000000 +0200
+@@ -21,7 +21,7 @@
+ header /From/ /ebay\.com/i
+ header /From/ /sabresfc11@aol\.com/i
+ header /From/ /ictp\.ch/i
+-header /From/ /(sgi.org.uk/ei
++header /From/ /(sgi.org.uk)/ei
+ header /From/ /tera-byte/i
+ header /From/ /google\.com/i
+ header /Subject/ /item/i
diff --git a/mail-filter/milter-regex/files/milter-regex-1.9-gentoo.patch b/mail-filter/milter-regex/files/milter-regex-1.9-gentoo.patch
new file mode 100644
index 00000000000..38ba17af0d8
--- /dev/null
+++ b/mail-filter/milter-regex/files/milter-regex-1.9-gentoo.patch
@@ -0,0 +1,38 @@
+--- Makefile.linux 2011-07-16 16:51:34.000000000 +0300
++++ Makefile.linux 2012-08-05 18:15:30.906378968 +0300
+@@ -6,28 +6,27 @@
+ # see milter-regex.init for an init script for RedHat/Fedora
+ # (contributed by admin@2ka.mipt.ru)
+
+-CFLAGS= -g
+-LDFLAGS= -L/usr/lib/libmilter -lmilter -lpthread
++LIBS= -lmilter -lpthread
+
+ all: milter-regex milter-regex.cat8
+
+ milter-regex: milter-regex.o eval.o strlcat.o strlcpy.o y.tab.o
+- gcc -o milter-regex milter-regex.o eval.o strlcat.o strlcpy.o y.tab.o $(LDFLAGS)
++ $(CC) $(LDFLAGS) -o milter-regex milter-regex.o eval.o strlcat.o strlcpy.o y.tab.o $(LIBS)
+
+ milter-regex.o: milter-regex.c eval.h
+- gcc $(CFLAGS) -c milter-regex.c
++ $(CC) $(CFLAGS) -c milter-regex.c
+
+ eval.o: eval.c eval.h
+- gcc $(CFLAGS) -c eval.c
++ $(CC) $(CFLAGS) -c eval.c
+
+ strlcat.o: strlcat.c
+- gcc $(CFLAGS) -c strlcat.c
++ $(CC) $(CFLAGS) -c strlcat.c
+
+ strlcpy.o: strlcpy.c
+- gcc $(CFLAGS) -c strlcpy.c
++ $(CC) $(CFLAGS) -c strlcpy.c
+
+ y.tab.o: y.tab.c
+- gcc $(CFLAGS) -c y.tab.c
++ $(CC) $(CFLAGS) -c y.tab.c
+
+ y.tab.c: parse.y
+ yacc -d parse.y
diff --git a/mail-filter/milter-regex/files/milter-regex-conf b/mail-filter/milter-regex/files/milter-regex-conf
new file mode 100644
index 00000000000..51846a214e4
--- /dev/null
+++ b/mail-filter/milter-regex/files/milter-regex-conf
@@ -0,0 +1,8 @@
+# Daemon user
+USER="milter"
+
+# The location of the Unix socket
+SOCKET="/var/run/milter-regex/milter-regex.sock"
+
+# Regular expression rules
+CONFIG="/etc/mail/milter-regex.conf"
diff --git a/mail-filter/milter-regex/files/milter-regex-init b/mail-filter/milter-regex/files/milter-regex-init
new file mode 100644
index 00000000000..e032d08f09d
--- /dev/null
+++ b/mail-filter/milter-regex/files/milter-regex-init
@@ -0,0 +1,42 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use dns logger net
+}
+
+check_cfg() {
+ if [ -z "${USER}" ] ; then
+ eerror "USER is unset"
+ return 1
+ fi
+
+ if [ ! -s "${CONFIG}" ]; then
+ eerror "configuration file ${CONFIG} doesn't seem to be valid"
+ return 1
+ fi
+}
+
+start() {
+ check_cfg || return 1
+
+ # Remove stalled Unix socket if no other process is using it
+ if [ -S "${SOCKET}" ] && ! fuser -s "${SOCKET}"; then
+ rm "${SOCKET}"
+ fi
+
+ ebegin "Starting milter-regex"
+ start-stop-daemon --start --exec /usr/bin/milter-regex -- \
+ -u "${USER}" -p "${SOCKET}" -c "${CONFIG}"
+ EXIT=$?
+ [ $? == 0 ] && chmod a+rw "${SOCKET}"
+ eend ${EXIT}
+}
+
+stop() {
+ ebegin "Stopping milter-regex"
+ start-stop-daemon --stop --exec /usr/bin/milter-regex
+ eend $?
+}
diff --git a/mail-filter/milter-regex/metadata.xml b/mail-filter/milter-regex/metadata.xml
new file mode 100644
index 00000000000..b3efcc51b39
--- /dev/null
+++ b/mail-filter/milter-regex/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-mail</herd>
+<longdescription>milter-regex is a very simple milter-based plugin that rejects or discards messages matching
+regular expressions. It doesn't add much processing overhead, so even a busy mail server can afford to run it.</longdescription>
+</pkgmetadata>
diff --git a/mail-filter/milter-regex/milter-regex-1.9.ebuild b/mail-filter/milter-regex/milter-regex-1.9.ebuild
new file mode 100644
index 00000000000..df9ba89662e
--- /dev/null
+++ b/mail-filter/milter-regex/milter-regex-1.9.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils user
+
+DESCRIPTION="A milter-based regular expression filter"
+HOMEPAGE="http://www.benzedrine.cx/milter-regex.html"
+SRC_URI="http://www.benzedrine.cx/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="|| ( mail-filter/libmilter mail-mta/sendmail )"
+DEPEND="${RDEPEND}
+ virtual/yacc"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gentoo.patch
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" -f Makefile.linux milter-regex
+}
+
+src_install() {
+ dobin milter-regex
+
+ keepdir /var/run/milter-regex
+
+ insinto /etc/mail
+ newins rules milter-regex.conf
+
+ newconfd "${FILESDIR}"/milter-regex-conf milter-regex
+ newinitd "${FILESDIR}"/milter-regex-init milter-regex
+
+ doman *.8
+}
+
+pkg_preinst() {
+ enewgroup milter
+ # mail-milter/spamass-milter creates milter user with this home directory
+ # For consistency reasons, milter user must be created here with this home directory
+ # even though this package doesn't need a home directory for this user (#280571)
+ enewuser milter -1 -1 /var/lib/milter milter
+
+ fowners milter:milter /var/run/milter-regex
+}
+
+pkg_postinst() {
+ elog "If you're using Sendmail, you'll need to add this to your sendmail.mc:"
+ elog " INPUT_MAIL_FILTER(\`milter-regex', \`S=unix:/var/run/milter-regex/milter-regex.sock, T=S:30s;R:2m')"
+ echo
+ elog "If you are using Postfix, you'll need to add this to your main.cf:"
+ elog " smtpd_milters = unix:/var/run/milter-regex/milter-regex.sock"
+ elog " non_smtpd_milters = unix:/var/run/milter-regex/milter-regex.sock"
+}
diff --git a/mail-filter/mimedefang/Manifest b/mail-filter/mimedefang/Manifest
new file mode 100644
index 00000000000..65dd16b66e0
--- /dev/null
+++ b/mail-filter/mimedefang/Manifest
@@ -0,0 +1,3 @@
+DIST mimedefang-2.73.tar.gz 356601 SHA256 88a0f294e517348b692b0e0f226b60f90fa94eb0e771e02ab716c8e50d8cf714 SHA512 c20ee35235107342d4bce5a95cca01fc6c45365bf270b11c2bfe44a614ec39bcdd2a7b71836a092d6df88519194dbb3e93e293144b740e95e9846ebe0302cf5e WHIRLPOOL 56339d0cdbc0ab33a4a8eb37847ef00169b0db865ea7847172ee485090639fa2e0fea2361e615902013e10c2b1efbf2679c286d5bc4e189d68ae3cce53a69abc
+DIST mimedefang-2.74.tar.gz 362500 SHA256 eb35d200d291cf7d456c644b94c9d4825ca2d0e345193539d63cd971adeb8605 SHA512 0168c4e664fcd2df7f08e4f7d110114d907f8f37d50986c89b33f5a575c87291574d0b5dff0197fb5666281f4fe1b67a61e8719a470bd01c5b7f2fc354f066b4 WHIRLPOOL 293580d3ae64752867a16fdaa01a0aee14a87d3a5d4888963cb657ebbc6d1737616cc289fd1eead16b42aa458bfb06a2e63914df041447d002af3e2a91218151
+DIST mimedefang-2.75.tar.gz 363535 SHA256 7852da1039ed22bc8df4e43c3094ee8c6d6ba154479efd37b643d488a3c85a42 SHA512 a8b5c83116d973ea8971df8682d4ba26a37a47fd58cf740eecc1b70aa68a8aa765f7fa2415542d54f147990310b68e64d1e949d3b988cee24c4c2c5194123d98 WHIRLPOOL 512014b1664249ff0e40e7a6b86764e729e8db07338a8750d45f81e04ab0c1e72306530ca6333851089cd23f4907df7f64a73548cfa8cd9b6d80992ee0d20813
diff --git a/mail-filter/mimedefang/files/mimedefang-2.72-ldflags.patch b/mail-filter/mimedefang/files/mimedefang-2.72-ldflags.patch
new file mode 100644
index 00000000000..998b3183e66
--- /dev/null
+++ b/mail-filter/mimedefang/files/mimedefang-2.72-ldflags.patch
@@ -0,0 +1,38 @@
+--- mimedefang-2.72/Makefile.in.orig
++++ mimedefang-2.72/Makefile.in
+@@ -52,7 +52,7 @@
+ all: mimedefang mimedefang-multiplexor md-mx-ctrl pod2man
+
+ mimedefang-multiplexor: mimedefang-multiplexor.o event.o event_tcp.o drop_privs_nothread.o notifier.o syslog-fac.o utils.o $(EMBPERLOBJS)
+- $(CC) $(CFLAGS) -o mimedefang-multiplexor mimedefang-multiplexor.o event.o event_tcp.o drop_privs_nothread.o syslog-fac.o notifier.o utils.o $(EMBPERLOBJS) $(LIBS_WITHOUT_PTHREAD) $(EMBPERLLDFLAGS) $(EMBPERLLIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o mimedefang-multiplexor mimedefang-multiplexor.o event.o event_tcp.o drop_privs_nothread.o syslog-fac.o notifier.o utils.o $(EMBPERLOBJS) $(LIBS_WITHOUT_PTHREAD) $(EMBPERLLDFLAGS) $(EMBPERLLIBS)
+
+ embperl.o: embperl.c
+ $(CC) $(CFLAGS) $(EMBPERLCFLAGS) $(PTHREAD_FLAG) $(DEFS) $(MINCLUDE) -c -o embperl.o $(srcdir)/embperl.c
+@@ -67,7 +67,7 @@
+ $(CC) $(CFLAGS) $(EMBPERLCFLAGS) $(PTHREAD_FLAG) $(DEFS) $(MINCLUDE) -c -o test-embed-perl.o $(srcdir)/test-embed-perl.c
+
+ te: test-embed-perl.o
+- $(CC) $(CFLAGS) -o te test-embed-perl.o $(LIBS_WITHOUT_PTHREAD) $(EMBPERLLDFLAGS) $(EMBPERLLIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o te test-embed-perl.o $(LIBS_WITHOUT_PTHREAD) $(EMBPERLLDFLAGS) $(EMBPERLLIBS)
+ rm_r.o: rm_r.c
+ $(CC) $(CFLAGS) $(PTHREAD_FLAG) $(DEFS) $(MINCLUDE) -c -o rm_r.o $(srcdir)/rm_r.c
+
+@@ -75,7 +75,7 @@
+ $(CC) $(CFLAGS) $(PTHREAD_FLAG) $(DEFS) $(MINCLUDE) -c -o syslog-fac.o $(srcdir)/syslog-fac.c
+
+ md-mx-ctrl: md-mx-ctrl.o
+- $(CC) $(CFLAGS) -o md-mx-ctrl md-mx-ctrl.o $(LIBS_WITHOUT_PTHREAD)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o md-mx-ctrl md-mx-ctrl.o $(LIBS_WITHOUT_PTHREAD)
+
+ md-mx-ctrl.o: md-mx-ctrl.c
+ $(CC) $(CFLAGS) $(DEFS) $(MINCLUDE) -c -o md-mx-ctrl.o $(srcdir)/md-mx-ctrl.c
+@@ -99,7 +99,7 @@
+ $(CC) $(CFLAGS) $(DEFS) $(MINCLUDE) -c -o mimedefang-multiplexor.o $(srcdir)/mimedefang-multiplexor.c
+
+ mimedefang: mimedefang.o drop_privs_threaded.o utils.o rm_r.o syslog-fac.o dynbuf.o milter_cap.o gen_id.o
+- $(CC) $(CFLAGS) $(PTHREAD_FLAG) -o mimedefang mimedefang.o drop_privs_threaded.o utils.o rm_r.o syslog-fac.o dynbuf.o milter_cap.o gen_id.o $(LDFLAGS) -lmilter $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $(PTHREAD_FLAG) -o mimedefang mimedefang.o drop_privs_threaded.o utils.o rm_r.o syslog-fac.o dynbuf.o milter_cap.o gen_id.o $(LDFLAGS) -lmilter $(LIBS)
+
+ mimedefang.o: mimedefang.c mimedefang.h
+ $(CC) $(CFLAGS) $(PTHREAD_FLAG) $(DEFS) $(MINCLUDE) -c -o mimedefang.o $(srcdir)/mimedefang.c
diff --git a/mail-filter/mimedefang/files/mimedefang.conf b/mail-filter/mimedefang/files/mimedefang.conf
new file mode 100644
index 00000000000..49ccef7be07
--- /dev/null
+++ b/mail-filter/mimedefang/files/mimedefang.conf
@@ -0,0 +1,131 @@
+# Additional options for MIMEDefang.
+# read man pages mimedefang(8) for additional informations.
+
+# Locale should be set to "C" for generating valid date headers
+LC_ALL=C
+export LC_ALL
+
+# The settings which follow are defaults. You can override them by
+# placing assignments in /etc/mail/mimedefang.conf
+
+# The socket used by mimedefang to communicate with sendmail
+# SOCKET=$SPOOLDIR/mimedefang.sock
+
+# Run the multiplexor and filters as this user, not root. RECOMMENDED
+MX_USER=defang
+
+# Syslog facility
+# SYSLOG_FACILITY=mail
+
+# If you want to keep spool directories around if the filter fails,
+# set the next one to yes
+# KEEP_FAILED_DIRECTORIES=no
+
+# "yes" turns on the multiplexor relay checking function
+# MX_RELAY_CHECK=no
+
+# "yes" turns on the multiplexor HELO checking function
+# MX_HELO_CHECK=no
+
+# "yes" turns on the multiplexor sender checking function
+# MX_SENDER_CHECK=no
+
+# "yes" turns on the multiplexor recipient checking function
+# MX_RECIPIENT_CHECK=no
+
+# Set to yes if you want the multiplexor to log events to syslog
+MX_LOG=yes
+
+# Set to yes if you want to use an embedded Perl interpreter
+# MX_EMBED_PERL=yes
+
+# Set to full path of socket for Sendmail's SOCKETMAP map, if you
+# want to use it with MIMEDefang
+# MX_MAP_SOCKET=$SPOOLDIR/map.sock
+
+# The multiplexor does not start all slaves at the same time. Instead,
+# it starts one slave every MX_SLAVE_DELAY seconds when the system is idle.
+# (If the system is busy, the multiplexor starts slaves as incoming mail
+# requires attention.)
+# MX_SLAVE_DELAY=3
+
+# The next setting is an absolute limit on slave activation. The multiplexor
+# will NEVER activate a slave within MX_MIN_SLAVE_DELAY seconds of another.
+# The default of zero means that the multiplexor will activate slaves as
+# quickly as necessary to keep up with incoming mail.
+# MX_MIN_SLAVE_DELAY=0
+
+# Set to yes if you want the multiplexor to log stats in
+# /var/log/mimedefang/stats The /var/log/mimedefang directory must
+# exist and be writable by the user you're running MIMEDefang as.
+# MX_STATS=no
+
+# Number of slaves reserved for connections from loopback. Use -1
+# for default behaviour, 0 to allow loopback connections to queue,
+# or >0 to reserve slaves for loopback connections
+LOOPBACK_RESERVED_CONNECTIONS=-1
+
+# Set to yes if you want the stats file flushed after each entry
+# MX_FLUSH_STATS=no
+
+# Set to yes if you want the multiplexor to log stats to syslog
+# MX_STATS_SYSLOG=no
+
+# The socket used by the multiplexor
+# MX_SOCKET=$SPOOLDIR/mimedefang-multiplexor.sock
+
+# Maximum # of requests a process handles
+# MX_REQUESTS=200
+
+# Minimum number of processes to keep. The default of 0 is probably
+# too low; we suggest 2 instead.
+MX_MINIMUM=2
+
+# Maximum number of processes to run (mail received while this many
+# processes are running is rejected with a temporary failure, so be
+# wary of how many emails you receive at a time). This applies only
+# if you DO use the multiplexor. The default value of 2 is probably
+# too low; we suggest 10 instead
+MX_MAXIMUM=10
+
+# Uncomment to log slave status; it will be logged every
+# MX_LOG_SLAVE_STATUS_INTERVAL seconds
+# MX_LOG_SLAVE_STATUS_INTERVAL=30
+
+# Uncomment next line to have busy slaves send status updates to the
+# multiplexor. NOTE: Consumes one extra file descriptor per slave, plus
+# a bit of CPU time.
+# MX_STATUS_UPDATES=yes
+
+# Limit slave processes' resident-set size to this many kilobytes. Default
+# is unlimited.
+# MX_MAX_RSS=10000
+
+# Limit total size of slave processes' memory space to this many kilobytes.
+# Default is unlimited.
+# MX_MAX_AS=30000
+
+# If you want to use the "notification" facility, set the appropriate port.
+# See the mimedefang-notify man page for details.
+# MX_NOTIFIER=inet:4567
+
+# Number of seconds a process should be idle before checking for
+# minimum number and killed
+# MX_IDLE=300
+
+# Number of seconds a process is allowed to scan an email before it is
+# considered dead. The default is 30 seconds; we suggest 600.
+MX_BUSY=600
+
+# Extra sendmail macros to pass. Actually, you can add any extra
+# mimedefang options here...
+# MD_EXTRA="-a auth_author"
+
+# Multiplexor queue size -- default is 0 (no queueing)
+# MX_QUEUE_SIZE=10
+
+# Multiplexor queue timeout -- default is 30 seconds
+# MX_QUEUE_TIMEOUT=30
+
+# SUBFILTER specifies which filter rules file to use
+# SUBFILTER=/etc/mail/mimedefang-filter
diff --git a/mail-filter/mimedefang/files/mimedefang.init b/mail-filter/mimedefang/files/mimedefang.init
new file mode 100644
index 00000000000..19819a9fd6c
--- /dev/null
+++ b/mail-filter/mimedefang/files/mimedefang.init
@@ -0,0 +1,102 @@
+#!/sbin/runscript
+#
+# Generic start/stop script for MIMEDefang. Should work on most
+# flavors of UNIX.
+
+RETVAL=0
+prog='mimedefang'
+PROGDIR=/usr/bin
+SPOOLDIR='/var/spool/MIMEDefang'
+PID="$SPOOLDIR/$prog.pid"
+MXPID="$SPOOLDIR/$prog-multiplexor.pid"
+
+# Make sure required vars are set
+SOCKET=${SOCKET:=$SPOOLDIR/$prog.sock}
+MX_SOCKET=${MX_SOCKET:=$SPOOLDIR/$prog-multiplexor.sock}
+
+depend() {
+ use antivirus
+}
+
+start() {
+ if test -r $PID ; then
+ if kill -0 `cat $PID` > /dev/null 2>&1 ; then
+ echo "mimedefang (`cat $PID`) seems to be running."
+ return 1
+ fi
+ fi
+ if test -r $MXPID ; then
+ if kill -0 `cat $MXPID` > /dev/null 2>&1 ; then
+ echo "mimedefang-multiplexor (`cat $MXPID`) seems to be running."
+ return 1
+ fi
+ fi
+
+ rm -f $MX_SOCKET > /dev/null 2>&1
+ if [ "$MX_EMBED_PERL" = "yes" ] ; then
+ EMBEDFLAG=-E
+ else
+ EMBEDFLAG=""
+ fi
+
+ ebegin "Starting mimedefang-multiplexor"
+ start-stop-daemon --start --quiet \
+ --exec $PROGDIR/$prog-multiplexor -- -p $MXPID \
+ $EMBEDFLAG \
+ `[ -n "$SPOOLDIR" ] && echo "-z $SPOOLDIR"` \
+ `[ -n "$FILTER" ] && echo "-f $FILTER"` \
+ `[ -n "$SYSLOG_FACILITY" ] && echo "-S $SYSLOG_FACILITY"` \
+ `[ -n "$SUBFILTER" ] && echo "-F $SUBFILTER"` \
+ `[ -n "$MX_MINIMUM" ] && echo "-m $MX_MINIMUM"` \
+ `[ -n "$MX_MAXIMUM" ] && echo "-x $MX_MAXIMUM"` \
+ `[ -n "$MX_MAP_SOCKET" ] && echo "-N $MX_MAP_SOCKET"` \
+ `[ -n "$MX_LOG_SLAVE_STATUS_INTERVAL" ] && echo "-L $MX_LOG_SLAVE_STATUS_INTERVAL"` \
+ `[ -n "$MX_USER" ] && echo "-U $MX_USER"` \
+ `[ -n "$MX_IDLE" ] && echo "-i $MX_IDLE"` \
+ `[ -n "$MX_BUSY" ] && echo "-b $MX_BUSY"` \
+ `[ -n "$MX_REQUESTS" ] && echo "-r $MX_REQUESTS"` \
+ `[ -n "$MX_SLAVE_DELAY" ] && echo "-w $MX_SLAVE_DELAY"` \
+ `[ -n "$MX_MIN_SLAVE_DELAY" ] && echo "-W $MX_MIN_SLAVE_DELAY"` \
+ `[ -n "$MX_MAX_RSS" ] && echo "-R $MX_MAX_RSS"` \
+ `[ -n "$MX_MAX_AS" ] && echo "-M $MX_MAX_AS"` \
+ `[ "$MX_LOG" = "yes" ] && echo "-l"` \
+ `[ "$MX_STATS" = "yes" ] && echo "-t /var/log/mimedefang/stats"` \
+ `[ "$MX_STATS" = "yes" -a "$MX_FLUSH_STATS" = "yes" ] && echo "-u"` \
+ `[ "$MX_STATS_SYSLOG" = "yes" ] && echo "-T"` \
+ `[ "$MX_STATUS_UPDATES" = "yes" ] && echo "-Z"` \
+ `[ -n "$MX_QUEUE_SIZE" ] && echo "-q $MX_QUEUE_SIZE"` \
+ `[ -n "$MX_QUEUE_TIMEOUT" ] && echo "-Q $MX_QUEUE_TIMEOUT"` \
+ `[ -n "$MX_NOTIFIER" ] && echo "-O $MX_NOTIFIER"` \
+ -s $MX_SOCKET
+ eend $? "Failed to start mimedefang-multiplexor"
+
+ # Start mimedefang
+ rm -f $SOCKET > /dev/null 2>&1
+ ebegin "Starting mimedefang"
+ start-stop-daemon --start --quiet \
+ --exec $PROGDIR/$prog -- -P $PID \
+ -R $LOOPBACK_RESERVED_CONNECTIONS \
+ -m $MX_SOCKET \
+ `[ -n "$SPOOLDIR" ] && echo "-z $SPOOLDIR"` \
+ `[ -n "$MX_USER" ] && echo "-U $MX_USER"` \
+ `[ -n "$SYSLOG_FACILITY" ] && echo "-S $SYSLOG_FACILITY"` \
+ `[ "$MX_RELAY_CHECK" = "yes" ] && echo "-r"` \
+ `[ "$MX_HELO_CHECK" = "yes" ] && echo "-H"` \
+ `[ "$MX_SENDER_CHECK" = "yes" ] && echo "-s"` \
+ `[ "$MX_RECIPIENT_CHECK" = "yes" ] && echo "-t"` \
+ `[ "$KEEP_FAILED_DIRECTORIES" = "yes" ] && echo "-k"` \
+ `[ "$MD_EXTRA" != "" ] && echo $MD_EXTRA` \
+ `[ "$ALLOW_NEW_CONNECTIONS_TO_QUEUE" = "yes" ] && echo "-q"` \
+ -p $SOCKET
+ eend $? "Failed to start mimedefang"
+}
+
+stop() {
+ ebegin "Stopping mimedefang"
+ start-stop-daemon --stop --quiet --pidfile $PID
+ eend $? "Failed to stop mimedefang"
+
+ ebegin "Stopping mimedefang-multiplexor"
+ start-stop-daemon --stop --quiet --pidfile $MXPID
+ eend $? "Failed to stop mimedefang-multiplexor"
+}
diff --git a/mail-filter/mimedefang/metadata.xml b/mail-filter/mimedefang/metadata.xml
new file mode 100644
index 00000000000..c38fa00ff26
--- /dev/null
+++ b/mail-filter/mimedefang/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-mail</herd>
+<longdescription>A program for Milter supported mail servers that implements antispam, antivirus and other customizable filtering on email messages</longdescription>
+<use>
+ <flag name='poll'>Use poll instead of select</flag>
+</use>
+</pkgmetadata>
diff --git a/mail-filter/mimedefang/mimedefang-2.73.ebuild b/mail-filter/mimedefang/mimedefang-2.73.ebuild
new file mode 100644
index 00000000000..a93989b5bda
--- /dev/null
+++ b/mail-filter/mimedefang/mimedefang-2.73.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils user
+
+DESCRIPTION="Antispam, antivirus and other customizable filtering for MTAs with Milter support"
+HOMEPAGE="http://www.mimedefang.org/"
+SRC_URI="http://www.mimedefang.org/static/${P}.tar.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="clamav +poll"
+
+DEPEND=">=dev-perl/MIME-tools-5.412
+ dev-perl/IO-stringy
+ virtual/perl-MIME-Base64
+ dev-perl/Digest-SHA1
+ clamav? ( app-antivirus/clamav )
+ || ( mail-filter/libmilter mail-mta/sendmail )"
+RDEPEND="${DEPEND}"
+RESTRICT="test"
+
+pkg_setup() {
+ enewgroup defang
+ enewuser defang -1 -1 -1 defang
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.72-ldflags.patch
+}
+
+src_configure() {
+ econf \
+ --with-user=defang \
+ $(use_enable poll) \
+ $(use_enable clamav) \
+ $(use_enable clamav clamd)
+}
+
+src_install() {
+ emake DESTDIR="${D}" INSTALL_STRIP_FLAG="" install
+
+ fowners defang:defang /etc/mail/mimedefang-filter
+ fperms 644 /etc/mail/mimedefang-filter
+ insinto /etc/mail/
+ insopts -m 644
+ newins "${S}"/SpamAssassin/spamassassin.cf sa-mimedefang.cf
+
+ keepdir /var/spool/{MD-Quarantine,MIMEDefang}
+ fowners defang:defang /var/spool/{MD-Quarantine,MIMEDefang}
+ fperms 700 /var/spool/{MD-Quarantine,MIMEDefang}
+
+ dodir /var/log/mimedefang
+ keepdir /var/log/mimedefang
+
+ newinitd "${FILESDIR}"/${PN}.init ${PN}
+ newconfd "${FILESDIR}"/${PN}.conf ${PN}
+
+ docinto examples
+ dodoc examples/*
+}
diff --git a/mail-filter/mimedefang/mimedefang-2.74.ebuild b/mail-filter/mimedefang/mimedefang-2.74.ebuild
new file mode 100644
index 00000000000..b3aecae5376
--- /dev/null
+++ b/mail-filter/mimedefang/mimedefang-2.74.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils user
+
+DESCRIPTION="Antispam, antivirus and other customizable filtering for MTAs with Milter support"
+HOMEPAGE="http://www.mimedefang.org/"
+SRC_URI="http://www.mimedefang.org/static/${P}.tar.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="clamav +poll"
+
+DEPEND=">=dev-perl/MIME-tools-5.412
+ dev-perl/IO-stringy
+ virtual/perl-MIME-Base64
+ dev-perl/Digest-SHA1
+ clamav? ( app-antivirus/clamav )
+ || ( mail-filter/libmilter mail-mta/sendmail )"
+RDEPEND="${DEPEND}"
+RESTRICT="test"
+
+pkg_setup() {
+ enewgroup defang
+ enewuser defang -1 -1 -1 defang
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.72-ldflags.patch
+}
+
+src_configure() {
+ econf \
+ --with-user=defang \
+ $(use_enable poll) \
+ $(use_enable clamav) \
+ $(use_enable clamav clamd)
+}
+
+src_install() {
+ emake DESTDIR="${D}" INSTALL_STRIP_FLAG="" install
+
+ fowners defang:defang /etc/mail/mimedefang-filter
+ fperms 644 /etc/mail/mimedefang-filter
+ insinto /etc/mail/
+ insopts -m 644
+ newins "${S}"/SpamAssassin/spamassassin.cf sa-mimedefang.cf
+
+ keepdir /var/spool/{MD-Quarantine,MIMEDefang}
+ fowners defang:defang /var/spool/{MD-Quarantine,MIMEDefang}
+ fperms 700 /var/spool/{MD-Quarantine,MIMEDefang}
+
+ keepdir /var/log/mimedefang
+
+ newinitd "${FILESDIR}"/${PN}.init ${PN}
+ newconfd "${FILESDIR}"/${PN}.conf ${PN}
+
+ dodoc -r examples
+}
diff --git a/mail-filter/mimedefang/mimedefang-2.75.ebuild b/mail-filter/mimedefang/mimedefang-2.75.ebuild
new file mode 100644
index 00000000000..4cc8e9e348c
--- /dev/null
+++ b/mail-filter/mimedefang/mimedefang-2.75.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils user
+
+DESCRIPTION="Antispam, antivirus and other customizable filtering for MTAs with Milter support"
+HOMEPAGE="http://www.mimedefang.org/"
+SRC_URI="http://www.mimedefang.org/static/${P}.tar.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="clamav +poll"
+
+DEPEND=">=dev-perl/MIME-tools-5.412
+ dev-perl/IO-stringy
+ virtual/perl-MIME-Base64
+ dev-perl/Digest-SHA1
+ clamav? ( app-antivirus/clamav )
+ || ( mail-filter/libmilter mail-mta/sendmail )"
+RDEPEND="${DEPEND}"
+RESTRICT="test"
+
+pkg_setup() {
+ enewgroup defang
+ enewuser defang -1 -1 -1 defang
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.72-ldflags.patch
+}
+
+src_configure() {
+ econf \
+ --with-user=defang \
+ $(use_enable poll) \
+ $(use_enable clamav) \
+ $(use_enable clamav clamd)
+}
+
+src_install() {
+ emake DESTDIR="${D}" INSTALL_STRIP_FLAG="" install
+
+ fowners defang:defang /etc/mail/mimedefang-filter
+ fperms 644 /etc/mail/mimedefang-filter
+ insinto /etc/mail/
+ insopts -m 644
+ newins "${S}"/SpamAssassin/spamassassin.cf sa-mimedefang.cf
+
+ keepdir /var/spool/{MD-Quarantine,MIMEDefang}
+ fowners defang:defang /var/spool/{MD-Quarantine,MIMEDefang}
+ fperms 700 /var/spool/{MD-Quarantine,MIMEDefang}
+
+ keepdir /var/log/mimedefang
+
+ newinitd "${FILESDIR}"/${PN}.init ${PN}
+ newconfd "${FILESDIR}"/${PN}.conf ${PN}
+
+ dodoc -r examples
+}
diff --git a/mail-filter/normalizemime/Manifest b/mail-filter/normalizemime/Manifest
new file mode 100644
index 00000000000..2d731555311
--- /dev/null
+++ b/mail-filter/normalizemime/Manifest
@@ -0,0 +1 @@
+DIST normalizemime-1.19.tar.bz2 12192 RMD160 81474049397a16033c6bcf479599064b388d8793 SHA1 15947496cc4eb1cb94761e816a341f0ac0d91849 SHA256 5b0813adb4d1cb38e276979dfedac28032effa6b8ee3f45699022a5fa26e761c
diff --git a/mail-filter/normalizemime/metadata.xml b/mail-filter/normalizemime/metadata.xml
new file mode 100644
index 00000000000..04af52a335d
--- /dev/null
+++ b/mail-filter/normalizemime/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+</pkgmetadata>
diff --git a/mail-filter/normalizemime/normalizemime-1.19.ebuild b/mail-filter/normalizemime/normalizemime-1.19.ebuild
new file mode 100644
index 00000000000..a21b6cd69c5
--- /dev/null
+++ b/mail-filter/normalizemime/normalizemime-1.19.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs
+
+DESCRIPTION="Helper program to normalize MIME encoded messages"
+HOMEPAGE="http://hyvatti.iki.fi/~jaakko/spam/"
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~x86-fbsd"
+IUSE=""
+
+src_compile() {
+ tc-export CC
+ emake normalizemime || die
+}
+
+src_install() {
+ dobin normalizemime || die
+}
diff --git a/mail-filter/opendkim/Manifest b/mail-filter/opendkim/Manifest
new file mode 100644
index 00000000000..7da87da330d
--- /dev/null
+++ b/mail-filter/opendkim/Manifest
@@ -0,0 +1,5 @@
+DIST opendkim-2.10.0.tar.gz 1213007 SHA256 4a747c9028e1cba40b5f8ba64ec5fbcf9f7d27a8a41fec4b4a398e2a6001c747 SHA512 c1ef4a8e80ed8a6e64e9a9a4f6d2ec684622fb4248d1d1c9b696f14ec9f4163e7b37f1a936ec8d522b6531b91fc869ca875fd6ff58c96c75ba41c919bed40d53 WHIRLPOOL 8443c330265dd47774ed476e4a88da10e586dc27fe6f7d98bec8f88c9129e04df334bf2d4dcfa0c65ca9b5287d8fa478b9d9bd6da9672add32074d0d6d9da0bf
+DIST opendkim-2.10.2.tar.gz 1209812 SHA256 ff5dc58ca8ad94de9b999bde3c53f49ac040dc09ad4b295ea22984d8d7df4f82 SHA512 b3c3e5fa3c265082d6f68def987a6805edba3798b37390c1e8099e2cecc71a9f6080481036991f654fa02b1a09d6b2107156aa533d14d0bfc0cb2d09bc7e398c WHIRLPOOL a3ca0262d1d2b3d01e28406224afa3ae914fd9f21bb455b34070d5821dbd8211696204fd7143b2e3046a6d3afa098a1d179e7be2433126fa8c763459cb448032
+DIST opendkim-2.10.3.tar.gz 1210224 SHA256 43a0ba57bf942095fe159d0748d8933c6b1dd1117caf0273fa9a0003215e681b SHA512 97923e533d072c07ae4d16a46cbed95ee799aa50f19468d8bc6d1dc534025a8616c3b4b68b5842bc899b509349a2c9a67312d574a726b048c0ea46dd4fcc45d8 WHIRLPOOL 36bbf0f3e81fa291f31123d3614ba113b893d4ba76a5fe017cc9a393888c1ea95525b85e6042bc1db96e9a00e52aa13a251c38438cd03b0fd92b47d17036d680
+DIST opendkim-2.9.2.tar.gz 1229383 SHA256 1f0c66afbe48f6223d2ab985b2c27594ae45035e3e81eba887d8ec6e5e1282c0 SHA512 f6fe77897927a93c9f57d09e5e9f43b1e73e2b21a586461b5665fb430eee1362b33d9601c8643d50d5a53c8e01b03c7af331f28cd992c9163f959723f21ebf63 WHIRLPOOL b61212d272d07c367c7d9ecb951466b66759b6d449047c10947681ea6889a1f2b2c12986e6c11a59620fb8ace3c0a177235f65f58c54c993909f61dee5cf3c3a
+DIST opendkim-2.9.3.tar.gz 1230406 SHA256 79a84fc17fa6aa9428ed449b1b2b773b0a4cb4ac7fa69b01b178fe0b4691c533 SHA512 9ed79f4cc595ef6dded8c1c1af77404ed629d88d2dad11c72fc0ff961bb9ab62037e010b29b651bc2cdcbdbabf001199b12544330a3af851b61d05518cf92053 WHIRLPOOL 5f24ecb5084babcd572f9cce9645aba92f1a68643bd4928b5040f3cad21f299380af746ad2dcefacc5803438a06c021a85da2be80ecf91308e7519d2df93cf51
diff --git a/mail-filter/opendkim/files/opendkim.init.r3 b/mail-filter/opendkim/files/opendkim.init.r3
new file mode 100644
index 00000000000..7f56da5c569
--- /dev/null
+++ b/mail-filter/opendkim/files/opendkim.init.r3
@@ -0,0 +1,56 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+CONFFILE=/etc/opendkim/${SVCNAME}.conf
+
+depend() {
+ use dns logger net
+ before mta
+}
+
+check_cfg() {
+
+ PIDFILE=$(sed -ne 's/^[[:space:]]*PidFile[[:space:]]\+//p' "${CONFFILE}")
+ local PIDDIR="${PIDFILE%/*}"
+ if [ ! -d "${PIDDIR}" ] ; then
+ checkpath -q -d -o milter:milter -m 0755 "${PIDDIR}" || return 1
+ fi
+ if [ ! -f "${CONFFILE}" ] ; then
+ eerror "Configuration file ${CONFFILE} is missing"
+ return 1
+ fi
+ if [ -z "${PIDFILE}" ] ; then
+ eerror "Configuration file needs PidFile setting - recommend adding 'PidFile /var/run/opendkim/${SVCNAME}.pid' to ${CONFFILE}"
+ return 1
+ fi
+
+ if egrep -q '^[[:space:]]*Background[[:space:]]+no' "${CONFFILE}" ; then
+ eerror "${SVCNAME} service cannot run with Background key set to yes!"
+ return 1
+ fi
+}
+
+start() {
+ check_cfg || return 1
+
+ # Remove stalled Unix socket if no other process is using it
+ local UNIX_SOCKET=$(sed -ne 's/^[[:space:]]*Socket[[:space:]]\+\(unix\|local\)://p' "${CONFFILE}")
+
+ if [ -S "${UNIX_SOCKET}" ] && ! fuser -s "${UNIX_SOCKET}"; then
+ rm "${UNIX_SOCKET}"
+ fi
+
+ ebegin "Starting OpenDKIM"
+ start-stop-daemon --start --pidfile "${PIDFILE}" \
+ --exec /usr/sbin/opendkim -- -x "${CONFFILE}"
+ eend $?
+}
+
+stop() {
+ check_cfg || return 1
+ ebegin "Stopping OpenDKIM"
+ start-stop-daemon --stop --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/mail-filter/opendkim/files/opendkim.service b/mail-filter/opendkim/files/opendkim.service
new file mode 100644
index 00000000000..be534d670bc
--- /dev/null
+++ b/mail-filter/opendkim/files/opendkim.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=DomainKeys Identified Mail (DKIM) Milter
+Documentation=man:opendkim(8) man:opendkim.conf(5) man:opendkim-genkey(8) man:opendkim-genzone(8) man:opendkim-testadsp(8) man:opendkim-testkey http://www.opendkim.org/docs.html
+After=network.target nss-lookup.target syslog.target
+
+[Service]
+ExecStart=/usr/sbin/opendkim -f -x /etc/opendkim/opendkim.conf
+ExecReload=/bin/kill -USR1 $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/mail-filter/opendkim/metadata.xml b/mail-filter/opendkim/metadata.xml
new file mode 100644
index 00000000000..2eaf789b438
--- /dev/null
+++ b/mail-filter/opendkim/metadata.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <longdescription>A program implementing the Milter API that signs and verifies
+using the DKIM standard. This is a fork of Sendmail's DKIM-milter</longdescription>
+ <use>
+ <!--flag name='diffheaders'>On verification failure, compare the
+ original and the received headers to look for possible munging</flag-->
+ <flag name="unbound">Use the unbound dnssec library to perform DKIM DNS
+ queries.</flag>
+ <flag name="opendbx">Use opendbx backend to facilitate dataset driven
+ OpenDKIM configuration options like stats, bodylengthdb, etc. against a wide
+ variety of database types</flag>
+ <flag name="sasl">Used to authenticate to a LDAP server in various ways if
+ required.</flag>
+ <flag name="ldap">Enable openldap as a dataset facilitator or keys,
+ determining domains to sign for, and any other dataset that opendkim
+ supports.</flag>
+ <flag name="lua">Enables control over signature verification, filtering and
+ policy to be controlled by user defined lua scripts.</flag>
+ <flag name="poll">Use poll() instead of select() for the provided
+ asynchronous resolver library.</flag>
+ <flag name="memcached">Add support for using <pkg>dev-libs/libmemcached</pkg>
+ </flag>
+ <flag name="lmdb">Add support for using <pkg>dev-db/lmdb</pkg></flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">opendkim</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/opendkim/opendkim-2.10.0.ebuild b/mail-filter/opendkim/opendkim-2.10.0.ebuild
new file mode 100644
index 00000000000..0e845b94a3f
--- /dev/null
+++ b/mail-filter/opendkim/opendkim-2.10.0.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools db-use eutils systemd user
+
+# for betas
+#MY_P=${P/_b/.B}
+#S=${WORKDIR}/${PN}-2.8.0
+#SRC_URI="mirror://sourceforge/opendkim/${MY_P}.tar.gz"
+
+DESCRIPTION="A milter-based application to provide DKIM signing and verification"
+HOMEPAGE="http://opendkim.org"
+SRC_URI="mirror://sourceforge/opendkim/${P}.tar.gz"
+
+LICENSE="Sendmail-Open-Source BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="+berkdb gnutls ldap lmdb lua memcached opendbx poll sasl selinux +ssl static-libs unbound"
+
+DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail )
+ dev-libs/libbsd
+ ssl? ( >=dev-libs/openssl-0.9.8 )
+ berkdb? ( >=sys-libs/db-3.2 )
+ opendbx? ( >=dev-db/opendbx-1.4.0 )
+ lua? ( dev-lang/lua )
+ ldap? ( net-nds/openldap )
+ lmdb? ( dev-db/lmdb )
+ memcached? ( dev-libs/libmemcached )
+ sasl? ( dev-libs/cyrus-sasl )
+ unbound? ( >=net-dns/unbound-1.4.1 net-dns/dnssec-root )
+ !unbound? ( net-libs/ldns )
+ gnutls? ( >=net-libs/gnutls-2.11.7 )"
+
+RDEPEND="${DEPEND}
+ sys-process/psmisc
+ selinux? ( sec-policy/selinux-dkim )
+"
+
+REQUIRED_USE="sasl? ( ldap )"
+
+pkg_setup() {
+ enewgroup milter
+ # mail-milter/spamass-milter creates milter user with this home directory
+ # For consistency reasons, milter user must be created here with this home directory
+ # even though this package doesn't need a home directory for this user (#280571)
+ enewuser milter -1 -1 /var/lib/milter milter
+}
+
+src_prepare() {
+ sed -i -e 's:/var/db/dkim:/etc/opendkim:g' \
+ -e 's:/var/db/opendkim:/var/lib/opendkim:g' \
+ -e 's:/etc/mail:/etc/opendkim:g' \
+ -e 's:mailnull:milter:g' \
+ -e 's:^#[[:space:]]*PidFile.*:PidFile /run/opendkim/opendkim.pid:' \
+ opendkim/opendkim.conf.sample opendkim/opendkim.conf.simple.in \
+ stats/opendkim-reportstats{,.in} || die
+
+ sed -i -e 's:dist_doc_DATA:dist_html_DATA:' libopendkim/docs/Makefile.am \
+ || die
+
+ #sed -i -e '/sock.*mt.getcwd/s:mt.getcwd():"/tmp":' opendkim/tests/*.lua
+ #sed -i -e '/sock.*mt.getcwd/s:mt.getcwd():"/proc/self/cwd":' opendkim/tests/*.lua
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ if use berkdb ; then
+ myconf=$(db_includedir)
+ myconf="--with-db-incdir=${myconf#-I}"
+ myconf+=" --enable-popauth"
+ myconf+=" --enable-query_cache"
+ myconf+=" --enable-stats"
+ fi
+ if use unbound; then
+ myconf+=" --with-unbound"
+ else
+ myconf+=" --with-ldns"
+ fi
+ if use ldap; then
+ myconf+=" $(use_with sasl)"
+ fi
+ econf \
+ $(use_with berkdb db) \
+ $(use_with opendbx odbx) \
+ $(use_with lua) \
+ $(use_enable lua rbl) \
+ $(use_with ldap openldap) \
+ $(use_with lmdb) \
+ $(use_enable poll) \
+ $(use_enable static-libs static) \
+ $(use_with gnutls) \
+ $(use_with memcached libmemcached) \
+ ${myconf} \
+ --docdir=/usr/share/doc/${PF} \
+ --htmldir=/usr/share/doc/${PF}/html \
+ --enable-filter \
+ --enable-atps \
+ --enable-identity_header \
+ --enable-rate_limit \
+ --enable-resign \
+ --enable-replace_rules \
+ --enable-default_sender \
+ --enable-sender_macro \
+ --enable-vbr \
+ --disable-live-testing \
+ --with-test-socket=/tmp/opendkim-$(echo ${RANDOM})-S
+ #--disable-rpath
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dosbin stats/opendkim-reportstats
+
+ newinitd "${FILESDIR}/opendkim.init.r3" opendkim
+ systemd_dounit "${FILESDIR}/opendkim.service"
+
+ dodir /etc/opendkim /var/lib/opendkim
+ fowners milter:milter /var/lib/opendkim
+
+ # default configuration
+ if [ ! -f "${ROOT}"/etc/opendkim/opendkim.conf ]; then
+ grep ^[^#] "${S}"/opendkim/opendkim.conf.simple \
+ > "${D}"/etc/opendkim/opendkim.conf
+ if use unbound; then
+ echo TrustAnchorFile /etc/dnssec/root-anchors.txt >> "${D}"/etc/opendkim/opendkim.conf
+ fi
+ echo UserID milter >> "${D}"/etc/opendkim/opendkim.conf
+ if use berkdb; then
+ echo Statistics /var/lib/opendkim/stats.dat >> \
+ "${D}"/etc/opendkim/opendkim.conf
+ fi
+ fi
+
+ use static-libs || find "${D}" -name "*.la" -delete
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSION} ]]; then
+ elog "If you want to sign your mail messages and need some help"
+ elog "please run:"
+ elog " emerge --config ${CATEGORY}/${PN}"
+ elog "It will help you create your key and give you hints on how"
+ elog "to configure your DNS and MTA."
+
+ ewarn "Make sure your MTA has r/w access to the socket file."
+ ewarn "This can be done either by setting UMask to 002 and adding MTA's user"
+ ewarn "to milter group or you can simply set UMask to 000."
+ fi
+}
+
+pkg_config() {
+ local selector keysize pubkey
+
+ read -p "Enter the selector name (default ${HOSTNAME}): " selector
+ [[ -n "${selector}" ]] || selector=${HOSTNAME}
+ if [[ -z "${selector}" ]]; then
+ eerror "Oddly enough, you don't have a HOSTNAME."
+ return 1
+ fi
+ if [[ -f "${ROOT}"etc/opendkim/${selector}.private ]]; then
+ ewarn "The private key for this selector already exists."
+ else
+ keysize=1024
+ # generate the private and public keys
+ opendkim-genkey -b ${keysize} -D "${ROOT}"etc/opendkim/ \
+ -s ${selector} -d '(your domain)' && \
+ chown milter:milter \
+ "${ROOT}"etc/opendkim/"${selector}".private || \
+ { eerror "Failed to create private and public keys." ; return 1; }
+ chmod go-r "${ROOT}"etc/opendkim/"${selector}".private
+ fi
+
+ # opendkim selector configuration
+ echo
+ einfo "Make sure you have the following settings in your /etc/opendkim/opendkim.conf:"
+ einfo " Keyfile /etc/opendkim/${selector}.private"
+ einfo " Selector ${selector}"
+
+ # MTA configuration
+ echo
+ einfo "If you are using Postfix, add following lines to your main.cf:"
+ einfo " smtpd_milters = unix:/var/run/opendkim/opendkim.sock"
+ einfo " non_smtpd_milters = unix:/var/run/opendkim/opendkim.sock"
+ einfo " and read http://www.postfix.org/MILTER_README.html"
+
+ # DNS configuration
+ einfo "After you configured your MTA, publish your key by adding this TXT record to your domain:"
+ cat "${ROOT}"etc/opendkim/${selector}.txt
+ einfo "t=y signifies you only test the DKIM on your domain. See following page for the complete list of tags:"
+ einfo " http://www.dkim.org/specs/rfc4871-dkimbase.html#key-text"
+}
diff --git a/mail-filter/opendkim/opendkim-2.10.2.ebuild b/mail-filter/opendkim/opendkim-2.10.2.ebuild
new file mode 100644
index 00000000000..ec16223826f
--- /dev/null
+++ b/mail-filter/opendkim/opendkim-2.10.2.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools db-use eutils systemd user
+
+# for betas
+#MY_P=${P/_b/.B}
+#S=${WORKDIR}/${PN}-2.8.0
+#SRC_URI="mirror://sourceforge/opendkim/${MY_P}.tar.gz"
+
+DESCRIPTION="A milter-based application to provide DKIM signing and verification"
+HOMEPAGE="http://opendkim.org"
+SRC_URI="mirror://sourceforge/opendkim/${P}.tar.gz"
+
+LICENSE="Sendmail-Open-Source BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="+berkdb gnutls ldap lmdb lua memcached opendbx poll sasl selinux +ssl static-libs unbound"
+
+DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail )
+ dev-libs/libbsd
+ ssl? ( >=dev-libs/openssl-0.9.8:* )
+ berkdb? ( >=sys-libs/db-3.2:* )
+ opendbx? ( >=dev-db/opendbx-1.4.0 )
+ lua? ( dev-lang/lua:* )
+ ldap? ( net-nds/openldap )
+ lmdb? ( dev-db/lmdb )
+ memcached? ( dev-libs/libmemcached )
+ sasl? ( dev-libs/cyrus-sasl )
+ unbound? ( >=net-dns/unbound-1.4.1 net-dns/dnssec-root )
+ !unbound? ( net-libs/ldns )
+ gnutls? ( >=net-libs/gnutls-2.11.7 )"
+
+RDEPEND="${DEPEND}
+ sys-process/psmisc
+ selinux? ( sec-policy/selinux-dkim )
+"
+
+REQUIRED_USE="sasl? ( ldap )"
+
+pkg_setup() {
+ enewgroup milter
+ # mail-milter/spamass-milter creates milter user with this home directory
+ # For consistency reasons, milter user must be created here with this home directory
+ # even though this package doesn't need a home directory for this user (#280571)
+ enewuser milter -1 -1 /var/lib/milter milter
+}
+
+src_prepare() {
+ sed -i -e 's:/var/db/dkim:/etc/opendkim:g' \
+ -e 's:/var/db/opendkim:/var/lib/opendkim:g' \
+ -e 's:/etc/mail:/etc/opendkim:g' \
+ -e 's:mailnull:milter:g' \
+ -e 's:^#[[:space:]]*PidFile.*:PidFile /run/opendkim/opendkim.pid:' \
+ opendkim/opendkim.conf.sample opendkim/opendkim.conf.simple.in \
+ stats/opendkim-reportstats{,.in} || die
+
+ sed -i -e 's:dist_doc_DATA:dist_html_DATA:' libopendkim/docs/Makefile.am \
+ || die
+
+ sed -i -e '/sock.*mt.getcwd/s:mt.getcwd():"/tmp":' opendkim/tests/*.lua
+ sed -i -e '/sock.*mt.getcwd/s:mt.getcwd():"/proc/self/cwd":' opendkim/tests/*.lua
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ if use berkdb ; then
+ myconf=$(db_includedir)
+ myconf="--with-db-incdir=${myconf#-I}"
+ myconf+=" --enable-popauth"
+ myconf+=" --enable-query_cache"
+ myconf+=" --enable-stats"
+ fi
+ if use unbound; then
+ myconf+=" --with-unbound"
+ else
+ myconf+=" --with-ldns"
+ fi
+ if use ldap; then
+ myconf+=" $(use_with sasl)"
+ fi
+ econf \
+ $(use_with berkdb db) \
+ $(use_with opendbx odbx) \
+ $(use_with lua) \
+ $(use_enable lua rbl) \
+ $(use_with ldap openldap) \
+ $(use_with lmdb) \
+ $(use_enable poll) \
+ $(use_enable static-libs static) \
+ $(use_with gnutls) \
+ $(use_with memcached libmemcached) \
+ ${myconf} \
+ --docdir=/usr/share/doc/${PF} \
+ --htmldir=/usr/share/doc/${PF}/html \
+ --enable-filter \
+ --enable-atps \
+ --enable-identity_header \
+ --enable-rate_limit \
+ --enable-resign \
+ --enable-replace_rules \
+ --enable-default_sender \
+ --enable-sender_macro \
+ --enable-vbr \
+ --disable-live-testing
+ #--with-test-socket=/tmp/opendkim-$(echo ${RANDOM})-S
+ #--disable-rpath
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dosbin stats/opendkim-reportstats
+
+ newinitd "${FILESDIR}/opendkim.init.r3" opendkim
+ systemd_dounit "${FILESDIR}/opendkim.service"
+
+ dodir /etc/opendkim /var/lib/opendkim
+ fowners milter:milter /var/lib/opendkim
+
+ # default configuration
+ if [ ! -f "${ROOT}"/etc/opendkim/opendkim.conf ]; then
+ grep ^[^#] "${S}"/opendkim/opendkim.conf.simple \
+ > "${D}"/etc/opendkim/opendkim.conf
+ if use unbound; then
+ echo TrustAnchorFile /etc/dnssec/root-anchors.txt >> "${D}"/etc/opendkim/opendkim.conf
+ fi
+ echo UserID milter >> "${D}"/etc/opendkim/opendkim.conf
+ if use berkdb; then
+ echo Statistics /var/lib/opendkim/stats.dat >> \
+ "${D}"/etc/opendkim/opendkim.conf
+ fi
+ fi
+
+ use static-libs || find "${D}" -name "*.la" -delete
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSION} ]]; then
+ elog "If you want to sign your mail messages and need some help"
+ elog "please run:"
+ elog " emerge --config ${CATEGORY}/${PN}"
+ elog "It will help you create your key and give you hints on how"
+ elog "to configure your DNS and MTA."
+
+ ewarn "Make sure your MTA has r/w access to the socket file."
+ ewarn "This can be done either by setting UMask to 002 and adding MTA's user"
+ ewarn "to milter group or you can simply set UMask to 000."
+ fi
+}
+
+pkg_config() {
+ local selector keysize pubkey
+
+ read -p "Enter the selector name (default ${HOSTNAME}): " selector
+ [[ -n "${selector}" ]] || selector=${HOSTNAME}
+ if [[ -z "${selector}" ]]; then
+ eerror "Oddly enough, you don't have a HOSTNAME."
+ return 1
+ fi
+ if [[ -f "${ROOT}"etc/opendkim/${selector}.private ]]; then
+ ewarn "The private key for this selector already exists."
+ else
+ keysize=1024
+ # generate the private and public keys
+ opendkim-genkey -b ${keysize} -D "${ROOT}"etc/opendkim/ \
+ -s ${selector} -d '(your domain)' && \
+ chown milter:milter \
+ "${ROOT}"etc/opendkim/"${selector}".private || \
+ { eerror "Failed to create private and public keys." ; return 1; }
+ chmod go-r "${ROOT}"etc/opendkim/"${selector}".private
+ fi
+
+ # opendkim selector configuration
+ echo
+ einfo "Make sure you have the following settings in your /etc/opendkim/opendkim.conf:"
+ einfo " Keyfile /etc/opendkim/${selector}.private"
+ einfo " Selector ${selector}"
+
+ # MTA configuration
+ echo
+ einfo "If you are using Postfix, add following lines to your main.cf:"
+ einfo " smtpd_milters = unix:/var/run/opendkim/opendkim.sock"
+ einfo " non_smtpd_milters = unix:/var/run/opendkim/opendkim.sock"
+ einfo " and read http://www.postfix.org/MILTER_README.html"
+
+ # DNS configuration
+ einfo "After you configured your MTA, publish your key by adding this TXT record to your domain:"
+ cat "${ROOT}"etc/opendkim/${selector}.txt
+ einfo "t=y signifies you only test the DKIM on your domain. See following page for the complete list of tags:"
+ einfo " http://www.dkim.org/specs/rfc4871-dkimbase.html#key-text"
+}
diff --git a/mail-filter/opendkim/opendkim-2.10.3.ebuild b/mail-filter/opendkim/opendkim-2.10.3.ebuild
new file mode 100644
index 00000000000..ec16223826f
--- /dev/null
+++ b/mail-filter/opendkim/opendkim-2.10.3.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools db-use eutils systemd user
+
+# for betas
+#MY_P=${P/_b/.B}
+#S=${WORKDIR}/${PN}-2.8.0
+#SRC_URI="mirror://sourceforge/opendkim/${MY_P}.tar.gz"
+
+DESCRIPTION="A milter-based application to provide DKIM signing and verification"
+HOMEPAGE="http://opendkim.org"
+SRC_URI="mirror://sourceforge/opendkim/${P}.tar.gz"
+
+LICENSE="Sendmail-Open-Source BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="+berkdb gnutls ldap lmdb lua memcached opendbx poll sasl selinux +ssl static-libs unbound"
+
+DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail )
+ dev-libs/libbsd
+ ssl? ( >=dev-libs/openssl-0.9.8:* )
+ berkdb? ( >=sys-libs/db-3.2:* )
+ opendbx? ( >=dev-db/opendbx-1.4.0 )
+ lua? ( dev-lang/lua:* )
+ ldap? ( net-nds/openldap )
+ lmdb? ( dev-db/lmdb )
+ memcached? ( dev-libs/libmemcached )
+ sasl? ( dev-libs/cyrus-sasl )
+ unbound? ( >=net-dns/unbound-1.4.1 net-dns/dnssec-root )
+ !unbound? ( net-libs/ldns )
+ gnutls? ( >=net-libs/gnutls-2.11.7 )"
+
+RDEPEND="${DEPEND}
+ sys-process/psmisc
+ selinux? ( sec-policy/selinux-dkim )
+"
+
+REQUIRED_USE="sasl? ( ldap )"
+
+pkg_setup() {
+ enewgroup milter
+ # mail-milter/spamass-milter creates milter user with this home directory
+ # For consistency reasons, milter user must be created here with this home directory
+ # even though this package doesn't need a home directory for this user (#280571)
+ enewuser milter -1 -1 /var/lib/milter milter
+}
+
+src_prepare() {
+ sed -i -e 's:/var/db/dkim:/etc/opendkim:g' \
+ -e 's:/var/db/opendkim:/var/lib/opendkim:g' \
+ -e 's:/etc/mail:/etc/opendkim:g' \
+ -e 's:mailnull:milter:g' \
+ -e 's:^#[[:space:]]*PidFile.*:PidFile /run/opendkim/opendkim.pid:' \
+ opendkim/opendkim.conf.sample opendkim/opendkim.conf.simple.in \
+ stats/opendkim-reportstats{,.in} || die
+
+ sed -i -e 's:dist_doc_DATA:dist_html_DATA:' libopendkim/docs/Makefile.am \
+ || die
+
+ sed -i -e '/sock.*mt.getcwd/s:mt.getcwd():"/tmp":' opendkim/tests/*.lua
+ sed -i -e '/sock.*mt.getcwd/s:mt.getcwd():"/proc/self/cwd":' opendkim/tests/*.lua
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ if use berkdb ; then
+ myconf=$(db_includedir)
+ myconf="--with-db-incdir=${myconf#-I}"
+ myconf+=" --enable-popauth"
+ myconf+=" --enable-query_cache"
+ myconf+=" --enable-stats"
+ fi
+ if use unbound; then
+ myconf+=" --with-unbound"
+ else
+ myconf+=" --with-ldns"
+ fi
+ if use ldap; then
+ myconf+=" $(use_with sasl)"
+ fi
+ econf \
+ $(use_with berkdb db) \
+ $(use_with opendbx odbx) \
+ $(use_with lua) \
+ $(use_enable lua rbl) \
+ $(use_with ldap openldap) \
+ $(use_with lmdb) \
+ $(use_enable poll) \
+ $(use_enable static-libs static) \
+ $(use_with gnutls) \
+ $(use_with memcached libmemcached) \
+ ${myconf} \
+ --docdir=/usr/share/doc/${PF} \
+ --htmldir=/usr/share/doc/${PF}/html \
+ --enable-filter \
+ --enable-atps \
+ --enable-identity_header \
+ --enable-rate_limit \
+ --enable-resign \
+ --enable-replace_rules \
+ --enable-default_sender \
+ --enable-sender_macro \
+ --enable-vbr \
+ --disable-live-testing
+ #--with-test-socket=/tmp/opendkim-$(echo ${RANDOM})-S
+ #--disable-rpath
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dosbin stats/opendkim-reportstats
+
+ newinitd "${FILESDIR}/opendkim.init.r3" opendkim
+ systemd_dounit "${FILESDIR}/opendkim.service"
+
+ dodir /etc/opendkim /var/lib/opendkim
+ fowners milter:milter /var/lib/opendkim
+
+ # default configuration
+ if [ ! -f "${ROOT}"/etc/opendkim/opendkim.conf ]; then
+ grep ^[^#] "${S}"/opendkim/opendkim.conf.simple \
+ > "${D}"/etc/opendkim/opendkim.conf
+ if use unbound; then
+ echo TrustAnchorFile /etc/dnssec/root-anchors.txt >> "${D}"/etc/opendkim/opendkim.conf
+ fi
+ echo UserID milter >> "${D}"/etc/opendkim/opendkim.conf
+ if use berkdb; then
+ echo Statistics /var/lib/opendkim/stats.dat >> \
+ "${D}"/etc/opendkim/opendkim.conf
+ fi
+ fi
+
+ use static-libs || find "${D}" -name "*.la" -delete
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSION} ]]; then
+ elog "If you want to sign your mail messages and need some help"
+ elog "please run:"
+ elog " emerge --config ${CATEGORY}/${PN}"
+ elog "It will help you create your key and give you hints on how"
+ elog "to configure your DNS and MTA."
+
+ ewarn "Make sure your MTA has r/w access to the socket file."
+ ewarn "This can be done either by setting UMask to 002 and adding MTA's user"
+ ewarn "to milter group or you can simply set UMask to 000."
+ fi
+}
+
+pkg_config() {
+ local selector keysize pubkey
+
+ read -p "Enter the selector name (default ${HOSTNAME}): " selector
+ [[ -n "${selector}" ]] || selector=${HOSTNAME}
+ if [[ -z "${selector}" ]]; then
+ eerror "Oddly enough, you don't have a HOSTNAME."
+ return 1
+ fi
+ if [[ -f "${ROOT}"etc/opendkim/${selector}.private ]]; then
+ ewarn "The private key for this selector already exists."
+ else
+ keysize=1024
+ # generate the private and public keys
+ opendkim-genkey -b ${keysize} -D "${ROOT}"etc/opendkim/ \
+ -s ${selector} -d '(your domain)' && \
+ chown milter:milter \
+ "${ROOT}"etc/opendkim/"${selector}".private || \
+ { eerror "Failed to create private and public keys." ; return 1; }
+ chmod go-r "${ROOT}"etc/opendkim/"${selector}".private
+ fi
+
+ # opendkim selector configuration
+ echo
+ einfo "Make sure you have the following settings in your /etc/opendkim/opendkim.conf:"
+ einfo " Keyfile /etc/opendkim/${selector}.private"
+ einfo " Selector ${selector}"
+
+ # MTA configuration
+ echo
+ einfo "If you are using Postfix, add following lines to your main.cf:"
+ einfo " smtpd_milters = unix:/var/run/opendkim/opendkim.sock"
+ einfo " non_smtpd_milters = unix:/var/run/opendkim/opendkim.sock"
+ einfo " and read http://www.postfix.org/MILTER_README.html"
+
+ # DNS configuration
+ einfo "After you configured your MTA, publish your key by adding this TXT record to your domain:"
+ cat "${ROOT}"etc/opendkim/${selector}.txt
+ einfo "t=y signifies you only test the DKIM on your domain. See following page for the complete list of tags:"
+ einfo " http://www.dkim.org/specs/rfc4871-dkimbase.html#key-text"
+}
diff --git a/mail-filter/opendkim/opendkim-2.9.2-r1.ebuild b/mail-filter/opendkim/opendkim-2.9.2-r1.ebuild
new file mode 100644
index 00000000000..6f7cb7dedb4
--- /dev/null
+++ b/mail-filter/opendkim/opendkim-2.9.2-r1.ebuild
@@ -0,0 +1,197 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools db-use eutils systemd user
+
+# for betas
+#MY_P=${P/_b/.B}
+#S=${WORKDIR}/${PN}-2.8.0
+#SRC_URI="mirror://sourceforge/opendkim/${MY_P}.tar.gz"
+
+DESCRIPTION="A milter-based application to provide DKIM signing and verification"
+HOMEPAGE="http://opendkim.org"
+SRC_URI="mirror://sourceforge/opendkim/${P}.tar.gz"
+
+LICENSE="Sendmail-Open-Source BSD"
+SLOT="0"
+KEYWORDS="amd64 ~arm x86"
+IUSE="+berkdb gnutls ldap lmdb lua memcached opendbx poll sasl selinux +ssl static-libs unbound"
+
+DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail )
+ dev-libs/libbsd
+ ssl? ( >=dev-libs/openssl-0.9.8 )
+ berkdb? ( >=sys-libs/db-3.2 )
+ opendbx? ( >=dev-db/opendbx-1.4.0 )
+ lua? ( dev-lang/lua )
+ ldap? ( net-nds/openldap )
+ lmdb? ( dev-db/lmdb )
+ memcached? ( dev-libs/libmemcached )
+ sasl? ( dev-libs/cyrus-sasl )
+ unbound? ( >=net-dns/unbound-1.4.1 net-dns/dnssec-root )
+ !unbound? ( net-libs/ldns )
+ gnutls? ( >=net-libs/gnutls-2.11.7 )"
+
+RDEPEND="${DEPEND}
+ sys-process/psmisc
+ selinux? ( sec-policy/selinux-dkim )
+"
+
+REQUIRED_USE="sasl? ( ldap )"
+
+pkg_setup() {
+ enewgroup milter
+ # mail-milter/spamass-milter creates milter user with this home directory
+ # For consistency reasons, milter user must be created here with this home directory
+ # even though this package doesn't need a home directory for this user (#280571)
+ enewuser milter -1 -1 /var/lib/milter milter
+}
+
+src_prepare() {
+ sed -i -e 's:/var/db/dkim:/etc/opendkim:g' \
+ -e 's:/var/db/opendkim:/var/lib/opendkim:g' \
+ -e 's:/etc/mail:/etc/opendkim:g' \
+ -e 's:mailnull:milter:g' \
+ -e 's:^#[[:space:]]*PidFile.*:PidFile /var/run/opendkim/opendkim.pid:' \
+ opendkim/opendkim.conf.sample opendkim/opendkim.conf.simple.in \
+ stats/opendkim-reportstats{,.in} || die
+
+ sed -i -e 's:dist_doc_DATA:dist_html_DATA:' libopendkim/docs/Makefile.am \
+ || die
+
+ #sed -i -e '/sock.*mt.getcwd/s:mt.getcwd():"/tmp":' opendkim/tests/*.lua
+ sed -i -e '/sock.*mt.getcwd/s:mt.getcwd():"/proc/self/cwd":' opendkim/tests/*.lua
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ if use berkdb ; then
+ myconf=$(db_includedir)
+ myconf="--with-db-incdir=${myconf#-I}"
+ myconf+=" --enable-popauth"
+ myconf+=" --enable-query_cache"
+ myconf+=" --enable-stats"
+ fi
+ if use unbound; then
+ myconf+=" --with-unbound"
+ else
+ myconf+=" --with-ldns"
+ fi
+ if use ldap; then
+ myconf+=" $(use_with sasl)"
+ fi
+ econf \
+ $(use_with berkdb db) \
+ $(use_with opendbx odbx) \
+ $(use_with lua) \
+ $(use_enable lua rbl) \
+ $(use_with ldap openldap) \
+ $(use_with lmdb) \
+ $(use_enable poll) \
+ $(use_enable static-libs static) \
+ $(use_with gnutls) \
+ $(use_with memcached libmemcached) \
+ ${myconf} \
+ --docdir=/usr/share/doc/${PF} \
+ --htmldir=/usr/share/doc/${PF}/html \
+ --enable-filter \
+ --enable-adsp_lists \
+ --enable-atps \
+ --enable-identity_header \
+ --enable-rate_limit \
+ --enable-resign \
+ --enable-replace_rules \
+ --enable-default_sender \
+ --enable-sender_macro \
+ --enable-vbr \
+ --disable-live-testing
+ #--disable-rpath \
+ #--with-test-socket=/tmp/opendkim-$(echo ${RANDOM})-S
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dosbin stats/opendkim-reportstats
+
+ newinitd "${FILESDIR}/opendkim.init.r3" opendkim
+ systemd_dounit "${FILESDIR}/opendkim.service"
+
+ dodir /etc/opendkim /var/lib/opendkim
+ fowners milter:milter /var/lib/opendkim
+
+ # default configuration
+ if [ ! -f "${ROOT}"/etc/opendkim/opendkim.conf ]; then
+ grep ^[^#] "${S}"/opendkim/opendkim.conf.simple \
+ > "${D}"/etc/opendkim/opendkim.conf
+ if use unbound; then
+ echo TrustAnchorFile /etc/dnssec/root-anchors.txt >> "${D}"/etc/opendkim/opendkim.conf
+ fi
+ echo UserID milter >> "${D}"/etc/opendkim/opendkim.conf
+ if use berkdb; then
+ echo Statistics /var/lib/opendkim/stats.dat >> \
+ "${D}"/etc/opendkim/opendkim.conf
+ fi
+ fi
+
+ use static-libs || find "${D}" -name "*.la" -delete
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSION} ]]; then
+ elog "If you want to sign your mail messages and need some help"
+ elog "please run:"
+ elog " emerge --config ${CATEGORY}/${PN}"
+ elog "It will help you create your key and give you hints on how"
+ elog "to configure your DNS and MTA."
+
+ ewarn "Make sure your MTA has r/w access to the socket file."
+ ewarn "This can be done either by setting UMask to 002 and adding MTA's user"
+ ewarn "to milter group or you can simply set UMask to 000."
+ fi
+}
+
+pkg_config() {
+ local selector keysize pubkey
+
+ read -p "Enter the selector name (default ${HOSTNAME}): " selector
+ [[ -n "${selector}" ]] || selector=${HOSTNAME}
+ if [[ -z "${selector}" ]]; then
+ eerror "Oddly enough, you don't have a HOSTNAME."
+ return 1
+ fi
+ if [[ -f "${ROOT}"etc/opendkim/${selector}.private ]]; then
+ ewarn "The private key for this selector already exists."
+ else
+ keysize=1024
+ # generate the private and public keys
+ opendkim-genkey -b ${keysize} -D "${ROOT}"etc/opendkim/ \
+ -s ${selector} -d '(your domain)' && \
+ chown milter:milter \
+ "${ROOT}"etc/opendkim/"${selector}".private || \
+ { eerror "Failed to create private and public keys." ; return 1; }
+ chmod go-r "${ROOT}"etc/opendkim/"${selector}".private
+ fi
+
+ # opendkim selector configuration
+ echo
+ einfo "Make sure you have the following settings in your /etc/opendkim/opendkim.conf:"
+ einfo " Keyfile /etc/opendkim/${selector}.private"
+ einfo " Selector ${selector}"
+
+ # MTA configuration
+ echo
+ einfo "If you are using Postfix, add following lines to your main.cf:"
+ einfo " smtpd_milters = unix:/var/run/opendkim/opendkim.sock"
+ einfo " non_smtpd_milters = unix:/var/run/opendkim/opendkim.sock"
+ einfo " and read http://www.postfix.org/MILTER_README.html"
+
+ # DNS configuration
+ einfo "After you configured your MTA, publish your key by adding this TXT record to your domain:"
+ cat "${ROOT}"etc/opendkim/${selector}.txt
+ einfo "t=y signifies you only test the DKIM on your domain. See following page for the complete list of tags:"
+ einfo " http://www.dkim.org/specs/rfc4871-dkimbase.html#key-text"
+}
diff --git a/mail-filter/opendkim/opendkim-2.9.3.ebuild b/mail-filter/opendkim/opendkim-2.9.3.ebuild
new file mode 100644
index 00000000000..03b441ca108
--- /dev/null
+++ b/mail-filter/opendkim/opendkim-2.9.3.ebuild
@@ -0,0 +1,197 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools db-use eutils systemd user
+
+# for betas
+#MY_P=${P/_b/.B}
+#S=${WORKDIR}/${PN}-2.8.0
+#SRC_URI="mirror://sourceforge/opendkim/${MY_P}.tar.gz"
+
+DESCRIPTION="A milter-based application to provide DKIM signing and verification"
+HOMEPAGE="http://opendkim.org"
+SRC_URI="mirror://sourceforge/opendkim/${P}.tar.gz"
+
+LICENSE="Sendmail-Open-Source BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="+berkdb gnutls ldap lmdb lua memcached opendbx poll sasl selinux +ssl static-libs unbound"
+
+DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail )
+ dev-libs/libbsd
+ ssl? ( >=dev-libs/openssl-0.9.8 )
+ berkdb? ( >=sys-libs/db-3.2 )
+ opendbx? ( >=dev-db/opendbx-1.4.0 )
+ lua? ( dev-lang/lua )
+ ldap? ( net-nds/openldap )
+ lmdb? ( dev-db/lmdb )
+ memcached? ( dev-libs/libmemcached )
+ sasl? ( dev-libs/cyrus-sasl )
+ unbound? ( >=net-dns/unbound-1.4.1 net-dns/dnssec-root )
+ !unbound? ( net-libs/ldns )
+ gnutls? ( >=net-libs/gnutls-2.11.7 )"
+
+RDEPEND="${DEPEND}
+ sys-process/psmisc
+ selinux? ( sec-policy/selinux-dkim )
+"
+
+REQUIRED_USE="sasl? ( ldap )"
+
+pkg_setup() {
+ enewgroup milter
+ # mail-milter/spamass-milter creates milter user with this home directory
+ # For consistency reasons, milter user must be created here with this home directory
+ # even though this package doesn't need a home directory for this user (#280571)
+ enewuser milter -1 -1 /var/lib/milter milter
+}
+
+src_prepare() {
+ sed -i -e 's:/var/db/dkim:/etc/opendkim:g' \
+ -e 's:/var/db/opendkim:/var/lib/opendkim:g' \
+ -e 's:/etc/mail:/etc/opendkim:g' \
+ -e 's:mailnull:milter:g' \
+ -e 's:^#[[:space:]]*PidFile.*:PidFile /run/opendkim/opendkim.pid:' \
+ opendkim/opendkim.conf.sample opendkim/opendkim.conf.simple.in \
+ stats/opendkim-reportstats{,.in} || die
+
+ sed -i -e 's:dist_doc_DATA:dist_html_DATA:' libopendkim/docs/Makefile.am \
+ || die
+
+ #sed -i -e '/sock.*mt.getcwd/s:mt.getcwd():"/tmp":' opendkim/tests/*.lua
+ sed -i -e '/sock.*mt.getcwd/s:mt.getcwd():"/proc/self/cwd":' opendkim/tests/*.lua
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ if use berkdb ; then
+ myconf=$(db_includedir)
+ myconf="--with-db-incdir=${myconf#-I}"
+ myconf+=" --enable-popauth"
+ myconf+=" --enable-query_cache"
+ myconf+=" --enable-stats"
+ fi
+ if use unbound; then
+ myconf+=" --with-unbound"
+ else
+ myconf+=" --with-ldns"
+ fi
+ if use ldap; then
+ myconf+=" $(use_with sasl)"
+ fi
+ econf \
+ $(use_with berkdb db) \
+ $(use_with opendbx odbx) \
+ $(use_with lua) \
+ $(use_enable lua rbl) \
+ $(use_with ldap openldap) \
+ $(use_with lmdb) \
+ $(use_enable poll) \
+ $(use_enable static-libs static) \
+ $(use_with gnutls) \
+ $(use_with memcached libmemcached) \
+ ${myconf} \
+ --docdir=/usr/share/doc/${PF} \
+ --htmldir=/usr/share/doc/${PF}/html \
+ --enable-filter \
+ --enable-adsp_lists \
+ --enable-atps \
+ --enable-identity_header \
+ --enable-rate_limit \
+ --enable-resign \
+ --enable-replace_rules \
+ --enable-default_sender \
+ --enable-sender_macro \
+ --enable-vbr \
+ --disable-live-testing
+ #--disable-rpath \
+ #--with-test-socket=/tmp/opendkim-$(echo ${RANDOM})-S
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dosbin stats/opendkim-reportstats
+
+ newinitd "${FILESDIR}/opendkim.init.r3" opendkim
+ systemd_dounit "${FILESDIR}/opendkim.service"
+
+ dodir /etc/opendkim /var/lib/opendkim
+ fowners milter:milter /var/lib/opendkim
+
+ # default configuration
+ if [ ! -f "${ROOT}"/etc/opendkim/opendkim.conf ]; then
+ grep ^[^#] "${S}"/opendkim/opendkim.conf.simple \
+ > "${D}"/etc/opendkim/opendkim.conf
+ if use unbound; then
+ echo TrustAnchorFile /etc/dnssec/root-anchors.txt >> "${D}"/etc/opendkim/opendkim.conf
+ fi
+ echo UserID milter >> "${D}"/etc/opendkim/opendkim.conf
+ if use berkdb; then
+ echo Statistics /var/lib/opendkim/stats.dat >> \
+ "${D}"/etc/opendkim/opendkim.conf
+ fi
+ fi
+
+ use static-libs || find "${D}" -name "*.la" -delete
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSION} ]]; then
+ elog "If you want to sign your mail messages and need some help"
+ elog "please run:"
+ elog " emerge --config ${CATEGORY}/${PN}"
+ elog "It will help you create your key and give you hints on how"
+ elog "to configure your DNS and MTA."
+
+ ewarn "Make sure your MTA has r/w access to the socket file."
+ ewarn "This can be done either by setting UMask to 002 and adding MTA's user"
+ ewarn "to milter group or you can simply set UMask to 000."
+ fi
+}
+
+pkg_config() {
+ local selector keysize pubkey
+
+ read -p "Enter the selector name (default ${HOSTNAME}): " selector
+ [[ -n "${selector}" ]] || selector=${HOSTNAME}
+ if [[ -z "${selector}" ]]; then
+ eerror "Oddly enough, you don't have a HOSTNAME."
+ return 1
+ fi
+ if [[ -f "${ROOT}"etc/opendkim/${selector}.private ]]; then
+ ewarn "The private key for this selector already exists."
+ else
+ keysize=1024
+ # generate the private and public keys
+ opendkim-genkey -b ${keysize} -D "${ROOT}"etc/opendkim/ \
+ -s ${selector} -d '(your domain)' && \
+ chown milter:milter \
+ "${ROOT}"etc/opendkim/"${selector}".private || \
+ { eerror "Failed to create private and public keys." ; return 1; }
+ chmod go-r "${ROOT}"etc/opendkim/"${selector}".private
+ fi
+
+ # opendkim selector configuration
+ echo
+ einfo "Make sure you have the following settings in your /etc/opendkim/opendkim.conf:"
+ einfo " Keyfile /etc/opendkim/${selector}.private"
+ einfo " Selector ${selector}"
+
+ # MTA configuration
+ echo
+ einfo "If you are using Postfix, add following lines to your main.cf:"
+ einfo " smtpd_milters = unix:/var/run/opendkim/opendkim.sock"
+ einfo " non_smtpd_milters = unix:/var/run/opendkim/opendkim.sock"
+ einfo " and read http://www.postfix.org/MILTER_README.html"
+
+ # DNS configuration
+ einfo "After you configured your MTA, publish your key by adding this TXT record to your domain:"
+ cat "${ROOT}"etc/opendkim/${selector}.txt
+ einfo "t=y signifies you only test the DKIM on your domain. See following page for the complete list of tags:"
+ einfo " http://www.dkim.org/specs/rfc4871-dkimbase.html#key-text"
+}
diff --git a/mail-filter/opendmarc/Manifest b/mail-filter/opendmarc/Manifest
new file mode 100644
index 00000000000..c05ad3bd58c
--- /dev/null
+++ b/mail-filter/opendmarc/Manifest
@@ -0,0 +1,3 @@
+DIST opendmarc-1.1.3.tar.gz 586574 SHA256 4f9511ebd8cefb6e5a4d836f6285a1b6e4d682daec79fdba9fc7925b5f4fcfca SHA512 30de56b6da1665e0ed68484702bfcfcbd0b65275053818c807c16dea26f0e014a0484dc9d5ed6d1405628ea22a61082f13cecf66714a414139f612c51a294086 WHIRLPOOL 7364dfd213fb05f1d58eecb940a95eb1328b78204c0a12a341a0a6cdf48aa8c638b0e4e4ed0c7fa51e72fb11ab68da386050124741a8215c4aec788b7da0d8b2
+DIST opendmarc-1.3.0.tar.gz 640017 SHA256 43547c5bcd440e1a50109063ba1d07bd5b1b9af89f7491e063fe0788a1af13e8 SHA512 c685cae0e02a72b797f24a28b9965f8745f165a3ce3a8f3f2e0167ebf6121e92389990870271204ca02b06703f4ad98c6d343345478040f7fc4013b1ce331b03 WHIRLPOOL 80d9720c1e52c4d9d7f35a89d58075108b5011f0c4fdafc24733a648eb926c0373f617e3cdb76bc1ea19ff8074d4b63425fb06129849ec521f861d28cea83295
+DIST opendmarc-1.3.1.tar.gz 640151 SHA256 a0c0cf74de68454cbdce16a3095b96e70fc16614325052ea230878d1ca64da6b SHA512 0be11540bc26bd3b3e6cc9817bc379a5d290b63ef16c5d3559bf96b241ad6628bea7a9daeb468afac855bc16be16676f722b3c1d468ea82c8d8364e8a8137226 WHIRLPOOL 2a892d1dbe46ec9fb3fd5aad3b5f38046c9f4be6a5ee6dcdf4e0f03cd09b663243844010db0d328fef361a0615284256ba649714a79ecc9970797aa01101631d
diff --git a/mail-filter/opendmarc/files/opendmarc.confd b/mail-filter/opendmarc/files/opendmarc.confd
new file mode 100644
index 00000000000..ef59affa3f8
--- /dev/null
+++ b/mail-filter/opendmarc/files/opendmarc.confd
@@ -0,0 +1,3 @@
+# user/group to run opendmarc daemon as
+OPENDMARC_USER=milter
+OPENDMARC_GROUP=milter
diff --git a/mail-filter/opendmarc/files/opendmarc.initd b/mail-filter/opendmarc/files/opendmarc.initd
new file mode 100644
index 00000000000..d70afd75e72
--- /dev/null
+++ b/mail-filter/opendmarc/files/opendmarc.initd
@@ -0,0 +1,51 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+CONFFILE="/etc/opendmarc/${SVCNAME}.conf"
+
+depend() {
+ use dns logger net
+ before mta
+}
+
+check_cfg() {
+ if [ ! -f "${CONFFILE}" ] ; then
+ eerror "Configuration file ${CONFFILE} is missing"
+ return 1
+ fi
+ PIDFILE=$(sed -ne 's/^[[:space:]]*PidFile[[:space:]]\+//p' "${CONFFILE}")
+ local PIDDIR="${PIDFILE%/*}"
+ if [ ! -d "${PIDDIR}" ] ; then
+ checkpath -q -d -o ${OPENDMARC_USER}:${OPENDMARC_GROUP} -m 0755 "${PIDDIR}" || return 1
+ fi
+ if [ -z "${PIDFILE}" ] ; then
+ eerror "Configuration file needs PidFile setting - recommend adding 'PidFile /var/run/opendmarc/${SVCNAME}.pid' to ${CONFFILE}"
+ return 1
+ fi
+ if egrep -q '^[[:space:]]*Background[[:space:]]+false' "${CONFFILE}" ; then
+ eerror "${SVCNAME} service cannot run with Background key set to false!"
+ return 1
+ fi
+
+ ebegin "Checking your configfile (${CONFFILE})"
+ opendmarc -c "${CONFFILE}" -n
+ eend $? "Configuration error. Please fix your configfile (${CONFFILE})"
+}
+
+start() {
+ check_cfg || return 1
+
+ ebegin "Starting OpenDMARC"
+ start-stop-daemon --start --pidfile "${PIDFILE}" \
+ --exec /usr/sbin/opendmarc -- -c "${CONFFILE}"
+ eend $?
+}
+
+stop() {
+ check_cfg || return 1
+ ebegin "Stopping OpenDMARC"
+ start-stop-daemon --stop --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/mail-filter/opendmarc/metadata.xml b/mail-filter/opendmarc/metadata.xml
new file mode 100644
index 00000000000..62881648821
--- /dev/null
+++ b/mail-filter/opendmarc/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <maintainer>
+ <email>grobian@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">opendmarc</remote-id>
+ </upstream>
+ <use>
+ <flag name='spf'>Use the <pkg>mail-filter/libspf2</pkg>
+ for Sender Policy Framework checking</flag>
+ </use>
+</pkgmetadata>
diff --git a/mail-filter/opendmarc/opendmarc-1.1.3.ebuild b/mail-filter/opendmarc/opendmarc-1.1.3.ebuild
new file mode 100644
index 00000000000..1060ccf3957
--- /dev/null
+++ b/mail-filter/opendmarc/opendmarc-1.1.3.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Open source DMARC implementation "
+HOMEPAGE="http://www.trusteddomain.org/opendmarc/"
+SRC_URI="mirror://sourceforge/opendmarc/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd"
+IUSE=""
+
+DEPEND="dev-perl/DBI
+ || ( mail-filter/libmilter mail-mta/sendmail )"
+RDEPEND="${DEPEND}
+ dev-perl/Switch"
+
+src_configure() {
+ econf \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
+}
diff --git a/mail-filter/opendmarc/opendmarc-1.3.0.ebuild b/mail-filter/opendmarc/opendmarc-1.3.0.ebuild
new file mode 100644
index 00000000000..e890ce05a5d
--- /dev/null
+++ b/mail-filter/opendmarc/opendmarc-1.3.0.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit user
+
+DESCRIPTION="Open source DMARC implementation "
+HOMEPAGE="http://www.trusteddomain.org/opendmarc/"
+SRC_URI="mirror://sourceforge/opendmarc/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~x86 ~x86-fbsd"
+IUSE="spf"
+
+DEPEND="dev-perl/DBI
+ || ( mail-filter/libmilter mail-mta/sendmail )"
+RDEPEND="${DEPEND}
+ dev-perl/Switch
+ spf? ( mail-filter/libspf2 )"
+
+pkg_setup() {
+ enewgroup milter
+ enewuser milter -1 -1 /var/lib/milter milter
+}
+
+src_configure() {
+ econf \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ $(use_with spf)
+}
+
+src_install() {
+ default
+
+ newinitd "${FILESDIR}"/opendmarc.initd opendmarc
+ newconfd "${FILESDIR}"/opendmarc.confd opendmarc
+
+ dodir /etc/opendmarc
+ dodir /var/run/opendmarc
+ fowners milter:milter /var/run/opendmarc
+
+ # create config file
+ sed \
+ -e 's/^# UserID .*$/UserID milter/' \
+ -e 's/^# PidFile .*/PidFile \/var\/run\/opendmarc\/opendmarc.pid/' \
+ -e '/^# Socket /s/^# //' \
+ "${S}"/opendmarc/opendmarc.conf.sample \
+ > "${ED}"/etc/opendmarc/opendmarc.conf \
+ || die
+}
diff --git a/mail-filter/opendmarc/opendmarc-1.3.1.ebuild b/mail-filter/opendmarc/opendmarc-1.3.1.ebuild
new file mode 100644
index 00000000000..e890ce05a5d
--- /dev/null
+++ b/mail-filter/opendmarc/opendmarc-1.3.1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit user
+
+DESCRIPTION="Open source DMARC implementation "
+HOMEPAGE="http://www.trusteddomain.org/opendmarc/"
+SRC_URI="mirror://sourceforge/opendmarc/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~x86 ~x86-fbsd"
+IUSE="spf"
+
+DEPEND="dev-perl/DBI
+ || ( mail-filter/libmilter mail-mta/sendmail )"
+RDEPEND="${DEPEND}
+ dev-perl/Switch
+ spf? ( mail-filter/libspf2 )"
+
+pkg_setup() {
+ enewgroup milter
+ enewuser milter -1 -1 /var/lib/milter milter
+}
+
+src_configure() {
+ econf \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ $(use_with spf)
+}
+
+src_install() {
+ default
+
+ newinitd "${FILESDIR}"/opendmarc.initd opendmarc
+ newconfd "${FILESDIR}"/opendmarc.confd opendmarc
+
+ dodir /etc/opendmarc
+ dodir /var/run/opendmarc
+ fowners milter:milter /var/run/opendmarc
+
+ # create config file
+ sed \
+ -e 's/^# UserID .*$/UserID milter/' \
+ -e 's/^# PidFile .*/PidFile \/var\/run\/opendmarc\/opendmarc.pid/' \
+ -e '/^# Socket /s/^# //' \
+ "${S}"/opendmarc/opendmarc.conf.sample \
+ > "${ED}"/etc/opendmarc/opendmarc.conf \
+ || die
+}
diff --git a/mail-filter/opensmtpd-extras/Manifest b/mail-filter/opensmtpd-extras/Manifest
new file mode 100644
index 00000000000..771b5137a43
--- /dev/null
+++ b/mail-filter/opensmtpd-extras/Manifest
@@ -0,0 +1 @@
+DIST opensmtpd-extras-201506020835.tar.gz 159567 SHA256 47dfc47dd6ad56b15707dcfb592ebe04e39f107a44076e0ab969b6d940eec84e SHA512 b4eef315a7c44166ec36c821a0113cf0f448125fce4773b9d748b34507cde71b131195b81237e6efe5a209817d770a76050b5538c21349900ee2d13cfa1b5f5f WHIRLPOOL 2b35b4a8c2855bd9110ee639f5d6e269f4fd393483f58bce09ab65c188677ca81abba3cd55a65a16cefd0a15a15bcf59f5c53f5ff11f9773a542d18b0858d6cf
diff --git a/mail-filter/opensmtpd-extras/metadata.xml b/mail-filter/opensmtpd-extras/metadata.xml
new file mode 100644
index 00000000000..cf2a746f5d1
--- /dev/null
+++ b/mail-filter/opensmtpd-extras/metadata.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <longdescription lang="en">
+Extras filters, tables, and other extensions for mail-mta/opensmtpd.
+</longdescription>
+ <maintainer>
+ <email>zx2c4@gentoo.org</email>
+ <name>Jason A. Donenfeld</name>
+ </maintainer>
+ <use>
+ <flag name="filter-clamav">filter for scanning with app-antivirus/clamav</flag>
+ <flag name="filter-dkim-signer">filter for adding DKIM signatures to outgoing messages</flag>
+ <flag name="filter-dnsbl">filter for checking hosts against the DNS black lists</flag>
+ <flag name="filter-lua">filter for interfacing with dev-lang/lua</flag>
+ <flag name="filter-monkey">filter for arbitrarily rejecting random emails</flag>
+ <flag name="filter-pause">filter to pause on new connections</flag>
+ <flag name="filter-perl">filter for interfacing with dev-lang/perl</flag>
+ <flag name="filter-python">filter for interfacing with dev-lang/python</flag>
+ <flag name="filter-regex">filter for regular expression matching</flag>
+ <flag name="filter-spamassassin">filter for scanning with mail-filter/spamassassin</flag>
+ <flag name="filter-stub">stub filter</flag>
+ <flag name="filter-trace">trace filter</flag>
+ <flag name="filter-void">void filter</flag>
+ <flag name="queue-null">null queue</flag>
+ <flag name="queue-python">queue for interfacing with dev-lang/python</flag>
+ <flag name="queue-ram">ram queue</flag>
+ <flag name="queue-stub">stub queue</flag>
+ <flag name="table-ldap">table for lookups with net-nds/openldap</flag>
+ <flag name="table-mysql">table for lookups with virtual/mysql</flag>
+ <flag name="table-postgres">table for lookups with dev-db/postgresql</flag>
+ <flag name="table-redis">table for lookups with dev-db/redis</flag>
+ <flag name="table-socketmap">table for lookups using a socket map</flag>
+ <flag name="table-passwd">table for lookups using /etc/passwd</flag>
+ <flag name="table-python">table for interfacing with dev-lang/python</flag>
+ <flag name="table-sqlite">table for lookups with dev-db/sqlite3</flag>
+ <flag name="table-stub">stub table</flag>
+ <flag name="scheduler-ram">ram scheduler</flag>
+ <flag name="scheduler-stub">stub scheduler</flag>
+ <flag name="scheduler-python">schedulre for interfacing with python</flag>
+ <flag name="luajit">Use JIT for Lua via dev-lang/luajit instead of dev-lang/lua</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">OpenSMTPD/OpenSMTPD-extras</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/opensmtpd-extras/opensmtpd-extras-5.4.5.201506020835.ebuild b/mail-filter/opensmtpd-extras/opensmtpd-extras-5.4.5.201506020835.ebuild
new file mode 100644
index 00000000000..ba9ec00defa
--- /dev/null
+++ b/mail-filter/opensmtpd-extras/opensmtpd-extras-5.4.5.201506020835.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit versionator eutils flag-o-matic autotools
+
+DESCRIPTION="Extra tables, filters, and various other addons for OpenSMTPD"
+HOMEPAGE="https://github.com/OpenSMTPD/OpenSMTPD-extras"
+SRC_URI="https://www.opensmtpd.org/archives/${PN}-$(get_version_component_range 4-).tar.gz"
+
+LICENSE="ISC BSD BSD-1 BSD-2 BSD-4"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+MY_COMPONENTS="
+ filter-clamav
+ filter-dkim-signer
+ filter-dnsbl
+ filter-lua
+ filter-monkey
+ filter-pause
+ filter-perl
+ filter-python
+ filter-regex
+ filter-spamassassin
+ filter-stub
+ filter-trace
+ filter-void
+
+ queue-null
+ queue-python
+ queue-ram
+ queue-stub
+
+ table-ldap
+ table-mysql
+ table-postgres
+ table-redis
+ table-socketmap
+ table-passwd
+ table-python
+ table-sqlite
+ table-stub
+
+ scheduler-ram
+ scheduler-stub
+ scheduler-python
+"
+IUSE="${MY_COMPONENTS} luajit"
+
+# Deps:
+# mysql needs -lmysqlclient
+# sqlite needs -lsqlite3
+# redis needs -lhiredis
+# postgres requires -lpq
+# ldap uses internal library and requires no deps
+# spamassassin uses internal library and requires no deps
+# clamav uses internal library and requires no deps
+# dnsbl needs -lasr
+# python requires python, currently pegged at 2.7
+# lua requires any lua version
+
+DEPEND="mail-mta/opensmtpd dev-libs/libevent dev-libs/openssl
+ filter-python? ( dev-lang/python:2.7 )
+ filter-perl? ( dev-lang/perl )
+ filter-lua? ( luajit? ( dev-lang/luajit ) !luajit? ( dev-lang/lua ) )
+ filter-dnsbl? ( net-libs/libasr )
+ table-sqlite? ( dev-db/sqlite:3 )
+ table-mysql? ( virtual/mysql )
+ table-postgres? ( dev-db/postgresql )
+ table-redis? ( dev-libs/hiredis )
+ table-python? ( dev-lang/python:2.7 )
+ scheduler-python? ( dev-lang/python:2.7 )
+ queue-python? ( dev-lang/python:2.7 )
+"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${PN}-$(get_version_component_range 4-)
+
+src_prepare() {
+ eautoreconf
+}
+src_configure() {
+ econf \
+ --with-privsep-user=smtpd \
+ --with-privsep-path=/var/empty \
+ --sysconfdir=/etc/opensmtpd \
+ --with-lua-type=$(usex luajit luajit lua) \
+ $(for use in $MY_COMPONENTS; do use_with $use; done)
+}
diff --git a/mail-filter/p3scan/Manifest b/mail-filter/p3scan/Manifest
new file mode 100644
index 00000000000..7cd734a87dd
--- /dev/null
+++ b/mail-filter/p3scan/Manifest
@@ -0,0 +1,2 @@
+DIST p3scan-2.3.1.tar.gz 315677 SHA256 2c51185caddde414de13f7de9b94986145a6519deac1de655f38538113122329
+DIST p3scan-2.3.2.tar.gz 321684 SHA256 570bdf87132b23120339e247809dc2cf37c2735d504f4e1072528c04d940bb5f SHA512 7504e988ca21760ea73f3ae41d9ec79c560da29e88ac849b671e4452e426cb8ca5065fe8de5b839299bd5da81e16f51951748a134a1737502f924c89867b75b7 WHIRLPOOL 852cd76b92656bc89d9f8c8e8890c2ee58e7d9f9019537ddde74831bcfd675883571a15778d57b25f2c46fe7c40dfe429592d7943e975fb35185894a0b296dbe
diff --git a/mail-filter/p3scan/files/p3scan-ocreat.patch b/mail-filter/p3scan/files/p3scan-ocreat.patch
new file mode 100644
index 00000000000..c99bc88a0a5
--- /dev/null
+++ b/mail-filter/p3scan/files/p3scan-ocreat.patch
@@ -0,0 +1,11 @@
+--- p3scan.c 2005-12-12 15:00:00.000000000 +0000
++++ p3scan.c 2009-03-06 02:34:13.000000000 +0000
+@@ -366,7 +366,7 @@
+ XXXXXX[4] = letters[v % 62];
+ v /= 62;
+ XXXXXX[5] = letters[v % 62];
+- fd=open(template, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | O_SYNC, 0600);
++ fd=open(template, O_RDWR | O_CREAT | O_EXCL | O_SYNC, 0600);
+ if (fd >= 0){
+ errno = save_errno;
+ return fd;
diff --git a/mail-filter/p3scan/files/p3scan.init b/mail-filter/p3scan/files/p3scan.init
new file mode 100644
index 00000000000..8918ba0624f
--- /dev/null
+++ b/mail-filter/p3scan/files/p3scan.init
@@ -0,0 +1,28 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting p3scan"
+ start-stop-daemon --start --quiet --pidfile /var/run/p3scan/p3scan.pid --exec /usr/sbin/p3scan
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping p3scan"
+ start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/p3scan/p3scan.pid
+ eend $?
+}
+
+restart() {
+ ebegin "Restarting p3scan"
+ svc_stop
+ sleep 1
+ svc_start
+ eend $?
+}
diff --git a/mail-filter/p3scan/files/p3scan.init-r1 b/mail-filter/p3scan/files/p3scan.init-r1
new file mode 100644
index 00000000000..ab0e1a0fb1e
--- /dev/null
+++ b/mail-filter/p3scan/files/p3scan.init-r1
@@ -0,0 +1,35 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use net
+}
+
+checkconfig() {
+ if [[ ! -d /var/run/p3scan ]] ; then
+ checkpath -q -d -m 0700 -o mail:mail /var/run/p3scan || return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting p3scan"
+ start-stop-daemon --start --quiet --pidfile /var/run/p3scan/p3scan.pid --exec /usr/sbin/p3scan
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping p3scan"
+ start-stop-daemon --stop --quiet --pidfile /var/run/p3scan/p3scan.pid
+ eend $?
+}
+
+restart() {
+ ebegin "Restarting p3scan"
+ svc_stop
+ sleep 1
+ svc_start
+ eend $?
+}
diff --git a/mail-filter/p3scan/metadata.xml b/mail-filter/p3scan/metadata.xml
new file mode 100644
index 00000000000..4ace1cd8cde
--- /dev/null
+++ b/mail-filter/p3scan/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <longdescription>P3Scan is a fully transparent scanning proxy-server for POP3-Clients. It provides scanning of incoming email messages for Virus''s, Worms, Trojans, Spam, and harmfull attachments. It can also parse HTML messages.</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">p3scan</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/p3scan/p3scan-2.3.1.ebuild b/mail-filter/p3scan/p3scan-2.3.1.ebuild
new file mode 100644
index 00000000000..81ae625497d
--- /dev/null
+++ b/mail-filter/p3scan/p3scan-2.3.1.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils user
+
+DESCRIPTION="This is a full-transparent proxy-server for POP3-Clients"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+HOMEPAGE="http://p3scan.sf.net/"
+
+DEPEND="net-mail/ripmime
+ dev-libs/libpcre"
+RDEPEND="net-firewall/iptables"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~ppc x86"
+IUSE=""
+
+src_compile() {
+ emake || die
+}
+
+src_install () {
+ newinitd ${FILESDIR}/${PN}.init ${PN}
+
+ dosbin ${PN} || die
+
+ dodir /etc/${PN}
+ insinto /etc/${PN}
+ doins ${PN}.conf ${PN}-*.mail
+ doins ${PN}-*.mail
+
+ keepdir /var/run/${PN}
+
+ keepdir /var/spool/${PN}
+ keepdir /var/spool/${PN}/children
+ keepdir /var/spool/${PN}/notify
+
+ fowners mail:mail /var/run/${PN}
+ fperms 700 /var/run/${PN}
+
+ fowners mail:mail /var/spool/${PN}
+ fperms 700 /var/spool/${PN}
+
+ fowners mail:mail /var/spool/${PN}/children
+ fperms 700 /var/spool/${PN}/children
+
+ fowners mail:mail /var/spool/${PN}/notify
+ fperms 700 /var/spool/${PN}/notify
+
+ doman p3scan.8.gz p3scan_readme.8.gz
+
+ dodoc AUTHORS CHANGELOG CONTRIBUTERS LICENSE NEWS README \
+ README-rpm spamfaq.* TODO.list
+}
+
+pkg_postinst() {
+ enewuser mail 8 /bin/true /var/spool/mail mail
+
+ if [ ! -L /etc/${PN}/${PN}.mail ]; then
+ ln -sf /etc/${PN}/${PN}-en.mail /etc/${PN}/${PN}.mail
+ fi
+
+ echo
+ elog "Default infected notification template language is set to english, change the"
+ elog "symbolic link /etc/${PN}/${PN}.mail if you want it in another language."
+ elog
+ elog "To start ${PN}, you can use /etc/init.d/${PN} start"
+ elog
+ elog "You need port-redirecting, a rule like:"
+ elog " iptables -t nat -A PREROUTING -p tcp -i eth0 --dport pop3 -j REDIRECT --to 8110"
+ elog "to forward pop3 connections incoming from eth0 interface."
+ elog
+ elog "You will also need to configure at least following in /etc/${PN}/${PN}.conf:"
+ elog "scannertype, scanner, virusregexp"
+ echo
+}
diff --git a/mail-filter/p3scan/p3scan-2.3.2-r1.ebuild b/mail-filter/p3scan/p3scan-2.3.2-r1.ebuild
new file mode 100644
index 00000000000..06ea1c1709b
--- /dev/null
+++ b/mail-filter/p3scan/p3scan-2.3.2-r1.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils toolchain-funcs user
+
+DESCRIPTION="This is a full-transparent proxy-server for POP3-Clients"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+HOMEPAGE="http://p3scan.sf.net/"
+
+# Older ripmime did not install a library
+DEPEND="dev-libs/libpcre
+ >=net-mail/ripmime-1.4.0.9
+ "
+RDEPEND="net-firewall/iptables"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}/p3scan-ocreat.patch"
+
+ # respect CC (bug #244144), and CFLAGS (bug #240786)
+ sed -i \
+ -e "s/gcc/$(tc-getCC)/" \
+ -e "s:^CFLAGS=-Wall -O2 :CFLAGS=${CFLAGS} :" \
+ -e '/^LDFLAGS=/d' \
+ -e '/^ripmime\/libripmime/,+7d' \
+ -e '/^\.c\.o:/,+3d' \
+ -e '$ap3scan: LDLIBS:=-lripmime -lpcre -lssl -lcrypto\np3scan: $(OBJECTS)' \
+ Makefile || die
+ # Be sure the system copy is used
+ rm -rf ripmime/
+}
+
+src_compile() {
+ emake || die
+}
+
+src_install () {
+ newinitd "${FILESDIR}"/${PN}.init ${PN}
+
+ dosbin ${PN} || die
+
+ dodir /etc/${PN}
+ insinto /etc/${PN}
+ doins ${PN}.conf ${PN}-*.mail
+ doins ${PN}-*.mail
+
+ keepdir /var/run/${PN}
+
+ keepdir /var/spool/${PN}
+ keepdir /var/spool/${PN}/children
+ keepdir /var/spool/${PN}/notify
+
+ fowners mail:mail /var/run/${PN}
+ fperms 700 /var/run/${PN}
+
+ fowners mail:mail /var/spool/${PN}
+ fperms 700 /var/spool/${PN}
+
+ fowners mail:mail /var/spool/${PN}/children
+ fperms 700 /var/spool/${PN}/children
+
+ fowners mail:mail /var/spool/${PN}/notify
+ fperms 700 /var/spool/${PN}/notify
+
+ doman p3scan.8.gz p3scan_readme.8.gz
+
+ dodoc AUTHORS CHANGELOG CONTRIBUTERS NEWS README \
+ README-rpm TODO.list p3scan.sh spamfaq.*
+}
+
+pkg_postinst() {
+ enewuser mail 8 /bin/true /var/spool/mail mail
+
+ if [ ! -L /etc/${PN}/${PN}.mail ]; then
+ ln -sf /etc/${PN}/${PN}-en.mail /etc/${PN}/${PN}.mail
+ fi
+
+ echo
+ elog "Default infected notification template language is set to english, change the"
+ elog "symbolic link /etc/${PN}/${PN}.mail if you want it in another language."
+ elog
+ elog "To start ${PN}, you can use /etc/init.d/${PN} start"
+ elog
+ elog "You need port-redirecting, a rule like:"
+ elog " iptables -t nat -A PREROUTING -p tcp -i eth0 --dport pop3 -j REDIRECT --to 8110"
+ elog "to forward pop3 connections incoming from eth0 interface."
+ elog
+ elog "You will need to configure at least following in /etc/${PN}/${PN}.conf:"
+ elog "scannertype, scanner, virusregexp"
+ elog
+ elog "An example scanner script has been installed to:"
+ elog "/usr/share/doc/${PF}/"
+ echo
+}
diff --git a/mail-filter/p3scan/p3scan-2.3.2-r2.ebuild b/mail-filter/p3scan/p3scan-2.3.2-r2.ebuild
new file mode 100644
index 00000000000..f909832aca2
--- /dev/null
+++ b/mail-filter/p3scan/p3scan-2.3.2-r2.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs user
+
+DESCRIPTION="This is a full-transparent proxy-server for POP3-Clients"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+HOMEPAGE="http://p3scan.sf.net/"
+
+# Older ripmime did not install a library
+DEPEND="dev-libs/libpcre
+ >=net-mail/ripmime-1.4.0.9
+ >=net-mail/mailbase-1
+ "
+RDEPEND="net-firewall/iptables
+ sys-apps/openrc"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}/p3scan-ocreat.patch"
+
+ # respect CC (bug #244144), and CFLAGS (bug #240786)
+ sed -i \
+ -e "s/gcc/$(tc-getCC)/" \
+ -e "s:^CFLAGS=-Wall -O2 :CFLAGS=${CFLAGS} :" \
+ -e '/^LDFLAGS=/d' \
+ -e '/^ripmime\/libripmime/,+7d' \
+ -e '/^\.c\.o:/,+3d' \
+ -e '$ap3scan: LDLIBS:=-lripmime -lpcre -lssl -lcrypto\np3scan: $(OBJECTS)' \
+ Makefile || die
+ # Be sure the system copy is used
+ rm -rf ripmime/
+}
+
+src_install () {
+ newinitd "${FILESDIR}"/${PN}.init-r1 ${PN}
+
+ dosbin ${PN}
+
+ dodir /etc/${PN}
+ insinto /etc/${PN}
+ doins ${PN}.conf ${PN}-*.mail
+ doins ${PN}-*.mail
+
+ keepdir /var/spool/${PN}
+ keepdir /var/spool/${PN}/children
+ keepdir /var/spool/${PN}/notify
+
+ fowners mail:mail /var/spool/${PN}
+ fperms 700 /var/spool/${PN}
+
+ fowners mail:mail /var/spool/${PN}/children
+ fperms 700 /var/spool/${PN}/children
+
+ fowners mail:mail /var/spool/${PN}/notify
+ fperms 700 /var/spool/${PN}/notify
+
+ doman p3scan.8.gz p3scan_readme.8.gz
+
+ dodoc AUTHORS CHANGELOG CONTRIBUTERS NEWS README \
+ README-rpm TODO.list p3scan.sh spamfaq.*
+}
+
+pkg_postinst() {
+ if [ ! -L /etc/${PN}/${PN}.mail ]; then
+ ln -sf /etc/${PN}/${PN}-en.mail /etc/${PN}/${PN}.mail || die
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]] ; then
+ echo
+ elog "Default infected notification template language is set to english, change the"
+ elog "symbolic link /etc/${PN}/${PN}.mail if you want it in another language."
+ elog
+ elog "To start ${PN}, you can use /etc/init.d/${PN} start"
+ elog
+ elog "You need port-redirecting, a rule like:"
+ elog " iptables -t nat -A PREROUTING -p tcp -i eth0 --dport pop3 -j REDIRECT --to 8110"
+ elog "to forward pop3 connections incoming from eth0 interface."
+ elog
+ elog "You will need to configure at least following in /etc/${PN}/${PN}.conf:"
+ elog "scannertype, scanner, virusregexp"
+ elog
+ elog "An example scanner script has been installed to:"
+ elog "/usr/share/doc/${PF}/"
+ echo
+ fi
+}
diff --git a/mail-filter/policyd-weight/Manifest b/mail-filter/policyd-weight/Manifest
new file mode 100644
index 00000000000..81a735fd885
--- /dev/null
+++ b/mail-filter/policyd-weight/Manifest
@@ -0,0 +1 @@
+DIST policyd-weight-0.1.15.2.tar.gz 75347 SHA256 7aee2b5b71a89dd774d8dfff761e0ddc7910b38dbe42f895ca21e8af7a30bb42 SHA512 37702762c171b208d37651b2051b521e4f44708b7bb7e0d3001fd2ba123b227c847bad8dd479d7a56f9aeab02fdfd957d34b2c4d7f3a9fd727614cd4031f8b78 WHIRLPOOL 0f606e509ef2f1b8c4b049e5fe45a7c52ebaac64af5b6928b6e1f0fc4e8ff520f724d871124590147993c20315c6d43e4c210abae3e67986fa15134666a3a404
diff --git a/mail-filter/policyd-weight/files/policyd-weight.init.d-r1 b/mail-filter/policyd-weight/files/policyd-weight.init.d-r1
new file mode 100644
index 00000000000..ffcc17a82b0
--- /dev/null
+++ b/mail-filter/policyd-weight/files/policyd-weight.init.d-r1
@@ -0,0 +1,29 @@
+#!/sbin/runscript
+
+extra_started_commands="reload"
+
+daemon="policyd-weight"
+exec="/usr/libexec/postfix/policyd-weight"
+
+depend(){
+ before postfix
+ use net
+}
+
+start(){
+ ebegin "Starting ${daemon}"
+ ${exec} start
+ eend $?
+}
+
+stop(){
+ ebegin "Stopping ${daemon}"
+ ${exec} -k stop
+ eend $?
+}
+
+reload(){
+ ebegin "Reloading ${daemon}"
+ ${exec} reload
+ eend $?
+}
diff --git a/mail-filter/policyd-weight/metadata.xml b/mail-filter/policyd-weight/metadata.xml
new file mode 100644
index 00000000000..84785fb4e4f
--- /dev/null
+++ b/mail-filter/policyd-weight/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <longdescription lang="en">
+ policyd-weight is a Perl policy daemon for the Postfix MTA (2.1 and
+ later) intended to eliminate forged envelope senders and HELOs (i.e. in
+ bogus mails). It allows you to score DNSBLs (RBL/RHSBL), HELO, MAIL
+ FROM and client IP addresses before any queuing is done. It allows you
+ to REJECT messages which have a score higher than allowed, providing
+ improved blocking of spam and virus mails. policyd-weight caches the
+ most frequent client/sender combinations (SPAM as well as HAM) to reduce
+ the number of DNS queries.
+ </longdescription>
+</pkgmetadata>
diff --git a/mail-filter/policyd-weight/policyd-weight-0.1.15.2-r1.ebuild b/mail-filter/policyd-weight/policyd-weight-0.1.15.2-r1.ebuild
new file mode 100644
index 00000000000..8fbf7a7f039
--- /dev/null
+++ b/mail-filter/policyd-weight/policyd-weight-0.1.15.2-r1.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils user
+
+DESCRIPTION="Weighted Policy daemon for Postfix"
+HOMEPAGE="http://www.policyd-weight.org/"
+SRC_URI="http://www.policyd-weight.org/releases/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="virtual/perl-Sys-Syslog
+ dev-perl/Net-DNS
+ >=mail-mta/postfix-2.1"
+
+pkg_setup() {
+ enewgroup 'polw'
+ enewuser 'polw' -1 -1 -1 'polw'
+}
+
+src_compile() { :; }
+
+src_install() {
+ exeinto /usr/libexec/postfix
+ doexe policyd-weight
+ fowners root:wheel /usr/libexec/postfix/policyd-weight
+
+ doman man/man5/*.5 man/man8/*.8
+ dodoc *.txt
+
+ sed -i -e "s:^ \$LOCKPATH.*: \$LOCKPATH = '/var/run/policyd-weight/'; # must be a directory (add:" policyd-weight.conf.sample || die
+ insinto /etc
+ newins policyd-weight.conf.sample policyd-weight.conf
+
+ newinitd "${FILESDIR}/${PN}.init.d-r1" "${PN}"
+}
diff --git a/mail-filter/policyd/Manifest b/mail-filter/policyd/Manifest
new file mode 100644
index 00000000000..bf13fe4b7c6
--- /dev/null
+++ b/mail-filter/policyd/Manifest
@@ -0,0 +1 @@
+DIST policyd-1.82.tar.gz 68372 RMD160 0258ee9abaa00cde9a139bdeafed36df1ec37537 SHA1 4a9bf4bcf63eb3792794d87682e67b15e4a04707 SHA256 63a90d26732ed24f8d8fa8623d74b73104a61a2c80b0e062437777cf13b80566
diff --git a/mail-filter/policyd/files/policyd-cleanup.cron b/mail-filter/policyd/files/policyd-cleanup.cron
new file mode 100644
index 00000000000..fef8d275bd6
--- /dev/null
+++ b/mail-filter/policyd/files/policyd-cleanup.cron
@@ -0,0 +1,2 @@
+#!/bin/bash
+/usr/sbin/policyd_cleanup -c /etc/policyd.conf
diff --git a/mail-filter/policyd/files/policyd-makefile.patch b/mail-filter/policyd/files/policyd-makefile.patch
new file mode 100644
index 00000000000..94e3edb1c19
--- /dev/null
+++ b/mail-filter/policyd/files/policyd-makefile.patch
@@ -0,0 +1,39 @@
+diff --git a/Makefile b/Makefile
+index ded74ce..6f2afd1 100644
+--- a/Makefile
++++ b/Makefile
+@@ -16,8 +16,8 @@ lib += -L/usr/local/mysql
+
+
+ CC := gcc
+-CPPFLAGS := -O $(inc)
+-CFLAGS := -g -W -Wall -DMAXFDS=4096
++CPPFLAGS := $(inc) ${CPPFLAGS}
++CFLAGS := -g -W -Wall -DMAXFDS=`ulimit -n` ${CFLAGS}
+ OS_NAME := $(shell uname | tr [A-Z] [a-z])
+ LDLIBS = $(lib) -lmysqlclient -lz
+
+@@ -50,20 +50,20 @@ policyd: syslog.o policyd.o generic.o mysql.o greylist.o throttle.o sockets.o ci
+ whitelist.o throttle_host.o throttle_sasl.o throttle_from.o throttle_rcpt.o helo.o
+ @echo ""
+ @echo "[*] Linking policyd*"
+- @$(CC) $(CFLAGS) $(CPPFLAGS) \
++ @$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) \
+ syslog.o policyd.o generic.o mysql.o greylist.o throttle.o sockets.o cidr.o spamtrap.o blacklist.o blacklist_helo.o \
+ whitelist.o throttle_host.o throttle_sasl.o throttle_from.o throttle_rcpt.o helo.o \
+ $(LDLIBS) -o policyd
+
+ cleanup: syslog.o cidr.o cleanup.o generic.o sockets.o mysql.o
+ @echo "[*] Linking cleanup*"
+- @$(CC) $(CFLAGS) $(CPPFLAGS) \
++ @$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) \
+ syslog.o cidr.o cleanup.o generic.o sockets.o mysql.o \
+ $(LDLIBS) -o cleanup
+
+ stats: cidr.o syslog.o stats.o generic.o sockets.o mysql.o
+ @echo "[*] Linking stats*"
+- @$(CC) $(CFLAGS) $(CPPFLAGS) \
++ @$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) \
+ cidr.o syslog.o stats.o generic.o sockets.o mysql.o \
+ $(LDLIBS) -o stats
+ @echo ""
diff --git a/mail-filter/policyd/files/policyd-post182.patch b/mail-filter/policyd/files/policyd-post182.patch
new file mode 100644
index 00000000000..fc684aab7cb
--- /dev/null
+++ b/mail-filter/policyd/files/policyd-post182.patch
@@ -0,0 +1,52 @@
+First patch from debian. The other two mostly cosmetic patches from bug #288438.
+--- a/syslog.c
++++ b/syslog.c
+@@ -214,14 +214,15 @@ char
+ if (strlen (str) == 0)
+ return (str);
+
++ p = str + strlen(str);
++
+ for (i = 0; isspace (str[i]); i++)
+ ;
+
+- strcpy (str, str + i);
++ str += i;
+
+- p = str + strlen (str);
+- while ((p--) != str && isspace (*p))
+- *p = 0;
++ while ((p--) != str && isspace (*p))
++ *p = 0;
+
+ return (str);
+ }
+diff -ur policyd-1.82-orig/throttle.c policyd-1.82/throttle.c
+--- a/throttle.c 2007-08-20 08:42:05.000000000 +0200
++++ b/throttle.c 2009-10-10 03:49:25.000000000 +0200
+@@ -145,11 +145,11 @@
+
+ if(tcount[fd] >= tquota[fd] && tcount[fd] >= trcpt[fd]) {
+ tresult = tcount[fd];
+- if (DEBUG >= 4) logmessage("tquota[fd] won\n"); }
++ if (DEBUG >= 4) logmessage("tcount[fd] won\n"); }
+
+ if(trcpt[fd] >= tcount[fd] && trcpt[fd] >= tquota[fd]) {
+ tresult = trcpt[fd];
+- if (DEBUG >= 4) logmessage("tquota[fd] won\n"); }
++ if (DEBUG >= 4) logmessage("trcpt[fd] won\n"); }
+
+ if(DEBUG >= 4)
+ logmessage("DEBUG: fd: %d: tresult: %d\n", fd, tresult);
+diff -ur policyd-1.82-orig/throttle_sasl.c policyd-1.82/throttle_sasl.c
+--- a/throttle_sasl.c 2007-08-20 08:42:05.000000000 +0200
++++ b/throttle_sasl.c 2009-10-10 03:50:27.000000000 +0200
+@@ -188,7 +188,7 @@
+ "UPDATE throttle SET"
+ " _abuse_cur=1"
+ " WHERE _from='%s'",
+- triplet_array[fd][1]);
++ triplet_array[fd][4]);
+ if(db_doquery(fd) == -1) return(db_failure(fd, "throttle"));
+
+ return (-5);
diff --git a/mail-filter/policyd/files/policyd.confd b/mail-filter/policyd/files/policyd.confd
new file mode 100644
index 00000000000..1fc697d451f
--- /dev/null
+++ b/mail-filter/policyd/files/policyd.confd
@@ -0,0 +1,2 @@
+# Config file for policyd
+POLICYD_CONFIG="/etc/policyd.conf"
diff --git a/mail-filter/policyd/files/policyd.rc b/mail-filter/policyd/files/policyd.rc
new file mode 100644
index 00000000000..ea36e4ec4ae
--- /dev/null
+++ b/mail-filter/policyd/files/policyd.rc
@@ -0,0 +1,22 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ before mta
+ provide postfix_greylist
+}
+
+start() {
+ ebegin "Starting policyd"
+ start-stop-daemon --name policyd --start --quiet --exec /usr/sbin/policyd \
+ -- -c ${POLICYD_CONFIG}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping policyd"
+ start-stop-daemon --stop --quiet --pidfile /var/run/policyd.pid
+ eend $?
+}
diff --git a/mail-filter/policyd/metadata.xml b/mail-filter/policyd/metadata.xml
new file mode 100644
index 00000000000..196134491c7
--- /dev/null
+++ b/mail-filter/policyd/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+</pkgmetadata>
diff --git a/mail-filter/policyd/policyd-1.82-r1.ebuild b/mail-filter/policyd/policyd-1.82-r1.ebuild
new file mode 100644
index 00000000000..6cf7b2ca5a6
--- /dev/null
+++ b/mail-filter/policyd/policyd-1.82-r1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Policy daemon for postfix and other MTAs"
+HOMEPAGE="http://policyd.sf.net/"
+
+# This is not available through SF mirrors
+SRC_URI="http://policyd.sourceforge.net/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~hppa x86"
+IUSE=""
+DEPEND="virtual/mysql
+ dev-libs/openssl"
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}/${PN}-post182.patch"
+ epatch "${FILESDIR}/${PN}-makefile.patch"
+ sed -i -e "s/gcc/$(tc-getCC)/" Makefile
+
+ ebegin "Applying config patches"
+ sed -i -e s:UID=0:UID=65534:g \
+ -e s:GID=0:GID=65534:g \
+ -e s:DAEMON=0:DAEMON=1:g \
+ -e s:DEBUG=3:DEBUG=0:g \
+ -e s:DATABASE_KEEPALIVE=0:DATABASE_KEEPALIVE=1:g \
+ policyd.conf || die "sed failed"
+ eend
+}
+
+src_compile() {
+ emake build || die "emake build failed"
+}
+
+src_install() {
+ insopts -o root -g nobody -m 0750
+ mv cleanup policyd_cleanup
+ mv stats policyd_stats
+
+ dosbin policyd policyd_cleanup policyd_stats
+
+ insopts -o root -g nobody -m 0640
+ insinto /etc
+ doins policyd.conf
+
+ insopts -o root -g nobody -m 0700
+ exeinto /etc/cron.hourly
+ newexe "${FILESDIR}/${PN}-cleanup.cron" ${PN}-cleanup.cron
+
+ dodoc ChangeLog DATABASE.mysql README doc/support.txt
+
+ newinitd "${FILESDIR}/${PN}.rc" ${PN}
+ newconfd "${FILESDIR}/${PN}.confd" ${PN}
+}
+
+pkg_postinst() {
+ elog "You will need to create the database using the script DATABASE.mysql"
+ elog "in /usr/share/doc/${PF}/"
+ elog "Read the mysql section of the README.txt for details."
+ elog
+ elog "To use policyd with postfix, update your /etc/postfix/main.cf file by adding"
+ elog " check_policy_service inet:127.0.0.1:10031"
+ elog "to your smtpd_recipient_restrictions line, or similar."
+ elog
+ elog "Also remember to start the daemon at boot:"
+ elog " rc-update add policyd default"
+ elog
+ elog "Read the documentation for more info."
+}
diff --git a/mail-filter/popfile/Manifest b/mail-filter/popfile/Manifest
new file mode 100644
index 00000000000..fff727678a2
--- /dev/null
+++ b/mail-filter/popfile/Manifest
@@ -0,0 +1 @@
+DIST popfile-1.1.3.zip 523431 SHA256 d197a187fbdaaf655f7eefceb969e0944cb4d5d290c0aba419b132797dfd6c54 SHA512 0e3ed3d67d2c2b456643335dd030a51e890bb371c5b8cf9eed9fac350a2536b8884eeffff78fcb27b99c39711505df533ee3ded5b40714fb46e54c2d25b3dda9 WHIRLPOOL 84e72bb8a98e1e1d20acde10c41cf8f8ed4418f8823cb5aaab29a7bfb916123447dc48b5180d617a6966db3f476de5a08770c5e96c0453e3481185c034889dbe
diff --git a/mail-filter/popfile/files/popfile b/mail-filter/popfile/files/popfile
new file mode 100644
index 00000000000..84fe795d5bd
--- /dev/null
+++ b/mail-filter/popfile/files/popfile
@@ -0,0 +1,33 @@
+#!/bin/bash
+#
+# /usr/bin/popfile
+# Shell script wrapper around the popfile perl script
+#
+# Author Stuart Herbert
+# (stuart@gentoo.org)
+#
+# Copyright Released into the public domain
+#
+# ------------------------------------------------------------------------
+
+POPFILE_DIR=/usr/share/popfile
+POPFILE_PL=popfile.pl
+
+if [[ `id -u` != 0 ]] ; then
+ echo "*** error: You must be root to run popfile" >&2
+ exit 1
+fi
+
+if [[ ! -d $POPFILE_DIR ]] ; then
+ echo "*** error: Directory $POPFILE_DIR does not exist" >&2
+ echo "*** Is popfile installed?"
+ exit 1
+fi
+
+if [[ ! -e $POPFILE_DIR/$POPFILE_PL ]] ; then
+ echo "*** error: popfile.pl is missing or not executable" >&2
+ exit 1
+fi
+
+cd $POPFILE_DIR
+exec ./$POPFILE_PL
diff --git a/mail-filter/popfile/metadata.xml b/mail-filter/popfile/metadata.xml
new file mode 100644
index 00000000000..1534479cc5b
--- /dev/null
+++ b/mail-filter/popfile/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ <description>This package lacks a primary herd or maintainer.</description>
+</maintainer>
+</pkgmetadata>
diff --git a/mail-filter/popfile/popfile-1.1.3.ebuild b/mail-filter/popfile/popfile-1.1.3.ebuild
new file mode 100644
index 00000000000..5bf549cfe05
--- /dev/null
+++ b/mail-filter/popfile/popfile-1.1.3.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="Anti-spam bayesian filter"
+HOMEPAGE="http://getpopfile.org"
+SRC_URI="http://getpopfile.org/downloads/${P}.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="cjk ipv6 mysql ssl xmlrpc"
+
+RDEPEND="virtual/perl-Digest-MD5
+ virtual/perl-MIME-Base64
+ dev-perl/DBD-SQLite
+ dev-perl/HTML-Tagset
+ dev-perl/HTML-Template
+ dev-perl/TimeDate
+ dev-perl/DBI
+ virtual/perl-Digest
+ cjk? ( dev-perl/Encode-compat
+ dev-perl/Text-Kakasi )
+ mysql? ( dev-perl/DBD-mysql )
+ ipv6? ( dev-perl/IO-Socket-INET6 )
+ ssl? ( dev-libs/openssl
+ dev-perl/IO-Socket-SSL
+ dev-perl/Net-SSLeay )
+ xmlrpc? ( dev-perl/PlRPC )"
+
+DEPEND="app-arch/unzip"
+
+S="${WORKDIR}"
+
+src_prepare() {
+ local f
+ for f in `find ./ -type f`; do
+ edos2unix "${f}"
+ done
+}
+
+src_install() {
+ dodoc *.change*
+ rm -rf *.change* license
+
+ insinto /usr/share/${PN}
+ doins -r *
+
+ fperms 755 /usr/share/${PN}/{popfile,insert,pipe,bayes}.pl
+
+ dosbin "${FILESDIR}"/${PN}
+}
diff --git a/mail-filter/postfwd/Manifest b/mail-filter/postfwd/Manifest
new file mode 100644
index 00000000000..5c3e3af2c1c
--- /dev/null
+++ b/mail-filter/postfwd/Manifest
@@ -0,0 +1 @@
+DIST postfwd-1.35.tar.gz 354609 SHA256 42abf8fc1229e8a09fa0141b6e23e34c6e1b654a56f6e7556d04067eafc77c41 SHA512 7b0e8c8a755f085c108c45b28ec8c32139581ce129d0b8586f1876ae87f134a4fb1606d45105ccfa62351ca2d3b87f001ea52aacab0680f3345c41562bec5207 WHIRLPOOL 7335fae813a4882441580050f5df64ef8a3da85bc5e673b9cd6662c1a08f9dd485ecafd5867da7f3370afb7c90622040d70274d70bc0e9308cfb64c24c5db214
diff --git a/mail-filter/postfwd/files/postfwd.conf b/mail-filter/postfwd/files/postfwd.conf
new file mode 100644
index 00000000000..2f6f537e7c8
--- /dev/null
+++ b/mail-filter/postfwd/files/postfwd.conf
@@ -0,0 +1,18 @@
+# /etc/conf.d/postfwd.conf
+
+# User and group to execute postfwd as
+POSTFWD_USER="postfwd"
+POSTFWD_GROUP="postfwd"
+
+# Configuration file to use
+POSTFWD_CONFIG="/etc/postfix/postfwd.cf"
+
+# The IP address postfwd will listen on
+# WARNING: You _really_ want this to be localhost for security!
+POSTFWD_LISTEN="127.0.0.1"
+
+# The port postfwd will listen on
+POSTFWD_PORT="10040"
+
+# Additional options to pass to postfwd
+POSTFWD_OPTS=""
diff --git a/mail-filter/postfwd/files/postfwd.init b/mail-filter/postfwd/files/postfwd.init
new file mode 100644
index 00000000000..df96edb87d4
--- /dev/null
+++ b/mail-filter/postfwd/files/postfwd.init
@@ -0,0 +1,28 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+PIDFILE=/var/run/postfwd.pid
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting postfwd"
+ start-stop-daemon --start --quiet --background \
+ --pidfile ${PIDFILE} \
+ --exec /usr/sbin/postfwd2 -- --daemon --file ${POSTFWD_CONFIG} \
+ --interface=${POSTFWD_LISTEN} --port=${POSTFWD_PORT} \
+ --user=${POSTFWD_USER} --group=${POSTFWD_GROUP} \
+ --pidfile ${PIDFILE} \
+ ${POSTFWD_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping postfwd"
+ start-stop-daemon --stop --quiet --pidfile ${PIDFILE}
+ eend $?
+}
diff --git a/mail-filter/postfwd/files/postfwd2.example.cf b/mail-filter/postfwd/files/postfwd2.example.cf
new file mode 100644
index 00000000000..614f6331527
--- /dev/null
+++ b/mail-filter/postfwd/files/postfwd2.example.cf
@@ -0,0 +1,154 @@
+# source:
+# http://hege.li/howto/spam/etc/postfwd/postfwd.conf
+#
+# This version was included on 29 Mar 2010. Newer versions
+# may be available.
+
+###
+### Example config for postfwd 1.10pre8+
+###
+
+## Check DNS Whitelisting
+
+id=OK_DNSWL; \
+ rbl=list.dnswl.org/^127/43200; \
+ action=OK
+
+## Check HELO and reverse DNS
+
+id=SET_HELO; \
+ helo_name=^(\[|[^.]+$|.*?[0-9.-]{8}); \
+ action=set(HIT_helo=1)
+
+id=SET_NODNS; \
+ client_name=^unknown$; \
+ action=set(HIT_nodns=1)
+
+id=REJECT_HELO_NODNS; \
+ HIT_helo==1; HIT_nodns==1; \
+ action=REJECT Blocked - contact postmaster@example.net for help - Suspicious HELO [$$helo_name] and missing reverse DNS [$$client_address]
+
+## Check ZEN first for immediate blocking - less queries for other lists
+## See usage policy: http://www.spamhaus.org/organization/dnsblusage.html
+
+id=REJECT_RBL_ZEN; \
+ rbl=zen.spamhaus.org; \
+ action=REJECT Blocked - contact postmaster@example.net for help - DNSBL [$$dnsbltext]
+
+## Check other DNSBLs in parallel
+
+&&DNSBLS { \
+ rbl=bl.spamcop.net; \
+ rbl=b.barracudacentral.org; \
+ rbl=bl.spameatingmonkey.net; \
+ rbl=dnsbl-1.uceprotect.net; \
+ rbl=psbl.surriel.com; \
+ rbl=combined.njabl.org; \
+ rbl=dnsbl.sorbs.net; \
+ rbl=ix.dnsbl.manitu.net; \
+};
+
+id=EVAL_DNSBLS; \
+ &&DNSBLS; rblcount=all; \
+ action=set(HIT_rbls=$$rblcount,HIT_dtxt=$$dnsbltext)
+
+id=REJECT_RBL_MULTI; \
+ HIT_rbls>=2; \
+ action=REJECT Blocked - contact postmaster@example.net for help - Multiple DNSBLs [$$HIT_dtxt]
+
+## Check RHSBLs if there wasn't enough DNSBLs hit
+
+&&RHSBLS_REVERSE { \
+ rhsbl_reverse_client=dynamic.rhs.mailpolice.com; \
+};
+
+&&RHSBLS_SENDER { \
+ rhsbl_sender=dbl.spamhaus.org; \
+ rhsbl_sender=multi.uribl.com; \
+ rhsbl_sender=multi.surbl.org; \
+ rhsbl_sender=rhsbl.ahbl.org; \
+ rhsbl_sender=rhsbl.sorbs.net; \
+ rhsbl_sender=dsn.rfc-ignorant.org; \
+};
+
+id=EVAL_RHSBLS; \
+ &&RHSBLS_REVERSE; &&RHSBLS_SENDER; rhsblcount=all; \
+ action=set(HIT_rhsbls=$$rhsblcount,HIT_rtxt=$$dnsbltext)
+
+id=REJECT_RHSBL_MULTI; \
+ HIT_rhsbls>=2; \
+ action=REJECT Blocked - contact postmaster@example.net for help - Multiple RHSBLs [$$HIT_rtxt]
+
+## See if we get any combined hits from rules before
+
+id=REJECT_RBL_RHSBL; \
+ HIT_rbls>=1; HIT_rhsbls>=1; \
+ action=REJECT Blocked - contact postmaster@example.net for help - RHSBL and DNSBL [$$HIT_rtxt] [$$HIT_dtxt]
+
+id=REJECT_RBL_HELO; \
+ HIT_rbls>=1; HIT_helo==1; \
+ action=REJECT Blocked - contact postmaster@example.net for help - DNSBL [$$HIT_dtxt] and suspicious HELO [$$helo_name]
+
+id=REJECT_RBL_NODNS; \
+ HIT_rbls>=1; HIT_nodns==1; \
+ action=REJECT Blocked - contact postmaster@example.net for help - DNSBL [$$HIT_dtxt] and missing reverse DNS [$$client_address]
+
+id=REJECT_RHSBL_HELO; \
+ HIT_rhsbls>=1; HIT_helo==1; \
+ action=REJECT Blocked - contact postmaster@example.net for help - RHSBL [$$HIT_rtxt] and suspicious HELO [$$helo_name]
+
+id=REJECT_RHSBL_NODNS; \
+ HIT_rhsbls>=1; HIT_nodns==1; \
+ action=REJECT Blocked - contact postmaster@example.net for help - RHSBL [$$HIT_rtxt] and missing reverse DNS [$$client_address]
+
+## Finally greylist all lesser hits.
+##
+## A more DNSBL friendly way would be to greylist everything suspicious
+## before DNS checks. Currently this requires you to setup some postfix
+## tables before postfwd is called, since greylisting can be only done last
+## in postfwd (action always exits processing).
+
+id=GREY_HELO; HIT_helo==1; action=check_postgrey
+id=GREY_NODNS; HIT_nodns==1; action=check_postgrey
+id=GREY_RBL; HIT_rbls>=1; action=check_postgrey
+id=GREY_RHSBL; HIT_rhsbls>=1; action=check_postgrey
+
+&&DNSBLS_GREY { \
+ rbl=dnsbl-2.uceprotect.net; \
+ rbl=dnsbl-3.uceprotect.net; \
+};
+
+id=GREY_DNSBL; &&DNSBLS_GREY; action=check_postgrey
+
+
+
+##
+## This example is free to use as per BSD license:
+##
+## Copyright (c) 2008, Henrik Krohns <hege@hege.li>
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without modification,
+## are permitted provided that the following conditions are met:
+##
+## * Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## * Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in
+## the documentation and/or other materials provided with the
+## distribution.
+## * Neither the name of the authors nor the names of his contributors
+## may be used to endorse or promote products derived from this
+## software without specific prior written permission.
+##
+## THIS SOFTWARE IS PROVIDED BY ME ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+## INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+## FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT,
+## INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+## NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+## POSSIBILITY OF SUCH DAMAGE.
+##
+
diff --git a/mail-filter/postfwd/metadata.xml b/mail-filter/postfwd/metadata.xml
new file mode 100644
index 00000000000..46967d21ae5
--- /dev/null
+++ b/mail-filter/postfwd/metadata.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>mschiff@gentoo.org</email>
+ <name>Marc Schiffbauer</name>
+ </maintainer>
+ <maintainer>
+ <email>info@roessner-net.com</email>
+ <name>Christian Roessner</name>
+ <description>Proxy-Maintainer. Assign bugs to him</description>
+ </maintainer>
+ <upstream>
+ <maintainer status='active'>
+ <email>info@postfwd.org</email>
+ <name>Jan Peter Kessler</name>
+ </maintainer>
+ <changelog>http://www.postfwd.org/postfwd2.CHANGELOG</changelog>
+ </upstream>
+ <longdescription lang="en">
+ postfwd (short for Postfix Firewall Daemon) is a Postfix policy server
+ that is written in Perl. It allows to define flexible and complex rules
+ to block access to the mail system before the actual message has been
+ accepted. The ruleset configuration supports features like scoring,
+ grouping, date and time based dependencies together with DNSBL lookups
+ and policy delegation (e.g. postgrey).
+ </longdescription>
+ <use>
+ <flag name="tools">Install additional tools for testing postfwd</flag>
+ </use>
+</pkgmetadata>
diff --git a/mail-filter/postfwd/postfwd-1.35-r2.ebuild b/mail-filter/postfwd/postfwd-1.35-r2.ebuild
new file mode 100644
index 00000000000..288652900e2
--- /dev/null
+++ b/mail-filter/postfwd/postfwd-1.35-r2.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils user
+
+DESCRIPTION="Versatile Postfix policy server with a flexible ruleset based configuration"
+HOMEPAGE="http://www.postfwd.org/"
+SRC_URI="http://www.postfwd.org/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+tools"
+
+DEPEND=""
+RDEPEND=">=dev-lang/perl-5.16.3
+ virtual/perl-Sys-Syslog
+ dev-perl/Net-DNS
+ dev-perl/net-server
+"
+
+pkg_setup() {
+ enewgroup postfwd
+ enewuser postfwd -1 -1 -1 postfwd
+}
+
+src_install() {
+ local BIN="postfwd2"
+ # programs and tools
+ dosbin "${S}"/sbin/${BIN}
+
+ # man pages and documentation
+ doman "${S}"/man/man8/${BIN}.8
+ dodoc "${S}"/doc/{${BIN}.CHANGELOG,${BIN}.txt}
+
+ # example configuration(s)
+ insinto /usr/share/doc/${PF}/examples
+ newins "${S}"/etc/${PN}.cf.sample ${PN}.cf.dist
+
+ # plugins
+ dodoc -r "${S}"/plugins
+
+ # tools
+ if use tools; then
+ dodoc -r "${S}"/tools
+ fi
+
+ # init script and respective configuration file
+ newinitd "${FILESDIR}"/${PN}.init ${PN}
+ newconfd "${FILESDIR}"/${PN}.conf ${PN}
+}
+
+pkg_postinst() {
+ einfo
+ einfo "${PN} has no default configuration for safety reasons. Every"
+ einfo "mail system is different, so you should craft a set of rules"
+ einfo "that is suitable for your environment and save it to:"
+ einfo " /etc/postfix/postfwd.cf"
+ einfo "You can find example configurations in:"
+ einfo " /usr/share/doc/${PF}/examples"
+ einfo
+ einfo "If you want ${PN} to start on system boot, you have to add it your"
+ einfo "default run level:"
+ einfo " # rc-update add postfwd default"
+ einfo "Also remember to edit /etc/conf.d/${PN} to your liking."
+ einfo
+ einfo "A plugins sampe folder has been placed under:"
+ einfo
+ einfo " /usr/share/doc/${PF}/plugins"
+
+ if use tools; then
+ einfo
+ einfo "You can find additional tools for testing ${PN} in:"
+ einfo " /usr/share/doc/${PF}/tools"
+ fi
+
+ ewarn
+ ewarn "Please read the documentation carefully and properly test new"
+ ewarn "rulesets before putting them into production use. Otherwise you"
+ ewarn "risk accidental mail loss or worse."
+ ewarn
+ ewarn "Visit http://www.postfwd.org/ for more information."
+ ewarn
+}
diff --git a/mail-filter/postgrey/Manifest b/mail-filter/postgrey/Manifest
new file mode 100644
index 00000000000..f00f6636b27
--- /dev/null
+++ b/mail-filter/postgrey/Manifest
@@ -0,0 +1,2 @@
+DIST postgrey-1.34.tar.gz 36399 SHA256 9a9ee2f4e3cbbf15642e47802407c810ac5c54f0ad1572ebec3f0f645eb35707 SHA512 df6cf0c3bf6835591aad00bde13330ee4030b965c90a01a27dfafb5eac1f008dcfb9001dbfcf70a6209b91af7a571b38392b69db2212f112d888a565e9b703cb WHIRLPOOL 92eade9af5ac0589ffd0c63b89b36ac8b64b5f862f601cbfa10c66137ea46624ff5af0b96cbcef2f004cb19028fd90c406f4ec164440e53f4f1122c3cdd427e3
+DIST postgrey-1.35.tar.gz 36610 SHA256 f6a6956630803e6f79ebff6ad0cc0d46ba32046ed6cc260e38e6f591de7bbdcf SHA512 fa9844f6ca7395c02cbc1f234d0efbeafb80ebbebc763966d375bb32e7768d9c987d8c95d1e8dc9da933832feb9948b4086cf5a31f24d3764e9678333abe6c8f WHIRLPOOL c969bf93747cb197bd6efef4b4dd7d979f489663a235e7723dc015005c8b059b23d0bde7c8ba08a3ad1da7a5957e98da7170e4405019c633c91aadb3ed016c6c
diff --git a/mail-filter/postgrey/files/postgrey-1.34-perl-5.18.patch b/mail-filter/postgrey/files/postgrey-1.34-perl-5.18.patch
new file mode 100644
index 00000000000..615c6e5b77d
--- /dev/null
+++ b/mail-filter/postgrey/files/postgrey-1.34-perl-5.18.patch
@@ -0,0 +1,33 @@
+From 9673b54064691a5b9c295ffea340d8a1f9ee1cb8 Mon Sep 17 00:00:00 2001
+From: Yasuhiro KIMURA <yasu@utahime.org>
+Date: Sat, 17 Aug 2013 22:05:27 +0900
+Subject: [PATCH] Make postgrey work with Perl 5.18
+
+---
+ postgrey | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/postgrey b/postgrey
+index 7cb0352..37f69bd 100755
+--- a/postgrey
++++ b/postgrey
+@@ -557,6 +557,16 @@ sub main()
+ if($opt{dbdir}) {
+ $opt{dbdir} =~ /^(.*)$/; $opt{dbdir} = $1;
+ }
++ # untaint what is given on --pidfile. It is not security sensitive since
++ # it is provided by the admin
++ if($opt{pidfile}) {
++ $opt{pidfile} =~ /^(.*)$/; $opt{pidfile} = $1;
++ }
++ # untaint what is given on --inet. It is not security sensitive since
++ # it is provided by the admin
++ if($opt{inet}) {
++ $opt{inet} =~ /^(.*)$/; $opt{inet} = $1;
++ }
+
+ # determine proper "logsock" for Sys::Syslog
+ my $syslog_logsock;
+--
+2.0.3
+
diff --git a/mail-filter/postgrey/files/postgrey-1.34-r3.rc.new b/mail-filter/postgrey/files/postgrey-1.34-r3.rc.new
new file mode 100644
index 00000000000..3c19d25ef60
--- /dev/null
+++ b/mail-filter/postgrey/files/postgrey-1.34-r3.rc.new
@@ -0,0 +1,101 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+conf="/etc/conf.d/postgrey"
+
+extra_started_commands="reload"
+
+depend() {
+ need net
+ before postfix
+ provide postfix_greylist
+}
+
+conf_error() {
+ eerror "You need to setup ${conf} first"
+ return 1
+}
+
+checkconfig() {
+if [ -z "${POSTGREY_TYPE}" ]
+ then
+ einfo "You need to choose the server type you want"
+ einfo "by setting the POSTGREY_TYPE variable in ${conf}."
+ else
+ if [ "x${POSTGREY_TYPE}" = "xinet" ]
+ then
+ if [ -z "${POSTGREY_PORT}" ] || [ -z "${POSTGREY_HOST}" ]
+ then
+ einfo "The following entries are missing in ${conf}:"
+ [ -z "${POSTGREY_HOST}" ] && einfo " - POSTGREY_HOST"
+ [ -z "${POSTGREY_PORT}" ] && einfo " - POSTGREY_PORT"
+ conf_error
+ fi
+ POSTGREY_ADDR="${POSTGREY_TYPE}=${POSTGREY_HOST}:${POSTGREY_PORT}"
+ else
+ if [ -z "${POSTGREY_SOCKET}" ]
+ then
+ einfo "The following entries are missing in ${conf}:"
+ [ -z "${POSTGREY_SOCKET}" ] && einfo " - POSTGREY_SOCKET"
+ conf_error
+ fi
+ POSTGREY_ADDR="${POSTGREY_TYPE}=${POSTGREY_SOCKET}"
+ fi
+fi
+
+ if [ -z "${POSTGREY_PID}" ]
+ then
+ einfo "The following entries are missing in ${conf}:"
+ [ -z "${POSTGREY_PID}" ] && einfo " - POSTGREY_PID"
+ conf_error
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting Postgrey"
+
+ # HACK -- start a subshell and corrects perms on the socket...
+ if [ "x${POSTGREY_TYPE}" = "xunix" ]; then
+ rm -f ${POSTGREY_SOCKET}
+ ( while ! test -S ${POSTGREY_SOCKET}; do sleep 1; done; chmod a+rw,a-x ${POSTGREY_SOCKET} ) &
+ fi
+
+ if [ -z ${POSTGREY_DELAY} ] ; then
+ POSTGREY_DELAY_ARG=""
+ else
+ POSTGREY_DELAY_ARG="--delay=${POSTGREY_DELAY}"
+ fi
+
+ if [ -z "${POSTGREY_TEXT}" ] ; then
+ POSTGREY_TEXT_ARG=""
+ else
+ POSTGREY_TEXT_ARG="--greylist-text=${POSTGREY_TEXT}"
+ fi
+
+ start-stop-daemon --start --quiet --background \
+ --pidfile=${POSTGREY_PID} \
+ --name postgrey \
+ --exec /usr/sbin/postgrey -- \
+ --${POSTGREY_ADDR} \
+ --daemonize \
+ --pidfile=${POSTGREY_PID} \
+ ${POSTGREY_DELAY_ARG} \
+ ${POSTGREY_OPTS} \
+ "${POSTGREY_TEXT_ARG}"
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping Postgrey"
+ start-stop-daemon --stop --quiet --pidfile ${POSTGREY_PID}
+ eend ${?}
+}
+
+reload() {
+ ebegin "Reloading Postgrey"
+ start-stop-daemon --stop --signal HUP --oknodo --pidfile ${POSTGREY_PID}
+ eend $?
+}
diff --git a/mail-filter/postgrey/files/postgrey.conf.new b/mail-filter/postgrey/files/postgrey.conf.new
new file mode 100644
index 00000000000..58db73440bd
--- /dev/null
+++ b/mail-filter/postgrey/files/postgrey.conf.new
@@ -0,0 +1,55 @@
+# Config file for /etc/init.d/postgrey
+
+# LISTEN TYPE
+# Set to 'inet' if you want to use a TCP socket.
+# Set to 'unix' if you want to use a UNIX socket.
+POSTGREY_TYPE="inet"
+
+# HOST
+# What IP should postgrey bind to?
+# Leave unchanged unless you know what you are doing.
+# (ignored if POSTGREY_TYPE is set to 'unix')
+POSTGREY_HOST="127.0.0.1"
+
+# PORT
+# What TCP port should postgrey listen on?
+# (ignored if POSTGREY_TYPE is set to 'unix')
+POSTGREY_PORT="10030"
+
+# SOCKET
+# Unix socket to listen on, if POSTGREY_TYPE is set to 'unix'.
+# Leave unchanged unless you know what you are doing.
+# (ignored if POSTGREY_TYPE is set to 'inet')
+POSTGREY_SOCKET="/var/spool/postfix/private/postgrey"
+
+# PID
+# Postgrey pid file.
+# Do not change, if you don't know what this is!
+POSTGREY_PID="/var/run/postgrey.pid"
+
+# DELAY
+# How long to delay mail that is greylisted in seconds.
+POSTGREY_DELAY=300
+
+# TEXT
+# The response we'll send back with delayed mail.
+POSTGREY_TEXT="Greylisted for %s seconds"
+
+# Additional Postgrey options
+#
+# -v, --verbose increase verbosity level
+# --max-age=N delete entries older than N days since the last time
+# that they have been seen (default: 30)
+# --retry-window=N allow only N days for the first retrial (default: 2)
+# append 'h' if you want to specify it in hours
+# --greylist-action=A if greylisted, return A to Postfix (default: DEFER_IF_PERMIT)
+# --lookup-by-subnet strip the last 8 bits from IP addresses (default)
+# --lookup-by-host do not strip the last 8 bits from IP addresses
+# --whitelist-clients=FILE default: /etc/postfix/postgrey_whitelist_clients
+# --whitelist-recipients=FILE default: /etc/postfix/postgrey_whitelist_recipients
+#
+# Note that the --whitelist-x options can be specified multiple times, and that
+# per default /etc/postfix/postgrey_whitelist_clients.local is also read, so
+# that you can put there local entries.
+#
+POSTGREY_OPTS=""
diff --git a/mail-filter/postgrey/files/postgrey.rc.new b/mail-filter/postgrey/files/postgrey.rc.new
new file mode 100644
index 00000000000..18603875872
--- /dev/null
+++ b/mail-filter/postgrey/files/postgrey.rc.new
@@ -0,0 +1,101 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+conf="/etc/conf.d/postgrey"
+
+extra_started_commands="reload"
+
+depend() {
+ need net
+ before postfix
+ provide postfix_greylist
+}
+
+conf_error() {
+ eerror "You need to setup ${conf} first"
+ return 1
+}
+
+checkconfig() {
+if [ -z "${POSTGREY_TYPE}" ]
+ then
+ einfo "You need to choose the server type you want"
+ einfo "by setting the POSTGREY_TYPE variable in ${conf}."
+ else
+ if [ "x${POSTGREY_TYPE}" = "xinet" ]
+ then
+ if [ -z "${POSTGREY_PORT}" ] || [ -z "${POSTGREY_HOST}" ]
+ then
+ einfo "The following entries are missing in ${conf}:"
+ [ -z "${POSTGREY_HOST}" ] && einfo " - POSTGREY_HOST"
+ [ -z "${POSTGREY_PORT}" ] && einfo " - POSTGREY_PORT"
+ conf_error
+ fi
+ POSTGREY_ADDR="${POSTGREY_TYPE}=${POSTGREY_HOST}:${POSTGREY_PORT}"
+ else
+ if [ -z "${POSTGREY_SOCKET}" ]
+ then
+ einfo "The following entries are missing in ${conf}:"
+ [ -z "${POSTGREY_SOCKET}" ] && einfo " - POSTGREY_SOCKET"
+ conf_error
+ fi
+ POSTGREY_ADDR="${POSTGREY_TYPE}=${POSTGREY_SOCKET}"
+ fi
+fi
+
+ if [ -z "${POSTGREY_PID}" ]
+ then
+ einfo "The following entries are missing in ${conf}:"
+ [ -z "${POSTGREY_PID}" ] && einfo " - POSTGREY_PID"
+ conf_error
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting Postgrey"
+
+ # HACK -- start a subshell and corrects perms on the socket...
+ ( if [ "x${POSTGREY_TYPE}" = "xunix" ]; then
+ rm -f ${POSTGREY_SOCKET};
+ while ! test -S ${POSTGREY_SOCKET}; do sleep 1; done;
+ chmod a+rw,a-x ${POSTGREY_SOCKET}; fi ) &
+
+ if [ -z ${POSTGREY_DELAY} ] ; then
+ POSTGREY_DELAY_ARG=""
+ else
+ POSTGREY_DELAY_ARG="--delay=${POSTGREY_DELAY}"
+ fi
+
+ if [ -z "${POSTGREY_TEXT}" ] ; then
+ POSTGREY_TEXT_ARG=""
+ else
+ POSTGREY_TEXT_ARG="--greylist-text=${POSTGREY_TEXT}"
+ fi
+
+ start-stop-daemon --start --quiet --background \
+ --pidfile=${POSTGREY_PID} \
+ --name postgrey \
+ --exec /usr/sbin/postgrey -- \
+ --${POSTGREY_ADDR} \
+ --daemonize \
+ --pidfile=${POSTGREY_PID} \
+ ${POSTGREY_DELAY_ARG} \
+ ${POSTGREY_OPTS} \
+ "${POSTGREY_TEXT_ARG}"
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping Postgrey"
+ start-stop-daemon --stop --quiet --pidfile ${POSTGREY_PID}
+ eend ${?}
+}
+
+reload() {
+ ebegin "Reloading Postgrey"
+ start-stop-daemon --stop --signal HUP --oknodo --pidfile ${POSTGREY_PID}
+ eend $?
+}
diff --git a/mail-filter/postgrey/files/targrey-0.31-postgrey-1.34.patch b/mail-filter/postgrey/files/targrey-0.31-postgrey-1.34.patch
new file mode 100644
index 00000000000..a17b6457d39
--- /dev/null
+++ b/mail-filter/postgrey/files/targrey-0.31-postgrey-1.34.patch
@@ -0,0 +1,202 @@
+--- postgrey.orig 2011-05-04 22:54:15.000000000 +0200
++++ postgrey 2011-10-17 10:10:21.000000000 +0200
+@@ -309,6 +309,22 @@
+ $self->mylog(1, "cleaning clients database finished. before: $nr_keys_before, after: $nr_keys_after");
+ }
+
++ if($self->{postgrey}{targrey}) {
++ # cleanup tarpit blacklist database
++ my $tarpit_db = $self->{postgrey}{db_tarpit};
++ ($nr_keys_before, $nr_keys_after) = (0, 0);
++ while (my ($key, $tarpit_last_seen) = each %$tarpit_db) {
++ $nr_keys_before++;
++ if($now - $tarpit_last_seen > $retry_window) {
++ delete $tarpit_db->{$key};
++ }
++ else {
++ $nr_keys_after++;
++ }
++ }
++ $self->mylog(1, "cleaning tarpit blacklist database finished. before: $nr_keys_before, after: $nr_keys_after");
++ }
++
+ $self->{postgrey}{last_maint_keys}=$now;
+ }
+ }
+@@ -383,7 +399,7 @@
+ # whitelist if count is enough
+ if(defined $cawl_count and $cawl_count >= $self->{postgrey}{awl_clients})
+ {
+- if(($now >= $cawl_last+3600) or ($cawl_last > $now)) {
++ if(($now >= $cawl_last + $self->{postgrey}{awl_delay}) or ($cawl_last > $now)) {
+ $cawl_count++; # for statistics
+ $cawl_db->{$cawl_key}=$cawl_count.','.$now;
+ }
+@@ -392,6 +408,28 @@
+ }
+ }
+
++ # check tarpit passed if targrey mode
++ if ($self->{postgrey}{targrey} && $attr->{protocol_state} eq 'DATA') { # passed tarpit
++ # remove tarpit blacklist
++ my $tarpit_db = $self->{postgrey}{db_tarpit};
++ my $tarpit_key = $attr->{client_address};
++ delete $tarpit_db->{$tarpit_key};
++
++ # auto whitelist clients by tarpit
++ if ($self->{postgrey}{awl_clients}) {
++ # enough time has passed (record only one attempt per hour)
++ if (! defined $cawl_last or $now >= $cawl_last + $self->{postgrey}{awl_delay}) {
++ # ok, increase count
++ $cawl_count++;
++ $cawl_db->{$cawl_key}=$cawl_count.','.$now;
++ $self->mylog(1, "tarpit whitelisted: $attr->{client_name}"."[".$attr->{client_address}."]")
++ if $cawl_count==$self->{postgrey}{awl_clients};
++ }
++ }
++
++ return 'DUNNO';
++ }
++
+ # lookup
+ my $sender = $self->do_sender_substitutions($attr->{sender});
+ my ($client_net, $client_host) =
+@@ -402,10 +440,11 @@
+ }
+ my $val = $db->{$key};
+ my $first;
++ my $retry_count=0;
+ my $last_was_successful=0;
+ if(defined $val) {
+ my $last;
+- ($first, $last) = split(/,/,$val);
++ ($first, $last, $retry_count) = split(/,/,$val);
+ # find out if the last time was unsuccessful, so that we can add a header
+ # to say how much had to be waited
+ if($last - $first >= $self->{postgrey}{delay}) {
+@@ -426,16 +465,19 @@
+ $first = $now;
+ }
+
++ my $diff = $self->{postgrey}{delay} - ($now - $first);
++
++ # enough waited? -> increase retry_count
++ $retry_count++ if($diff <= 0);
++
+ # update (put as last element stripped host-part if it was stripped)
+ if(defined $client_host) {
+- $db->{$key}="$first,$now,$client_host";
++ $db->{$key}="$first,$now,$retry_count,$client_host";
+ }
+ else {
+- $db->{$key}="$first,$now";
++ $db->{$key}="$first,$now,$retry_count";
+ }
+
+- my $diff = $self->{postgrey}{delay} - ($now - $first);
+-
+ # auto whitelist clients
+ # algorithm:
+ # - on successful entry in the greylist db of a triplet:
+@@ -443,23 +485,41 @@
+ # - client whitelisted already? -> update last-seen timestamp
+ if($self->{postgrey}{awl_clients}) {
+ # greylisting succeeded
+- if($diff <= 0 and !$last_was_successful) {
++ if($retry_count >= $self->{postgrey}{retry_count} and !$last_was_successful) {
+ # enough time has passed (record only one attempt per hour)
+- if(! defined $cawl_last or $now >= $cawl_last + 3600) {
++ if(! defined $cawl_last or $now >= $cawl_last + $self->{postgrey}{awl_delay}) {
+ # ok, increase count
+ $cawl_count++;
+ $cawl_db->{$cawl_key}=$cawl_count.','.$now;
+ my $client = $attr->{client_name} ?
+ $attr->{client_name}.'['.$attr->{client_address}.']' :
+ $attr->{client_address};
+- $self->mylog(1, "whitelisted: $client")
++ $self->mylog(1, "whitelisted: $attr->{client_name}"."[".$attr->{client_address}."]")
+ if $cawl_count==$self->{postgrey}{awl_clients};
+ }
+ }
+ }
+
+- # not enough waited? -> greylist
+- if ($diff > 0 ) {
++ # not enough retry? -> greylist
++ if ($retry_count < $self->{postgrey}{retry_count}) {
++ if($self->{postgrey}{tarpit} && ! $self->{postgrey}{targrey}) {
++ # do tarpit and greylist if tarpit option only
++ # don't add message after greylist_action
++ return "SLEEP $self->{postgrey}{tarpit}, $self->{postgrey}{greylist_action}";
++ }
++ if($self->{postgrey}{targrey}) {
++ # do tarpit if targrey option
++ # add tarpit blacklist
++ my $tarpit_db = $self->{postgrey}{db_tarpit};
++ my $tarpit_key = $attr->{client_address};
++ my $tarpit_last = $tarpit_db->{$tarpit_key};
++ $tarpit_last = 0 unless (defined $tarpit_last);
++ $tarpit_db->{$tarpit_key} = "$now" if ($now >= $tarpit_last+300); # update if 5min ago
++
++ # return sleep if not tarpit blacklisted
++ return "SLEEP $self->{postgrey}{tarpit}" if ($tarpit_last == 0);
++ # greylist if tarpit blacklisted
++ }
+ my $msg = $self->{postgrey}{greylist_text};
+ # Workaround for an Exchange bug related to Greylisting:
+ # use DSN 4.2.0 instead of the default 4.7.1. This works
+@@ -517,6 +577,7 @@
+ 'syslogfacility|syslog-facility|facility=s',
+ 'retry-window=s', 'greylist-action=s', 'greylist-text=s', 'privacy',
+ 'hostname=s', 'exim', 'listen-queue-size=i', 'x-greylist-header=s',
++ 'tarpit:s', 'targrey', 'retry-count=i', 'auto-whitelist-delay=i',
+ ) or exit(1);
+ # note: lookup-by-subnet can be given for compatibility, but it is default
+ # so do not do nothing with it...
+@@ -606,7 +667,9 @@
+ awl_clients => defined $opt{'auto-whitelist-clients'} ?
+ ($opt{'auto-whitelist-clients'} ne '' ?
+ $opt{'auto-whitelist-clients'} : 5) : 5,
++ awl_delay => $opt{'auto-whitelist-delay'} || 3600,
+ retry_window => $retry_window,
++ retry_count => $opt{'retry-count'} || 1,
+ greylist_action => $opt{'greylist-action'} || 'DEFER_IF_PERMIT',
+ greylist_text => $opt{'greylist-text'} || 'Greylisted, see http://postgrey.schweikert.ch/help/%r.html',
+ whitelist_clients_files => $opt{'whitelist-clients'} ||
+@@ -618,6 +681,10 @@
+ hostname => defined $opt{hostname} ? $opt{hostname} : hostname,
+ exim => defined $opt{'exim'},
+ x_greylist_header => $opt{'x-greylist-header'} || 'X-Greylist: delayed %t seconds by postgrey-%v at %h; %d',
++ tarpit => defined $opt{'tarpit'} ?
++ ($opt{'tarpit'} ne '' ?
++ $opt{'tarpit'} : 65) : undef,
++ targrey => defined $opt{'targrey'},
+ },
+ }, 'postgrey';
+
+@@ -633,6 +700,11 @@
+ require Digest::SHA;
+ }
+
++ # --targrey needs tarpit sec
++ if(defined $opt{'targrey'} && ! defined $opt{'tarpit'}) {
++ $server->{postgrey}{tarpit} = 125;
++ }
++
+ $0 = join(' ', @{$server->{server}{commandline}});
+ $server->run;
+
+@@ -711,6 +783,13 @@
+ -Env => $self->{postgrey}{db_env}
+ ) or die "ERROR: can't create database $self->{server}{dbdir}/postgrey_clients.db: $!\n";
+ }
++ if($self->{postgrey}{targrey}) { # use targrey
++ tie(%{$self->{postgrey}{db_tarpit}}, 'BerkeleyDB::Btree',
++ -Filename => 'tarpit_clients.db',
++ -Flags => DB_CREATE,
++ -Env => $self->{postgrey}{db_env}
++ ) or die "ERROR: can't create database $self->{server}{dbdir}/tarpit_clients.db: $!\n";
++ }
+ }
+
+ sub mux_input()
diff --git a/mail-filter/postgrey/metadata.xml b/mail-filter/postgrey/metadata.xml
new file mode 100644
index 00000000000..ccb3728161d
--- /dev/null
+++ b/mail-filter/postgrey/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-mail</herd>
+<herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>andreis.vinogradovs@gmail.com</email>
+ <name>Andreis Vinogradovs</name>
+ </maintainer>
+ <maintainer>
+ <email>qnikst@gentoo.org</email>
+ <name>Alexander Vershilov</name>
+ </maintainer>
+<longdescription>Postgrey is a Postfix policy server implementing greylisting developed by David Schweikert at the ISG.EE.</longdescription>
+<use>
+ <flag name='targrey'>Enables the targrey patch</flag>
+</use>
+</pkgmetadata>
diff --git a/mail-filter/postgrey/postgrey-1.34-r1.ebuild b/mail-filter/postgrey/postgrey-1.34-r1.ebuild
new file mode 100644
index 00000000000..d865c23ea92
--- /dev/null
+++ b/mail-filter/postgrey/postgrey-1.34-r1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils user
+
+DESCRIPTION="Postgrey is a Postfix policy server implementing greylisting"
+HOMEPAGE="http://postgrey.schweikert.ch/"
+SRC_URI="http://postgrey.schweikert.ch/pub/${P}.tar.gz
+ http://postgrey.schweikert.ch/pub/old/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 hppa ~ppc ppc64 x86"
+IUSE="targrey"
+
+DEPEND=""
+RDEPEND=">=dev-lang/perl-5.6.0
+ dev-perl/net-server
+ dev-perl/IO-Multiplex
+ dev-perl/BerkeleyDB
+ dev-perl/Net-DNS
+ dev-perl/Parse-Syslog
+ dev-perl/Net-RBLClient
+ >=sys-libs/db-4.1"
+
+pkg_setup() {
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 /dev/null ${PN}
+}
+
+src_prepare() {
+ if use targrey ; then
+ epatch "${FILESDIR}"/targrey-0.31-postgrey-1.34.patch
+ fi
+}
+
+src_install() {
+ # postgrey data/DB in /var
+ diropts -m0770 -o ${PN} -g ${PN}
+ dodir /var/spool/postfix/${PN}
+ keepdir /var/spool/postfix/${PN}
+ fowners postgrey:postgrey /var/spool/postfix/${PN}
+ fperms 0770 /var/spool/postfix/${PN}
+
+ # postgrey binary
+ dosbin ${PN}
+ dosbin contrib/postgreyreport
+
+ # policy-test script
+ dosbin policy-test
+
+ # postgrey data in /etc/postfix
+ insinto /etc/postfix
+ insopts -o root -g ${PN} -m 0640
+ doins postgrey_whitelist_clients postgrey_whitelist_recipients
+
+ # documentation
+ dodoc Changes README
+
+ # init.d + conf.d files
+ insopts -o root -g root -m 755
+ newinitd "${FILESDIR}"/${PN}.rc.new ${PN}
+ insopts -o root -g root -m 640
+ newconfd "${FILESDIR}"/${PN}.conf.new ${PN}
+}
diff --git a/mail-filter/postgrey/postgrey-1.34-r2.ebuild b/mail-filter/postgrey/postgrey-1.34-r2.ebuild
new file mode 100644
index 00000000000..0ece65fcb5b
--- /dev/null
+++ b/mail-filter/postgrey/postgrey-1.34-r2.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils user
+
+DESCRIPTION="Postgrey is a Postfix policy server implementing greylisting"
+HOMEPAGE="http://postgrey.schweikert.ch/"
+SRC_URI="http://postgrey.schweikert.ch/pub/${P}.tar.gz
+ http://postgrey.schweikert.ch/pub/old/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~x86"
+IUSE="targrey"
+
+DEPEND=""
+RDEPEND=">=dev-lang/perl-5.6.0
+ dev-perl/net-server
+ dev-perl/IO-Multiplex
+ dev-perl/BerkeleyDB
+ dev-perl/Net-DNS
+ dev-perl/Parse-Syslog
+ dev-perl/Net-RBLClient
+ >=sys-libs/db-4.1"
+
+pkg_setup() {
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 /dev/null ${PN}
+}
+
+src_prepare() {
+ if use targrey ; then
+ epatch "${FILESDIR}"/targrey-0.31-postgrey-1.34.patch
+ fi
+ sed -i 's@#!/usr/bin/perl -T -w@#!/usr/bin/perl -w@' postgrey || die "sed failed"
+}
+
+src_install() {
+ # postgrey data/DB in /var
+ diropts -m0770 -o ${PN} -g ${PN}
+ dodir /var/spool/postfix/${PN}
+ keepdir /var/spool/postfix/${PN}
+ fowners postgrey:postgrey /var/spool/postfix/${PN}
+ fperms 0770 /var/spool/postfix/${PN}
+
+ # postgrey binary
+ dosbin ${PN}
+ dosbin contrib/postgreyreport
+
+ # policy-test script
+ dosbin policy-test
+
+ # postgrey data in /etc/postfix
+ insinto /etc/postfix
+ insopts -o root -g ${PN} -m 0640
+ doins postgrey_whitelist_clients postgrey_whitelist_recipients
+
+ # documentation
+ dodoc Changes README
+
+ # init.d + conf.d files
+ insopts -o root -g root -m 755
+ newinitd "${FILESDIR}"/${PN}.rc.new ${PN}
+ insopts -o root -g root -m 640
+ newconfd "${FILESDIR}"/${PN}.conf.new ${PN}
+}
diff --git a/mail-filter/postgrey/postgrey-1.34-r3.ebuild b/mail-filter/postgrey/postgrey-1.34-r3.ebuild
new file mode 100644
index 00000000000..d6e8f3b937d
--- /dev/null
+++ b/mail-filter/postgrey/postgrey-1.34-r3.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils user
+
+DESCRIPTION="Postgrey is a Postfix policy server implementing greylisting"
+HOMEPAGE="http://postgrey.schweikert.ch/"
+SRC_URI="http://postgrey.schweikert.ch/pub/${P}.tar.gz
+ http://postgrey.schweikert.ch/pub/old/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 hppa ~ppc ppc64 x86"
+IUSE="targrey"
+
+DEPEND=""
+RDEPEND=">=dev-lang/perl-5.6.0
+ dev-perl/net-server
+ dev-perl/IO-Multiplex
+ dev-perl/BerkeleyDB
+ dev-perl/Net-DNS
+ dev-perl/Parse-Syslog
+ dev-perl/Net-RBLClient
+ >=sys-libs/db-4.1"
+
+pkg_setup() {
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 /dev/null ${PN}
+}
+
+src_prepare() {
+ if use targrey ; then
+ epatch "${FILESDIR}"/targrey-0.31-postgrey-1.34.patch
+ fi
+ epatch "${FILESDIR}"/${P}-perl-5.18.patch
+ # bug 479400
+ sed -i 's@#!/usr/bin/perl -T -w@#!/usr/bin/perl -w@' postgrey || die "sed failed"
+}
+
+src_install() {
+ # postgrey data/DB in /var
+ diropts -m0770 -o ${PN} -g ${PN}
+ dodir /var/spool/postfix/${PN}
+ keepdir /var/spool/postfix/${PN}
+ fowners postgrey:postgrey /var/spool/postfix/${PN}
+ fperms 0770 /var/spool/postfix/${PN}
+
+ # postgrey binary
+ dosbin ${PN}
+ dosbin contrib/postgreyreport
+
+ # policy-test script
+ dosbin policy-test
+
+ # postgrey data in /etc/postfix
+ insinto /etc/postfix
+ insopts -o root -g ${PN} -m 0640
+ doins postgrey_whitelist_clients postgrey_whitelist_recipients
+
+ # documentation
+ dodoc Changes README
+
+ # init.d + conf.d files
+ insopts -o root -g root -m 755
+ newinitd "${FILESDIR}"/${PF}.rc.new ${PN}
+ insopts -o root -g root -m 640
+ newconfd "${FILESDIR}"/${PN}.conf.new ${PN}
+}
diff --git a/mail-filter/postgrey/postgrey-1.34.ebuild b/mail-filter/postgrey/postgrey-1.34.ebuild
new file mode 100644
index 00000000000..fc552595b6d
--- /dev/null
+++ b/mail-filter/postgrey/postgrey-1.34.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils user
+
+DESCRIPTION="Postgrey is a Postfix policy server implementing greylisting"
+HOMEPAGE="http://postgrey.schweikert.ch/"
+SRC_URI="http://postgrey.schweikert.ch/pub/${P}.tar.gz
+ http://postgrey.schweikert.ch/pub/old/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 hppa ~ppc ppc64 x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=">=dev-lang/perl-5.6.0
+ dev-perl/net-server
+ dev-perl/IO-Multiplex
+ dev-perl/BerkeleyDB
+ dev-perl/Net-DNS
+ dev-perl/Parse-Syslog
+ dev-perl/Net-RBLClient
+ >=sys-libs/db-4.1"
+
+pkg_setup() {
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 /dev/null ${PN}
+}
+
+src_install() {
+ # postgrey data/DB in /var
+ diropts -m0770 -o ${PN} -g ${PN}
+ dodir /var/spool/postfix/${PN}
+ keepdir /var/spool/postfix/${PN}
+ fowners postgrey:postgrey /var/spool/postfix/${PN}
+ fperms 0770 /var/spool/postfix/${PN}
+
+ # postgrey binary
+ dosbin ${PN}
+ dosbin contrib/postgreyreport
+
+ # policy-test script
+ dosbin policy-test
+
+ # postgrey data in /etc/postfix
+ insinto /etc/postfix
+ insopts -o root -g ${PN} -m 0640
+ doins postgrey_whitelist_clients postgrey_whitelist_recipients
+
+ # documentation
+ dodoc Changes README
+
+ # init.d + conf.d files
+ insopts -o root -g root -m 755
+ newinitd "${FILESDIR}"/${PN}.rc.new ${PN}
+ insopts -o root -g root -m 640
+ newconfd "${FILESDIR}"/${PN}.conf.new ${PN}
+}
diff --git a/mail-filter/postgrey/postgrey-1.35-r1.ebuild b/mail-filter/postgrey/postgrey-1.35-r1.ebuild
new file mode 100644
index 00000000000..6fbe9eece4d
--- /dev/null
+++ b/mail-filter/postgrey/postgrey-1.35-r1.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils user
+
+DESCRIPTION="Postgrey is a Postfix policy server implementing greylisting"
+HOMEPAGE="http://postgrey.schweikert.ch/"
+SRC_URI="http://postgrey.schweikert.ch/pub/${P}.tar.gz
+http://postgrey.schweikert.ch/pub/old/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~x86"
+IUSE="targrey"
+
+DEPEND=""
+RDEPEND=">=dev-lang/perl-5.6.0
+ dev-perl/net-server
+ dev-perl/IO-Multiplex
+ dev-perl/BerkeleyDB
+ dev-perl/Net-DNS
+ dev-perl/Parse-Syslog
+ dev-perl/Net-RBLClient
+ virtual/perl-Digest-SHA
+ >=sys-libs/db-4.1"
+
+pkg_setup() {
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 /dev/null ${PN}
+}
+
+src_prepare() {
+ if use targrey ; then
+ epatch "${FILESDIR}"/targrey-0.31-postgrey-1.34.patch
+ fi
+ # bug 479400
+ sed -i 's@#!/usr/bin/perl -T -w@#!/usr/bin/perl -w@' postgrey || die "sed failed"
+}
+
+src_install() {
+ # postgrey data/DB in /var
+ diropts -m0770 -o ${PN} -g ${PN}
+ dodir /var/spool/postfix/${PN}
+ keepdir /var/spool/postfix/${PN}
+ fowners postgrey:postgrey /var/spool/postfix/${PN}
+ fperms 0770 /var/spool/postfix/${PN}
+
+ # postgrey binary
+ dosbin ${PN}
+ dosbin contrib/postgreyreport
+
+ # policy-test script
+ dosbin policy-test
+
+ # postgrey data in /etc/postfix
+ insinto /etc/postfix
+ insopts -o root -g ${PN} -m 0640
+ doins postgrey_whitelist_clients postgrey_whitelist_recipients
+
+ # documentation
+ dodoc Changes README README.exim
+
+ # init.d + conf.d files
+ insopts -o root -g root -m 755
+ newinitd "${FILESDIR}"/${PN}-1.34-r3.rc.new ${PN}
+ insopts -o root -g root -m 640
+ newconfd "${FILESDIR}"/${PN}.conf.new ${PN}
+}
diff --git a/mail-filter/postgrey/postgrey-1.35.ebuild b/mail-filter/postgrey/postgrey-1.35.ebuild
new file mode 100644
index 00000000000..938b52e1e98
--- /dev/null
+++ b/mail-filter/postgrey/postgrey-1.35.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils user
+
+DESCRIPTION="Postgrey is a Postfix policy server implementing greylisting"
+HOMEPAGE="http://postgrey.schweikert.ch/"
+SRC_URI="http://postgrey.schweikert.ch/pub/${P}.tar.gz
+http://postgrey.schweikert.ch/pub/old/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~x86"
+IUSE="targrey"
+
+DEPEND=""
+RDEPEND=">=dev-lang/perl-5.6.0
+dev-perl/net-server
+dev-perl/IO-Multiplex
+dev-perl/BerkeleyDB
+dev-perl/Net-DNS
+dev-perl/Parse-Syslog
+dev-perl/Net-RBLClient
+virtual/perl-Digest-SHA
+>=sys-libs/db-4.1"
+
+pkg_setup() {
+enewgroup ${PN}
+enewuser ${PN} -1 -1 /dev/null ${PN}
+}
+
+src_prepare() {
+if use targrey ; then
+epatch "${FILESDIR}"/targrey-0.31-postgrey-1.34.patch
+fi
+sed -i 's@#!/usr/bin/perl -T -w@#!/usr/bin/perl -w@' postgrey || die "sed failed"
+}
+
+src_install() {
+# postgrey data/DB in /var
+diropts -m0770 -o ${PN} -g ${PN}
+dodir /var/spool/postfix/${PN}
+keepdir /var/spool/postfix/${PN}
+fowners postgrey:postgrey /var/spool/postfix/${PN}
+fperms 0770 /var/spool/postfix/${PN}
+
+# postgrey binary
+dosbin ${PN}
+dosbin contrib/postgreyreport
+
+# policy-test script
+dosbin policy-test
+
+# postgrey data in /etc/postfix
+insinto /etc/postfix
+insopts -o root -g ${PN} -m 0640
+doins postgrey_whitelist_clients postgrey_whitelist_recipients
+
+# documentation
+dodoc Changes README README.exim
+
+# init.d + conf.d files
+insopts -o root -g root -m 755
+newinitd "${FILESDIR}"/${PN}.rc.new ${PN}
+insopts -o root -g root -m 640
+newconfd "${FILESDIR}"/${PN}.conf.new ${PN}
+}
diff --git a/mail-filter/procmail-lib/Manifest b/mail-filter/procmail-lib/Manifest
new file mode 100644
index 00000000000..6ae015435c4
--- /dev/null
+++ b/mail-filter/procmail-lib/Manifest
@@ -0,0 +1,2 @@
+DIST procmail-lib-2008.1108.tar.gz 763653 SHA256 11604d007fc95ba084b824a0c8a15aa55281670a14fb4e4a05033c10f1536a65 SHA512 54a9ffa7bd5e5554c0d48efa59c22ed4aaa635d3b87a3b8cdc2b660ab8a4acdd1dfa39d7d816ed3ebc379ddc7e8e58e54e0f0fb8c8f6eb51661201f03bc0332b WHIRLPOOL b6661ab8e97966fc6075409501ff83c10093c13989ebb745c1db071029a9dd83ad7ef2cc5df19ffd315552dbb3cb72c7ce5dce2336e82b253bbf51b7781119dc
+DIST procmail-lib-2009.1202.tar.gz 765078 SHA256 f08fc745b66d0743974dfe8194b5016766d68fa8bea0af7da35c9adb60e46b27 SHA512 374681de60f7ba55f6581b248684841482eca01b04bf81b67fca8fc62caf1e7acc5e7562db16f6aa11fa072bee032e54e925081483e3987f820c9863d19e4a97 WHIRLPOOL 52c11be6e01497b009f5175eac9718a4aacb8a9fdb141af9dd45c39792430191e578395ab2c1bbd452cae4920c18ed3a3383b2580d01fa6e24de776cc314a501
diff --git a/mail-filter/procmail-lib/metadata.xml b/mail-filter/procmail-lib/metadata.xml
new file mode 100644
index 00000000000..875462bb5ba
--- /dev/null
+++ b/mail-filter/procmail-lib/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <upstream>
+ <remote-id type="freshmeat">procmail-lib</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/procmail-lib/procmail-lib-20081108.ebuild b/mail-filter/procmail-lib/procmail-lib-20081108.ebuild
new file mode 100644
index 00000000000..5c8016e5a81
--- /dev/null
+++ b/mail-filter/procmail-lib/procmail-lib-20081108.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+MY_PV="${PV:0:4}.${PV:4}"
+
+DESCRIPTION="Procmail Module Library is a collection of modules for Procmail"
+HOMEPAGE="http://freshmeat.net/projects/procmail-lib"
+SRC_URI="mirror://nongnu/${PN}/${PN}-${MY_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc sparc x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="mail-filter/procmail"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+src_install() {
+ emake DESTDIR="${D}" prefix=/usr install || die "make install failed"
+ mv "${D}"/usr/share/doc/"${PN}" "${D}"/usr/share/doc/"${PF}"
+}
diff --git a/mail-filter/procmail-lib/procmail-lib-20091202.ebuild b/mail-filter/procmail-lib/procmail-lib-20091202.ebuild
new file mode 100644
index 00000000000..c9a03979ae4
--- /dev/null
+++ b/mail-filter/procmail-lib/procmail-lib-20091202.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+MY_PV="${PV:0:4}.${PV:4}"
+
+DESCRIPTION="Procmail Module Library is a collection of modules for Procmail"
+HOMEPAGE="http://freshmeat.net/projects/procmail-lib"
+SRC_URI="mirror://nongnu/${PN}/${PN}-${MY_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="mail-filter/procmail"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+src_install() {
+ emake DESTDIR="${D}" prefix=/usr install || die "make install failed"
+ mv "${D}"/usr/share/doc/"${PN}" "${D}"/usr/share/doc/"${PF}"
+}
diff --git a/mail-filter/procmail/Manifest b/mail-filter/procmail/Manifest
new file mode 100644
index 00000000000..1d4b08fc68b
--- /dev/null
+++ b/mail-filter/procmail/Manifest
@@ -0,0 +1 @@
+DIST procmail-3.22.tar.gz 226817 SHA256 087c75b34dd33d8b9df5afe9e42801c9395f4bf373a784d9bc97153b0062e117 SHA512 3d0658329a55957a8d5741e03b0853b030c4524acef30641663213aa9eefc8264f8cc2b68a00a89e5f9f0f7c916c41a42e1b6c8df562c545ba97d8ab9049a936 WHIRLPOOL f2ad3fae5919caba6a14a004b8ec5f185265fdcc3491b1562804d8c5ce4d2f18dea37c777adefef752f9db7a2bb26aa24b5e2215a455a30138ffa39f09c538db
diff --git a/mail-filter/procmail/files/gentoo-maildir3.diff b/mail-filter/procmail/files/gentoo-maildir3.diff
new file mode 100644
index 00000000000..51dfef64ae8
--- /dev/null
+++ b/mail-filter/procmail/files/gentoo-maildir3.diff
@@ -0,0 +1,12 @@
+--- procmail-3.22/src/authenticate.c.orig 2002-07-26 20:38:52.000000000 -0400
++++ procmail-3.22/src/authenticate.c 2002-07-26 20:57:56.000000000 -0400
+@@ -39,7 +39,7 @@
+ #include "authenticate.h"
+
+ #ifndef MAILSPOOLDIR
+-#define MAILSPOOLDIR "/var/spool/mail/" /* watch the trailing / */
++#define MAILSPOOLDIR "" /* watch the trailing / */
+ #endif
+ #ifndef MAILSPOOLSUFFIX
+ #define MAILSPOOLSUFFIX "" /* suffix to force maildir or MH style */
+
diff --git a/mail-filter/procmail/files/procmail-3.22-glibc-2.10.patch b/mail-filter/procmail/files/procmail-3.22-glibc-2.10.patch
new file mode 100644
index 00000000000..2663bf50118
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-3.22-glibc-2.10.patch
@@ -0,0 +1,70 @@
+diff -NrU5 procmail-3.22.orig/src/fields.c procmail-3.22/src/fields.c
+--- procmail-3.22.orig/src/fields.c 2009-05-21 18:21:25.000000000 +0200
++++ procmail-3.22/src/fields.c 2009-05-21 18:22:14.000000000 +0200
+@@ -108,20 +108,20 @@
+ extractfield(p);
+ }
+ /* try and append one valid field to rdheader from stdin */
+ int readhead P((void))
+ { int idlen;
+- getline();
++ procmail_getline();
+ if((idlen=breakfield(buf,buffilled))<=0) /* not the start of a valid field */
+ return 0;
+ if(idlen==STRLEN(FROM)&&eqFrom_(buf)) /* it's a From_ line */
+ { if(rdheader)
+ return 0; /* the From_ line was a fake! */
+- for(;buflast=='>';getline()); /* gather continued >From_ lines */
++ for(;buflast=='>';procmail_getline()); /* gather continued >From_ lines */
+ }
+ else
+- for(;;getline()) /* get the rest of the continued field */
++ for(;;procmail_getline()) /* get the rest of the continued field */
+ { switch(buflast) /* will this line be continued? */
+ { case ' ':case '\t': /* yep, it sure is */
+ continue;
+ }
+ break;
+diff -NrU5 procmail-3.22.orig/src/formail.c procmail-3.22/src/formail.c
+--- procmail-3.22.orig/src/formail.c 2009-05-21 18:21:25.000000000 +0200
++++ procmail-3.22/src/formail.c 2009-05-21 18:22:14.000000000 +0200
+@@ -817,11 +817,11 @@
+ #ifdef MAILBOX_SEPARATOR
+ if(!strncmp(emboxsep,buf,STRLEN(emboxsep))) /* end of mail? */
+ { if(split) /* gobble up the next start separator */
+ { buffilled=0;
+ #ifdef sMAILBOX_SEPARATOR
+- getline();buffilled=0; /* but only if it's defined */
++ procmail_getline();buffilled=0; /* but only if it's defined */
+ #endif
+ if(buflast!=EOF) /* if any */
+ goto splitit;
+ break;
+ }
+diff -NrU5 procmail-3.22.orig/src/formisc.c procmail-3.22/src/formisc.c
+--- procmail-3.22.orig/src/formisc.c 2009-05-21 18:21:25.000000000 +0200
++++ procmail-3.22/src/formisc.c 2009-05-21 18:22:14.000000000 +0200
+@@ -113,11 +113,11 @@
+ { if(buffilled==buflen)
+ buf=realloc(buf,buflen+=Bsize);
+ buf[buffilled++]=c;
+ }
+
+-int getline P((void)) /* read a newline-terminated line */
++int procmail_getline P((void)) /* read a newline-terminated line */
+ { if(buflast==EOF) /* at the end of our Latin already? */
+ { loadchar('\n'); /* fake empty line */
+ return EOF; /* spread the word */
+ }
+ loadchar(buflast); /* load leftover into the buffer */
+diff -NrU5 procmail-3.22.orig/src/formisc.h procmail-3.22/src/formisc.h
+--- procmail-3.22.orig/src/formisc.h 2009-05-21 18:21:25.000000000 +0200
++++ procmail-3.22/src/formisc.h 2009-05-21 18:22:14.000000000 +0200
+@@ -15,6 +15,6 @@
+ closemine P((void)),
+ opensink P((void));
+ char*
+ skipwords P((char*start));
+ int
+- getline P((void));
++ procmail_getline P((void));
diff --git a/mail-filter/procmail/files/procmail-3.22-interix.patch b/mail-filter/procmail/files/procmail-3.22-interix.patch
new file mode 100644
index 00000000000..a24c052f3d2
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-3.22-interix.patch
@@ -0,0 +1,16 @@
+diff -ru procmail-3.22.orig/src/setid.c procmail-3.22/src/setid.c
+--- procmail-3.22.orig/src/setid.c 2010-02-04 10:05:43 +0100
++++ procmail-3.22/src/setid.c 2010-02-04 10:11:18 +0100
+@@ -15,7 +15,11 @@
+ return EX_USAGE;
+ }
+ endpwent();
+- if(initgroups(argv[1],p->pw_gid)||setgid(p->pw_gid)||setuid(p->pw_uid))
++ if(
++#ifndef __INTERIX
++ initgroups(argv[1],p->pw_gid)||
++#endif
++ setgid(p->pw_gid)||setuid(p->pw_uid))
+ return EX_OSERR;
+ if(fopen(CHECK_FILE,"r"))
+ { struct stat stbuf;
diff --git a/mail-filter/procmail/files/procmail-comsat-segfault.diff b/mail-filter/procmail/files/procmail-comsat-segfault.diff
new file mode 100644
index 00000000000..e96bb5d94a3
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-comsat-segfault.diff
@@ -0,0 +1,20 @@
+--- src/comsat.c.old 2005-08-17 19:17:20.000000000 +0200
++++ src/comsat.c 2005-08-17 19:18:19.000000000 +0200
+@@ -92,7 +92,7 @@
+ }
+ if(newvalid) /* so far, so good */
+ { int s;
+- if(!*chp) /* no service */
++ if(!chad||!*chp) /* no service */
+ chp=BIFF_serviceport; /* new balls please! */
+ s=strtol(chp,&chad,10);
+ if(chp!=chad) /* the service is not numeric */
+@@ -120,7 +120,7 @@
+ { int s;const char*p;
+ if(!csvalid||!buf) /* is comat on and set to a valid address? */
+ return;
+- if(!*cslgname||strlen(cslgname)+2>linebuf) /* is $LOGNAME bogus? */
++ if(!cslgname||!*cslgname||strlen(cslgname)+2>linebuf) /* is $LOGNAME bogus? */
+ return;
+ if(!(p=folder?folder:cslastf)) /* do we have a folder? */
+ return;
diff --git a/mail-filter/procmail/files/procmail-lazy-bindings.diff b/mail-filter/procmail/files/procmail-lazy-bindings.diff
new file mode 100644
index 00000000000..f1c4221650e
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-lazy-bindings.diff
@@ -0,0 +1,16 @@
+--- src/Makefile.0.old 2005-05-23 10:34:25.000000000 +0200
++++ src/Makefile.0 2005-05-23 10:34:52.000000000 +0200
+@@ -18,11 +18,11 @@
+ .PRECIOUS: Makefile
+
+ procmail: procmail.$(O) $(PM_OBJ) setid
+- $(CC) $(CFLAGS) $@.$(O) $(PM_OBJ) -o $@ $(LDFLAGS)
++ $(CC) $(CFLAGS) $@.$(O) $(PM_OBJ) -o $@ -Wl,-z,now $(LDFLAGS)
+ @test -z "$(STRIP)" || ( echo $(STRIP) $@; $(STRIP) $@ )
+
+ lockfile: lockfile.$(O) $(LF_OBJ)
+- $(CC) $(CFLAGS) $@.$(O) $(LF_OBJ) -o $@ $(LDFLAGS)
++ $(CC) $(CFLAGS) $@.$(O) $(LF_OBJ) -o $@ -Wl,-z,now $(LDFLAGS)
+ @test -z "$(STRIP)" || ( echo $(STRIP) $@; $(STRIP) $@ )
+
+ formail: formail.$(O) $(FM_OBJ)
diff --git a/mail-filter/procmail/files/procmail-maxprocs-fix.diff b/mail-filter/procmail/files/procmail-maxprocs-fix.diff
new file mode 100644
index 00000000000..c78b000a8b9
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-maxprocs-fix.diff
@@ -0,0 +1,11 @@
+--- src/formisc.c.orig 2006-01-22 00:35:30.000000000 -0800
++++ src/formisc.c 2006-01-22 00:35:55.000000000 -0800
+@@ -183,7 +183,7 @@
+ retval=excode;
+ } /* reap some children */
+ while(childlimit&&children>=childlimit||(child=fork())==-1&&children)
+- for(--children;(excode=waitfor((pid_t)0))!=NO_PROCESS;)
++ for(;(excode=waitfor((pid_t)0))!=NO_PROCESS;)
+ { if(excode!=EXIT_SUCCESS)
+ retval=excode;
+ if(--children<=maxchild)
diff --git a/mail-filter/procmail/files/procmail-pipealloc.diff b/mail-filter/procmail/files/procmail-pipealloc.diff
new file mode 100644
index 00000000000..fdd5cc97328
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-pipealloc.diff
@@ -0,0 +1,21 @@
+diff -rc procmail-3.22/src/pipes.c procmail-3.22-fixed/src/pipes.c
+*** procmail-3.22/src/pipes.c Tue Sep 11 00:58:44 2001
+--- procmail-3.22-fixed/src/pipes.c Wed Nov 21 23:53:39 2007
+***************
+*** 194,200 ****
+ makeblock(&temp,Stdfilled);
+ tmemmove(temp.p,Stdout,Stdfilled);
+ readdyn(&temp,&Stdfilled,Stdfilled+backlen+1);
+! Stdout=realloc(Stdout,&Stdfilled+1);
+ tmemmove(Stdout,temp.p,Stdfilled+1);
+ freeblock(&temp);
+ retStdout(Stdout,pwait&&pipw,!backblock);
+--- 194,200 ----
+ makeblock(&temp,Stdfilled);
+ tmemmove(temp.p,Stdout,Stdfilled);
+ readdyn(&temp,&Stdfilled,Stdfilled+backlen+1);
+! Stdout=realloc(Stdout,Stdfilled+1);
+ tmemmove(Stdout,temp.p,Stdfilled+1);
+ freeblock(&temp);
+ retStdout(Stdout,pwait&&pipw,!backblock);
+
diff --git a/mail-filter/procmail/files/procmail-prefix.patch b/mail-filter/procmail/files/procmail-prefix.patch
new file mode 100644
index 00000000000..6063b92db2b
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-prefix.patch
@@ -0,0 +1,155 @@
+--- config.h~ 2007-10-03 17:55:24 +0200
++++ config.h 2007-10-03 18:01:38 +0200
+@@ -116,11 +116,11 @@
+ is not found, maildelivery will proceed as normal to the default
+ system mailbox. This also must be an absolute path */
+
+-#define ETCRC "/etc/procmailrc" /* optional global procmailrc startup
++#define ETCRC "@GENTOO_PORTAGE_EPREFIX@/etc/procmailrc" /* optional global procmailrc startup
+ file (will only be read if procmail
+ is started with no rcfile on the command line). */
+
+-#define ETCRCS "/etc/procmailrcs/" /* optional trusted path prefix for
++#define ETCRCS "@GENTOO_PORTAGE_EPREFIX@/etc/procmailrcs/" /* optional trusted path prefix for
+ rcfiles which will be executed with
+ the uid of the owner of the rcfile (this only happens if procmail is
+ called with the -m option, without variable assignments on the command
+@@ -168,7 +168,7 @@
+ #define INEFFICIENTrealloc /* don't pussy-foot around */
+ #endif
+ #define MAXinMEM (1024*1024) /* when to switch to mmap() */
+-#define MMAP_DIR "/var/spool/procmail/" /* where to put */
++#define MMAP_DIR "@GENTOO_PORTAGE_EPREFIX@/var/spool/procmail/" /* where to put */
+ #endif /* the files */
+ #define MINlogbuf 81 /* fit an entire line */
+ #define MAXlogbuf 1000 /* in case someone abuses LOG */
+@@ -220,8 +220,8 @@
+ #define DEFcomsat offvalue /* when an rcfile has been specified */
+ /* set to either "offvalue" or "empty" */
+
+-#define BinSh "/bin/sh"
+-#define ROOT_DIR "/"
++#define BinSh "@GENTOO_PORTAGE_EPREFIX@/bin/sh"
++#define ROOT_DIR "@GENTOO_PORTAGE_EPREFIX@"
+ #define DEAD_LETTER "/tmp/dead.letter" /* $ORGMAIL if no passwd entry */
+ #define DevNull "/dev/null"
+ #define NICE_RANGE 39 /* maximal nice difference */
+--- Makefile~ 2007-10-03 18:07:51 +0200
++++ Makefile 2007-10-03 18:10:07 +0200
+@@ -2,7 +2,7 @@
+
+ # BASENAME should point to where the whole lot will be installed
+ # change BASENAME to your home directory if need be
+-BASENAME = /usr
++BASENAME = @GENTOO_PORTAGE_EPREFIX@/usr
+ # For display in the man pages
+ VISIBLE_BASENAME= $(BASENAME)
+
+@@ -79,7 +79,7 @@
+ # -lresolv # not really needed, is it?
+
+ # Informal list of directories where we look for the libraries in SEARCHLIBS
+-LIBPATHS=/lib /usr/lib /usr/local/lib
++LIBPATHS=@GENTOO_PORTAGE_EPREFIX@/lib @GENTOO_PORTAGE_EPREFIX@/usr/lib
+
+ GCC_WARNINGS = -O2 -pedantic -Wreturn-type -Wunused -Wformat -Wtraditional \
+ -Wpointer-arith -Wconversion -Waggregate-return \
+@@ -97,10 +97,10 @@
+ ####CC = cc # gcc
+ # object file extension
+ O = o
+-RM = /bin/rm -f
++RM = @GENTOO_PORTAGE_EPREFIX@/bin/rm -f
+ MV = mv -f
+ LN = ln
+-BSHELL = /bin/sh
++BSHELL = @GENTOO_PORTAGE_EPREFIX@/bin/sh
+ INSTALL = cp
+ DEVNULL = /dev/null
+ STRIP = strip
+@@ -112,7 +112,7 @@
+ MANS5S = procmailrc procmailsc procmailex
+
+ # Possible locations for the sendmail.cf file
+-SENDMAILCFS = /etc/mail/sendmail.cf /etc/sendmail.cf /usr/lib/sendmail.cf
++SENDMAILCFS = @GENTOO_PORTAGE_EPREFIX@/etc/mail/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/etc/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/usr/lib/sendmail.cf
+
+ # Makefile.1 - mark, don't (re)move this, a sed script needs it
+
+--- src/autoconf~ 2001-09-11 06:55:46 +0200
++++ src/autoconf 2007-10-03 19:17:51 +0200
+@@ -1,4 +1,4 @@
+-#! /bin/sh
++#! @GENTOO_PORTAGE_EPREFIX@/bin/sh
+ :
+ # Copyright (c) 1990-1997, S.R. van den Berg, The Netherlands
+ # $Id$
+@@ -1416,20 +1416,10 @@
+
+ found=no
+
+-for a in /var/spool/mail /usr/spool/mail /var/mail /usr/mail /spool/mail
+-do
+- test -d $a -a $found != yes &&
+- echo '#define MAILSPOOLDIR "'$a'/"' >>$ACONF && found=yes
+-done
+-if test $found != yes
+-then
+- echo '#define MAILSPOOLDIR "/var/spool/mail/"' >>$ACONF
+- echo Could not find the system-mailbox directory, supplied default.
+-fi
++echo '#define MAILSPOOLDIR "@GENTOO_PORTAGE_EPREFIX@/var/spool/mail/"' >>$ACONF
+
+ cat >lookfor <<HERE
+-for a in /usr/sbin /usr/lib /lib /usr/etc /etc /usr/bin /bin /usr/local/bin \
+- /usr/lbin /usr/local/lib /usr/local /usr/.lib /local/bin /sbin
++for a in @GENTOO_PORTAGE_EPREFIX@/usr/sbin
+ do
+ if test -f "\$a/\$1"
+ then
+@@ -1458,7 +1448,7 @@
+ grep '^#define SENDMAIL ".*/sendmail"' $ACONF >$DEVNULL ||
+ echo "#define DEFflagsendmail \"\"" >>$ACONF
+
+-a=/tmp/_chowntst.$$
++a=@GENTOO_PORTAGE_EPREFIX@/tmp/_chowntst.$$
+ $RM -r $a
+ OLDTESTDIRS="$a $OLDTESTDIRS"
+ mkdir $a
+@@ -1466,19 +1456,18 @@
+
+ _autotst $a/__ $a/__/__ 4 >>$ACONF
+
+-cat /usr/lib/sendmail.cf /etc/sendmail.cf /etc/mail/sendmail.cf 2>$DEVNULL |
++cat @GENTOO_PORTAGE_EPREFIX@/usr/lib/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/etc/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/etc/mail/sendmail.cf 2>$DEVNULL |
+ grep 'Mlocal.*procmail' >$DEVNULL ||
+ echo '#define CF_no_procmail_yet' >>$ACONF
+
+-cat /usr/lib/sendmail.cf /etc/sendmail.cf /etc/mail/sendmail.cf 2>$DEVNULL |
++cat @GENTOO_PORTAGE_EPREFIX@/usr/lib/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/etc/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/etc/mail/sendmail.cf 2>$DEVNULL |
+ grep '^V' >$DEVNULL ||
+ echo '#define buggy_SENDMAIL' >>$ACONF
+
+-lpath='/bin'
+-bins="/bin"
++lpath='@GENTOO_PORTAGE_EPREFIX@/bin'
++bins='@GENTOO_PORTAGE_EPREFIX@/bin'
+
+-for newd in /usr/bin /usr/ucb /usr/5bin $BINDIR /local/bin /usr/local/bin \
+- /global/bin /usr/bin/X11 /usr/X*/bin
++for newd in @GENTOO_PORTAGE_EPREFIX@/usr/bin
+ do
+ if test -d $newd
+ then
+--- src/recommend.c~ 2007-10-03 19:10:01 +0200
++++ src/recommend.c 2007-10-03 19:11:04 +0200
+@@ -9,8 +9,7 @@
+
+ char mailspooldir[]=MAILSPOOLDIR;
+ const char dirsep[]=DIRSEP,
+- *const checkf[]={"/bin/mail","/bin/lmail","/usr/lib/sendmail",
+- "/usr/lib/smail",0};
++ *const checkf[]={"@GENTOO_PORTAGE_EPREFIX@/usr/bin/sendmail",0};
+
+ int main(argc,argv)const int argc;const char*const argv[];
+ { struct group*grp;struct stat stbuf;gid_t gid=(gid_t)-1;
diff --git a/mail-filter/procmail/metadata.xml b/mail-filter/procmail/metadata.xml
new file mode 100644
index 00000000000..51f94e3fbe0
--- /dev/null
+++ b/mail-filter/procmail/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-mail</herd>
+</pkgmetadata>
diff --git a/mail-filter/procmail/procmail-3.22-r10.ebuild b/mail-filter/procmail/procmail-3.22-r10.ebuild
new file mode 100644
index 00000000000..9f423490bcc
--- /dev/null
+++ b/mail-filter/procmail/procmail-3.22-r10.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic toolchain-funcs prefix
+
+DESCRIPTION="Mail delivery agent/filter"
+HOMEPAGE="http://www.procmail.org/"
+SRC_URI="http://www.procmail.org/${P}.tar.gz"
+
+LICENSE="|| ( Artistic GPL-2 )"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x64-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x86-solaris"
+IUSE="mbox selinux"
+
+DEPEND="virtual/mta"
+RDEPEND="selinux? ( sec-policy/selinux-procmail )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # disable flock, using both fcntl and flock style locking
+ # doesn't work with NFS with 2.6.17+ kernels, bug #156493
+
+ sed -e "s:/\*#define NO_flock_LOCK:#define NO_flock_LOCK:" \
+ -i config.h || die "sed failed"
+
+ if ! use mbox ; then
+ echo "# Use maildir-style mailbox in user's home directory" > "${S}"/procmailrc
+ echo 'DEFAULT=$HOME/.maildir/' >> "${S}"/procmailrc
+ cd "${S}"
+ epatch "${FILESDIR}/gentoo-maildir3.diff"
+ else
+ echo '# Use mbox-style mailbox in /var/spool/mail' > "${S}"/procmailrc
+ echo 'DEFAULT=${EPREFIX}/var/spool/mail/$LOGNAME' >> "${S}"/procmailrc
+ fi
+
+ # Do not use lazy bindings on lockfile and procmail
+ if [[ ${CHOST} != *-darwin* && ${CHOST} != *-interix* ]]; then
+ epatch "${FILESDIR}/${PN}-lazy-bindings.diff"
+ fi
+
+ # Fix for bug #102340
+ epatch "${FILESDIR}/${PN}-comsat-segfault.diff"
+
+ # Fix for bug #119890
+ epatch "${FILESDIR}/${PN}-maxprocs-fix.diff"
+
+ # Prefixify config.h
+ epatch "${FILESDIR}"/${PN}-prefix.patch
+ eprefixify config.h Makefile src/autoconf src/recommend.c
+
+ # Fix for bug #200006
+ epatch "${FILESDIR}/${PN}-pipealloc.diff"
+
+ # Fix for bug #270551
+ epatch "${FILESDIR}/${PN}-3.22-glibc-2.10.patch"
+
+ # Fix for x86-interix - doesn't have initgroups
+ epatch "${FILESDIR}"/${P}-interix.patch
+}
+
+src_compile() {
+ # -finline-functions (implied by -O3) leaves strstr() in an infinite loop.
+ # To work around this, we append -fno-inline-functions to CFLAGS
+ # Since GCC 4.7 we also need -fno-ipa-cp-clone (bug #466552)
+ append-flags -fno-inline-functions -fno-ipa-cp-clone
+
+ sed -e "s:CFLAGS0 = -O:CFLAGS0 = ${CFLAGS}:" \
+ -e "s:LDFLAGS0= -s:LDFLAGS0 = ${LDFLAGS}:" \
+ -e "s:LOCKINGTEST=__defaults__:#LOCKINGTEST=__defaults__:" \
+ -e "s:#LOCKINGTEST=/tmp:LOCKINGTEST=/tmp:" \
+ -i Makefile || die "sed failed"
+
+ emake CC="$(tc-getCC)" || die
+}
+
+src_install() {
+ cd "${S}"/new
+ insinto /usr/bin
+ insopts -m 6755
+ doins procmail || die
+
+ doins lockfile || die
+ fowners root:mail /usr/bin/lockfile
+ fperms 2755 /usr/bin/lockfile
+
+ dobin formail mailstat || die
+ insopts -m 0644
+
+ doman *.1 *.5
+
+ cd "${S}"
+ dodoc FAQ FEATURES HISTORY INSTALL KNOWN_BUGS README
+
+ insinto /etc
+ doins procmailrc || die
+
+ docinto examples
+ dodoc examples/*
+}
+
+pkg_postinst() {
+ if ! use mbox ; then
+ elog "Starting with mail-filter/procmail-3.22-r9 you'll need to ensure"
+ elog "that you configure a mail storage location using DEFAULT in"
+ elog "/etc/procmailrc, for example:"
+ elog "\tDEFAULT=\$HOME/.maildir/"
+ fi
+}
diff --git a/mail-filter/pypolicyd-spf/Manifest b/mail-filter/pypolicyd-spf/Manifest
new file mode 100644
index 00000000000..e13c38e0290
--- /dev/null
+++ b/mail-filter/pypolicyd-spf/Manifest
@@ -0,0 +1,4 @@
+DIST pypolicyd-spf-1.1.2.tar.gz 30813 SHA256 f8999a9febc5ccb4a66f9961e4ec2d8f81b407bdc3ac1c84563cd5085429cdea SHA512 17321c6df59620a1fd49a67564d3ecf2156027bbeee9b0f532a3d5f7bfadb060ffc61556b2126d98ea285f80cb552239636e2f461af6256c4568fb8696fec951 WHIRLPOOL a7a02de368037ba9a15520cbdfcf2e2e42c9b9016e3f7d6d83c93eaa6584af147b84acfa3f5a659238dc49057052c8189c20e19ba760b07677fc25cef7fc9ff2
+DIST pypolicyd-spf-1.1.tar.gz 469687 SHA256 93ca747e1e62d05a3e3fa54b9415f6c6da7fa40644e32507d0bb56980e31cc56 SHA512 7968425ae5b966571b0787769eff484f4d779f02c8460f515b98549117fdf270de70861f61b8c3e7d9da2092e91c191055cd9a312303c50a2b4707e9dd92840e WHIRLPOOL cd47648c122a13e99c08dac9cfee5cbe12b5b4301dc389397ca824ef19ed976beeee02e7f17fb0faf8abe29184be3aeb73c7ab327a0e6b19d7f84434f20b3635
+DIST pypolicyd-spf-1.2.tar.gz 30783 SHA256 e1a94c79ad91cfea17b9c8b19b035536f06d75ff9ee2e8478191e7c27fe69f74 SHA512 266dc129f0d0bf59b809d3ec6f47369c73d6c5287b1505f0762a9e92ab9dbc3b6afc14ff59d8298012dc4c8b2e7c05d85bab227e71592bc0ee47b0a88cf4df45 WHIRLPOOL 8817c0357aa6850010f144d66408048edf569977eb65f733bedbc3f996273a1d636948ce86ec38cf4b81df66d5546acc2d8dced0185ec93f469d919242405e8e
+DIST pypolicyd-spf-1.3.1.tar.gz 32093 SHA256 5b575638e3d30db5583ed4e3c0902b9a6d90ba7e126a9d37b9bffe2e6b201808 SHA512 3ae52b22ef3c4f801a523aa98b6c918b7afd76c5867e8cb431b643555e4191f85b1232d7ef431fbfbdd76cfc59bd021ce452b2f323ab0166ab68d1bf06cc1a10 WHIRLPOOL ebd9997369510ead087c039ec505904fb58fd36eed3c9d38bc1602569b7c3b1e0d1648b69fbf6b1c83a84a7ec4de52f180fc30498cc2850fb53c836cec1e5900
diff --git a/mail-filter/pypolicyd-spf/metadata.xml b/mail-filter/pypolicyd-spf/metadata.xml
new file mode 100644
index 00000000000..a09f4df7bb3
--- /dev/null
+++ b/mail-filter/pypolicyd-spf/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>mjo@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="launchpad">pypolicyd-spf</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/pypolicyd-spf/pypolicyd-spf-1.1.2.ebuild b/mail-filter/pypolicyd-spf/pypolicyd-spf-1.1.2.ebuild
new file mode 100644
index 00000000000..64a02b1a7be
--- /dev/null
+++ b/mail-filter/pypolicyd-spf/pypolicyd-spf-1.1.2.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 versionator
+
+DESCRIPTION="Python based policy daemon for Postfix SPF checking"
+HOMEPAGE="https://launchpad.net/pypolicyd-spf"
+SRC_URI="http://launchpad.net/pypolicyd-spf/$(get_version_component_range 1-2)/${PV}/+download/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="dev-python/pyspf[${PYTHON_USEDEP}]"
+RDEPEND="${DEPEND}
+ dev-python/authres"
diff --git a/mail-filter/pypolicyd-spf/pypolicyd-spf-1.1.ebuild b/mail-filter/pypolicyd-spf/pypolicyd-spf-1.1.ebuild
new file mode 100644
index 00000000000..bb5e1ed1d9f
--- /dev/null
+++ b/mail-filter/pypolicyd-spf/pypolicyd-spf-1.1.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+PYTHON_DEPEND="2"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="2.5 3.*"
+
+inherit distutils versionator
+
+DESCRIPTION="Python based policy daemon for Postfix SPF checking"
+HOMEPAGE="https://launchpad.net/pypolicyd-spf"
+SRC_URI="http://launchpad.net/pypolicyd-spf/$(get_version_component_range 1-2)/${PV}/+download/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND=">=dev-python/pyspf-2.0.3"
+RDEPEND="${DEPEND}
+ dev-python/authres"
+
+PYTHON_MODNAME="policydspfsupp.py policydspfuser.py"
diff --git a/mail-filter/pypolicyd-spf/pypolicyd-spf-1.2-r1.ebuild b/mail-filter/pypolicyd-spf/pypolicyd-spf-1.2-r1.ebuild
new file mode 100644
index 00000000000..218d7ecadc9
--- /dev/null
+++ b/mail-filter/pypolicyd-spf/pypolicyd-spf-1.2-r1.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+# With >=python-3.3, the built-in ipaddress module handles the parsing
+# of IP addresses. If python is built without ipv6 support, then
+# ipaddress can't parse ipv6 addresses, and the daemon will crash if it
+# sees an ipv6 SPF record. In other words, it's completely broken.
+#
+# Ideally this would remain optional for python-2.x, but until there's
+# an easy way to do that, "maybe annoying" seems a better option than
+# "maybe broken."
+PYTHON_REQ_USE="ipv6"
+
+inherit distutils-r1 versionator
+
+DESCRIPTION="Python-based policy daemon for Postfix SPF verification"
+HOMEPAGE="https://launchpad.net/pypolicyd-spf"
+SRC_URI="http://launchpad.net/pypolicyd-spf/$(get_version_component_range 1-2)/${PV}/+download/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+# ipaddr is only needed with <python-3.3.
+#
+# The lower version bound is reported at,
+#
+# https://bugs.launchpad.net/pypolicyd-spf/+bug/1229862
+#
+DEPEND="$(python_gen_cond_dep \
+ '>=dev-python/ipaddr-2.1.10[${PYTHON_USEDEP}]' \
+ 'python2*')
+ dev-python/pyspf[${PYTHON_USEDEP}]"
+
+RDEPEND="${DEPEND}
+ dev-python/authres[${PYTHON_USEDEP}]"
+
+DOCS=( CHANGES policyd-spf.conf.commented README README.per_user_whitelisting )
+
+python_prepare_all() {
+ # The "real" config file mentions the commented one, so we point
+ # users in the right direction.
+ local oldconf="policyd-spf.conf.commented"
+ local newconf="/usr/share/doc/${PF}/${oldconf}"
+
+ sed -i "1 s~ ${oldconf}~,\n# ${newconf}~" policyd-spf.conf \
+ || die 'failed to update commented config file path'
+
+ distutils-r1_python_prepare_all
+}
diff --git a/mail-filter/pypolicyd-spf/pypolicyd-spf-1.3.1.ebuild b/mail-filter/pypolicyd-spf/pypolicyd-spf-1.3.1.ebuild
new file mode 100644
index 00000000000..c6bb65b0a2f
--- /dev/null
+++ b/mail-filter/pypolicyd-spf/pypolicyd-spf-1.3.1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+# With >=python-3.3, the built-in ipaddress module handles the parsing
+# of IP addresses. If python is built without ipv6 support, then
+# ipaddress can't parse ipv6 addresses, and the daemon will crash if it
+# sees an ipv6 SPF record. In other words, it's completely broken.
+#
+# Ideally this would remain optional for python-2.x, but until there's
+# an easy way to do that, "maybe annoying" seems a better option than
+# "maybe broken."
+PYTHON_REQ_USE="ipv6"
+
+inherit distutils-r1 versionator
+
+DESCRIPTION="Python-based policy daemon for Postfix SPF verification"
+HOMEPAGE="https://launchpad.net/pypolicyd-spf"
+SRC_URI="http://launchpad.net/pypolicyd-spf/$(get_version_component_range 1-2)/${PV}/+download/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+# ipaddr is only needed with <python-3.3.
+#
+# The lower version bound is reported at,
+#
+# https://bugs.launchpad.net/pypolicyd-spf/+bug/1229862
+#
+# The lower bound on pyspf is not strictly necessary, but some features
+# are silently disabled with older versions of pyspf.
+#
+DEPEND="$(python_gen_cond_dep \
+ '>=dev-python/ipaddr-2.1.10[${PYTHON_USEDEP}]' \
+ 'python2*')
+ >=dev-python/pyspf-2.0.9[${PYTHON_USEDEP}]"
+
+RDEPEND="${DEPEND}
+ dev-python/authres[${PYTHON_USEDEP}]"
+
+DOCS=( CHANGES policyd-spf.conf.commented README README.per_user_whitelisting )
+
+python_prepare_all() {
+ # The "real" config file mentions the commented one, so we point
+ # users in the right direction.
+ local oldconf="policyd-spf.conf.commented"
+ local newconf="/usr/share/doc/${PF}/${oldconf}"
+
+ sed -i "1 s~ ${oldconf}~,\n# ${newconf}~" policyd-spf.conf \
+ || die 'failed to update commented config file path'
+
+ distutils-r1_python_prepare_all
+}
diff --git a/mail-filter/qmail-scanner/Manifest b/mail-filter/qmail-scanner/Manifest
new file mode 100644
index 00000000000..6df5c3fbdd2
--- /dev/null
+++ b/mail-filter/qmail-scanner/Manifest
@@ -0,0 +1,8 @@
+DIST q-s-1.25st-20050406.patch.gz 124325 SHA256 a758b902150f432cc0fa0cc76448bf975e75395ab6b614ca1d8f3be64ab6535a
+DIST q-s-2.05st-20080728.patch.gz 102235 SHA256 03f6b5c030fcd95a726b15b68ce722495b73cea406356fe00a51f0f52c0aa840
+DIST q-s-2.06st-20090419.patch.gz 103486 SHA256 449505268534d843d4d95377dac2ea220d6e3eca0a31800acc5212d4f6cb25eb
+DIST q-s-2.08st-20091012.patch.gz 103757 SHA256 609992f877d8784f74a3006db963c850f1bac6b112c530d4f5e3a50fbbeb37af
+DIST qmail-scanner-1.25.tgz 221156 SHA256 6fa5743a0d180bc4d1a626c4bf56c06a29ec3c0d7cb2ce834add8faceefb9c01
+DIST qmail-scanner-2.05.tgz 237577 SHA256 add5d19669838ea8d2fa414051b4d12d1eacba54a0d8a93b7af4c886cd9f6697
+DIST qmail-scanner-2.06.tgz 238926 SHA256 6330e97382efaf2d3ac40674cc1b09f394b7591cd4a7b6e2514eda334d144b09
+DIST qmail-scanner-2.08.tgz 239667 SHA256 d5db0ac6fccc8febaffb9f66bc2b926323f52247036d3754e7e38ed5977d6ca4
diff --git a/mail-filter/qmail-scanner/files/qmail-scanner-2.05.logrotate b/mail-filter/qmail-scanner/files/qmail-scanner-2.05.logrotate
new file mode 100644
index 00000000000..a0f3cbd880e
--- /dev/null
+++ b/mail-filter/qmail-scanner/files/qmail-scanner-2.05.logrotate
@@ -0,0 +1,4 @@
+/var/spool/qscan/qmail-queue.log /var/spool/qscan/quarantine.log /var/spool/qscan/mailstats.csv {
+ weekly
+ create 0600 qscand qscand
+}
diff --git a/mail-filter/qmail-scanner/files/qmail-scanner-2.06.logrotate b/mail-filter/qmail-scanner/files/qmail-scanner-2.06.logrotate
new file mode 100644
index 00000000000..a0f3cbd880e
--- /dev/null
+++ b/mail-filter/qmail-scanner/files/qmail-scanner-2.06.logrotate
@@ -0,0 +1,4 @@
+/var/spool/qscan/qmail-queue.log /var/spool/qscan/quarantine.log /var/spool/qscan/mailstats.csv {
+ weekly
+ create 0600 qscand qscand
+}
diff --git a/mail-filter/qmail-scanner/files/qmail-scanner-2.08-disable-suid-check.patch b/mail-filter/qmail-scanner/files/qmail-scanner-2.08-disable-suid-check.patch
new file mode 100644
index 00000000000..c323dbae4c8
--- /dev/null
+++ b/mail-filter/qmail-scanner/files/qmail-scanner-2.08-disable-suid-check.patch
@@ -0,0 +1,17 @@
+this is a useless check for package builders
+
+https://bugs.gentoo.org/364123
+
+--- a/configure
++++ b/configure
+@@ -440,9 +440,7 @@ fi
+ #QMAILQUEUE_BIN="${QMAILQUEUE_BIN:-$BINDIR/qmail-queue}"
+
+ #Sanity check that suid is allowed on the Qmail "/bin" partition
+-QMNT=`df $BINDIR|head -2|tail -1|awk '{print $1}'`
+-SUIDSTATUS=`mount|egrep "^$QMNT "|grep nosuid`
+-if [ "$SUIDSTATUS" != "" ]; then
++if false; then
+ cat<<EOF
+
+ *** FATAL ERROR ***
diff --git a/mail-filter/qmail-scanner/files/qmail-scanner-2.08.logrotate b/mail-filter/qmail-scanner/files/qmail-scanner-2.08.logrotate
new file mode 100644
index 00000000000..a0f3cbd880e
--- /dev/null
+++ b/mail-filter/qmail-scanner/files/qmail-scanner-2.08.logrotate
@@ -0,0 +1,4 @@
+/var/spool/qscan/qmail-queue.log /var/spool/qscan/quarantine.log /var/spool/qscan/mailstats.csv {
+ weekly
+ create 0600 qscand qscand
+}
diff --git a/mail-filter/qmail-scanner/files/qmail-scanner-queue.pl.patch b/mail-filter/qmail-scanner/files/qmail-scanner-queue.pl.patch
new file mode 100644
index 00000000000..c8461f50b14
--- /dev/null
+++ b/mail-filter/qmail-scanner/files/qmail-scanner-queue.pl.patch
@@ -0,0 +1,8 @@
+--- qmail-scanner-queue.pl.orig 2004-01-28 14:59:13.683490735 +0100
++++ qmail-scanner-queue.pl 2004-01-28 14:59:58.125634019 +0100
+@@ -1,4 +1,4 @@
+-#!/usr/bin/suidperl -T
++#!/usr/bin/perl
+ #
+ # File: qmail-scanner-queue.pl
+ # Version: 1.20
diff --git a/mail-filter/qmail-scanner/files/qmailscanner.cronjob b/mail-filter/qmail-scanner/files/qmailscanner.cronjob
new file mode 100644
index 00000000000..ca4527432e3
--- /dev/null
+++ b/mail-filter/qmail-scanner/files/qmailscanner.cronjob
@@ -0,0 +1,2 @@
+#!/bin/bash
+/var/qmail/bin/qmail-scanner-queue -z
diff --git a/mail-filter/qmail-scanner/files/qmailscanner.logrotate b/mail-filter/qmail-scanner/files/qmailscanner.logrotate
new file mode 100644
index 00000000000..864cfe7f6fe
--- /dev/null
+++ b/mail-filter/qmail-scanner/files/qmailscanner.logrotate
@@ -0,0 +1,4 @@
+/var/spool/qmailscan/qmail-queue.log /var/spool/qmailscan/quarantine.log /var/spool/qmailscan/mailstats.csv {
+ weekly
+ create 0600 qscand qscand
+}
diff --git a/mail-filter/qmail-scanner/metadata.xml b/mail-filter/qmail-scanner/metadata.xml
new file mode 100644
index 00000000000..6e2faa5d745
--- /dev/null
+++ b/mail-filter/qmail-scanner/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>qmail</herd>
+ <use>
+ <flag name="spamassassin">Build faster <pkg>mail-filter/spamassassin</pkg>
+ checks into qmail-scanner</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">qmail-scanner</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/qmail-scanner/qmail-scanner-1.25-r1.ebuild b/mail-filter/qmail-scanner/qmail-scanner-1.25-r1.ebuild
new file mode 100644
index 00000000000..c25e00149dc
--- /dev/null
+++ b/mail-filter/qmail-scanner/qmail-scanner-1.25-r1.ebuild
@@ -0,0 +1,164 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit fixheadtails toolchain-funcs eutils user
+
+Q_S_DATE=20050406
+DESCRIPTION="E-Mail virus scanner for qmail"
+HOMEPAGE="http://qmail-scanner.sourceforge.net/"
+SRC_URI="mirror://sourceforge/qmail-scanner/${P}.tgz
+ http://toribio.apollinare.org/qmail-scanner/download/q-s-${PV}st-${Q_S_DATE}.patch.gz"
+
+IUSE="spamassassin"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+RESTRICT="userpriv"
+
+RDEPEND=">=dev-lang/perl-5.6.1-r1
+ >=virtual/perl-Time-HiRes-01.20-r2
+ >=net-mail/tnef-1.1.1
+ >=virtual/perl-DB_File-1.803-r2
+ >=net-mail/ripmime-1.3.0.4
+ virtual/qmail
+ >=app-arch/unzip-5.42-r1
+ app-antivirus/clamav
+ spamassassin? ( >=mail-filter/spamassassin-2.64 )"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ enewgroup qscand 210
+ enewuser qscand 210 -1 /var/spool/qmailscan qscand
+}
+
+pkg_preinst() {
+ local oldname="/var/qmail/bin/qmail-scanner-queue.pl"
+ if [ -f ${oldname} ]; then
+ newname=${oldname}.`date +%Y%m%d%H%M%S`
+ elog "Backing up old qmail-scanner as $newname in case of modifications."
+ cp ${oldname} ${newname}
+ chmod 600 ${newname}
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${DISTDIR}"/q-s-${PV}st-${Q_S_DATE}.patch.gz
+ ht_fix_file autoupdaters/* configure
+
+ EXTRA_VIRII="bagle,beagle,mydoom,sco,maldal,mimail,novarg,shimg,bugler,cissi,cissy,dloade,netsky,qizy"
+ elog "Adding items to the SILENT_VIRUSES list (${EXTRA_VIRII})"
+ sed -e "/^SILENT_VIRUSES/s/\"$/,${EXTRA_VIRII}\"/g" -i configure
+}
+
+src_compile () {
+ local myconf
+
+ addpredict /var/log/kav/kavscan.log
+ addpredict /opt/bdc/plugins.htm
+
+ use spamassassin && myconf="--virus-to-delete yes --sa-quarantine 2.1 --sa-delete 4.2 --sa-reject no --sa-subject SPAM: --sa-delta 0.5 --sa-alt yes"
+
+ PATH=${PATH}:/opt/f-prot:/opt/vlnx ./configure \
+ --domain localhost \
+ --batch \
+ --log-details yes \
+ --mime-unpacker "ripmime" \
+ --skip-setuid-test \
+ ${myconf} \
+ || die "./configure failed!"
+
+ # build for qmail-scanner-queue wrapper, so we don't need suidperl
+ cd contrib
+ $(tc-getCC) ${CFLAGS} -o qmail-scanner-queue qmail-scanner-queue.c || die
+}