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
commitbcc20caf674f51044c46518a2e66d832d122e02e (patch)
treeba68bc841c240df85f9fd9e280cfe63eae28964c /mail-filter/milter-regex
parentarm/s390/sh stable (diff)
downloadhistorical-bcc20caf674f51044c46518a2e66d832d122e02e.tar.gz
historical-bcc20caf674f51044c46518a2e66d832d122e02e.tar.bz2
historical-bcc20caf674f51044c46518a2e66d832d122e02e.zip
Initial import from bug 207985, thanks to Troy Bowman <troy@dublan.net>.
Package-Manager: portage-2.1.3.19
Diffstat (limited to 'mail-filter/milter-regex')
-rw-r--r--mail-filter/milter-regex/ChangeLog12
-rw-r--r--mail-filter/milter-regex/Manifest18
-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, 209 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..895b0cc13aa3
--- /dev/null
+++ b/mail-filter/milter-regex/Manifest
@@ -0,0 +1,18 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+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 824 RMD160 f6fe14f020f8e7e0150183b6fa124f436085fbe7 SHA1 daf51b3cbddc81421e7b29fb919db05a01614ca6 SHA256 cccf793d1c62444d8f82c899e5787090fd048f5b7c56f4dddd04b21e7c06f181
+DIST milter-regex-1.7.tar.gz 19321 RMD160 66868b21eb095f203ef8391e99744506d7ee3cc4 SHA1 de337bc12dade1ed4b715657c4317040f08ef902 SHA256 ca64e51c67a27962e2d258a0f69f832ffd56b5270dbe4440f960f457c74bbce6
+EBUILD milter-regex-1.7.ebuild 1617 RMD160 61e073519fb65da1955aa1bd8c3a3aa79f2e077b SHA1 40ceb4310bfccf97aa8808cdf49d34ea7e9027d3 SHA256 05c8b451468e147d213fbd7de5fa86f6d2a301286747beb5b8dc3edac5c270d2
+MISC ChangeLog 552 RMD160 b61f7aeaa9cc3dd04b6b25d78df5decdb0bb7cc8 SHA1 fbd5b7081f944573115b4022f0b56486f05fcb87 SHA256 d5c90b7ad95b94ee8885983262dc164c13b796df89edf383d2f742e84a94f53a
+MISC metadata.xml 492 RMD160 afd9793c7ad83c56f53e9d5a5b1f596b033b4e8b SHA1 5fba558c4dcabeba151318150772910833860f90 SHA256 5dd05145d4a0eb2d55ba127f97290e7c3b2ebe32bb45ad952358f61b69c4718a
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.8 (GNU/Linux)
+
+iEYEARECAAYFAke5X1kACgkQ+fWpoTWIA9Gn7wCgirqPksKjFGv5AKu77Nds04rr
+w4cAnjI/oWDkksyAExc/T5/6jUuNnWw0
+=k8ln
+-----END PGP SIGNATURE-----
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"
+}