summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Năstac <mrness@gentoo.org>2008-02-18 10:34:54 +0000
committerAlin Năstac <mrness@gentoo.org>2008-02-18 10:34:54 +0000
commit0cbe27643a97b46d47c09397c937a64ae55d982b (patch)
tree9833a6d95a1739da6e1993980d5a214c080314a3 /mail-filter
parentarm/s390/sh stable (diff)
downloadgentoo-2-0cbe27643a97b46d47c09397c937a64ae55d982b.tar.gz
gentoo-2-0cbe27643a97b46d47c09397c937a64ae55d982b.tar.bz2
gentoo-2-0cbe27643a97b46d47c09397c937a64ae55d982b.zip
Initial import from bug 207985, thanks to Troy Bowman <troy@dublan.net>.
(Portage version: 2.1.3.19)
Diffstat (limited to 'mail-filter')
-rw-r--r--mail-filter/milter-regex/ChangeLog12
-rw-r--r--mail-filter/milter-regex/Manifest8
-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-conf8
-rw-r--r--mail-filter/milter-regex/files/milter-regex-init37
-rw-r--r--mail-filter/milter-regex/metadata.xml11
-rw-r--r--mail-filter/milter-regex/milter-regex-1.7.ebuild60
8 files changed, 199 insertions, 0 deletions
diff --git a/mail-filter/milter-regex/ChangeLog b/mail-filter/milter-regex/ChangeLog
new file mode 100644
index 000000000000..24abdfb8125a
--- /dev/null
+++ b/mail-filter/milter-regex/ChangeLog
@@ -0,0 +1,12 @@
+# ChangeLog for mail-filter/milter-regex
+# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/milter-regex/ChangeLog,v 1.1 2008/02/18 10:34:54 mrness Exp $
+
+*milter-regex-1.7 (18 Feb 2008)
+
+ 18 Feb 2008; Alin Năstac <mrness@gentoo.org>
+ +files/milter-regex-1.7-gentoo.patch, +files/milter-regex-1.7-rules.patch,
+ +files/milter-regex-conf, +files/milter-regex-init, +metadata.xml,
+ +milter-regex-1.7.ebuild:
+ Initial import from bug 207985, thanks to Troy Bowman <troy@dublan.net>.
+
diff --git a/mail-filter/milter-regex/Manifest b/mail-filter/milter-regex/Manifest
new file mode 100644
index 000000000000..77dfc5023304
--- /dev/null
+++ b/mail-filter/milter-regex/Manifest
@@ -0,0 +1,8 @@
+AUX milter-regex-1.7-gentoo.patch 1489 RMD160 4f7c5b88f59ff176e9524a6d1d713d5bac1b0ffc SHA1 a7fc8354d8d8286012d14572cfbf8c2760dc8f00 SHA256 9bbfd44ac27041421a3e8887db49057386628c52ac60fea4a9344493c560b209
+AUX milter-regex-1.7-rules.patch 351 RMD160 ab1cd7404c555b78be8d5b7e0b04bccbe1dd539d SHA1 e757096c4404ae3fcd36bbe1f619628b73537403 SHA256 8319e51b061a12d13b49fdb602e232d229fe25d418cddbe9e96c6001753724ae
+AUX milter-regex-conf 177 RMD160 aac67efe1fa295755d85fe313a504bab70ed5dad SHA1 46760523a139d2ab80b9e27a4c7248a28387cee6 SHA256 e26c4c6a876dd8c3c5a15e6093feec5da7e44b396636c96d2b4441f555a8a150
+AUX milter-regex-init 714 RMD160 b99a72faae37b50a815fe320b7a9081964ef1833 SHA1 ecbc09da56f558b531355c9258983f4a99c8d811 SHA256 c7576e10fd8ed4e7033e2eecd44dd88f3e395b2938fc442b72e3332a095300ce
+DIST milter-regex-1.7.tar.gz 19321 RMD160 66868b21eb095f203ef8391e99744506d7ee3cc4 SHA1 de337bc12dade1ed4b715657c4317040f08ef902 SHA256 ca64e51c67a27962e2d258a0f69f832ffd56b5270dbe4440f960f457c74bbce6
+EBUILD milter-regex-1.7.ebuild 1507 RMD160 758becc022bcbb57e1eee8d05454a9d16f011757 SHA1 dce24acc7fd21d2630a258b1150e0dbf5fc91ab9 SHA256 24bcbc36fdfa0ca12f4aee6c920b760d1dd0da0094a3374459ef03cdf6375852
+MISC ChangeLog 456 RMD160 4ce88df5071afe83540401e1eb11bd4529093a2c SHA1 5dcb710ff1ec25f3404013c94f7457dec3efe575 SHA256 463b40ca1d60a1c39aacc784b195a34234ad01f95f941dc4e05fe6622e08524a
+MISC metadata.xml 492 RMD160 afd9793c7ad83c56f53e9d5a5b1f596b033b4e8b SHA1 5fba558c4dcabeba151318150772910833860f90 SHA256 5dd05145d4a0eb2d55ba127f97290e7c3b2ebe32bb45ad952358f61b69c4718a
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 000000000000..bd5d926ce218
--- /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 000000000000..2e85be4c28b2
--- /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-conf b/mail-filter/milter-regex/files/milter-regex-conf
new file mode 100644
index 000000000000..51846a214e4e
--- /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 000000000000..9c95d562fc41
--- /dev/null
+++ b/mail-filter/milter-regex/files/milter-regex-init
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/milter-regex/files/milter-regex-init,v 1.1 2008/02/18 10:34:54 mrness Exp $
+
+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
+
+ 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 000000000000..fe2e3ce0367c
--- /dev/null
+++ b/mail-filter/milter-regex/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>
+<maintainer>
+ <email>mrness@gentoo.org</email>
+ <name>Alin Năstac</name>
+</maintainer>
+<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.7.ebuild b/mail-filter/milter-regex/milter-regex-1.7.ebuild
new file mode 100644
index 000000000000..380d080d3c7a
--- /dev/null
+++ b/mail-filter/milter-regex/milter-regex-1.7.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/milter-regex/milter-regex-1.7.ebuild,v 1.1 2008/02/18 10:34:54 mrness Exp $
+
+inherit eutils
+
+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=""
+
+DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail )"
+RDEPEND="" # libmilter is a static library
+
+src_unpack() {
+ unpack ${A}
+
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-gentoo.patch
+ epatch "${FILESDIR}"/${P}-rules.patch # fix a typo in upstream sample rules
+}
+
+src_compile() {
+ emake -f Makefile.linux milter-regex || die "emake failed"
+}
+
+src_install() {
+ exeinto /usr/bin
+ doexe 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
+ enewuser milter -1 -1 -1 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')"
+ elog
+ 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"
+}