summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authormarkd <markd>2002-09-23 13:08:52 +0000
committermarkd <markd>2002-09-23 13:08:52 +0000
commitdb12f8d6c9888e118405cd3978d1cbb49cc28469 (patch)
tree030ea00cc403093c3e424d2c813b37634d2eb2e2 /mail
parent7dc17d7b8f3c593ecc444084231f0723eb7f45ed (diff)
downloadpkgsrc-db12f8d6c9888e118405cd3978d1cbb49cc28469.tar.gz
Initial import of mimedefang-2.21
MIMEDefang is an e-mail filter program which works with Sendmail 8.12 and later. MIMEDefang filters all e-mail messages sent via SMTP. MIMEDefang splits multi-part MIME messages into their components and potentially deletes or modifies the various parts. It then reassembles the parts back into an e-mail message and sends it on its way. MIMEDefang is written (mostly) in Perl, and the filter actions are expressed in Perl. This makes MIMEDefang highly flexible and configurable. As a simple example, you can delete all *.exe and *.com files, convert all Word documents to HTML, and allow other attachments through. MIMEDefang uses the "milter" feature of Sendmail to "listen in" to SMTP connections. It runs a scan once for each message, not once for each recipient (as simpler procmail-based systems do.) Therefore, it is more CPU-friendly than procmail-based systems. In addition, because MIMEDefang can participate in the SMTP connection, you can bounce messages (something impossible to do with procmail-based systems.)
Diffstat (limited to 'mail')
-rw-r--r--mail/mimedefang/DESCR20
-rw-r--r--mail/mimedefang/INSTALL11
-rw-r--r--mail/mimedefang/Makefile72
-rw-r--r--mail/mimedefang/PLIST14
-rw-r--r--mail/mimedefang/distinfo6
-rw-r--r--mail/mimedefang/patches/patch-aa32
-rw-r--r--mail/mimedefang/patches/patch-ab22
7 files changed, 177 insertions, 0 deletions
diff --git a/mail/mimedefang/DESCR b/mail/mimedefang/DESCR
new file mode 100644
index 00000000000..d171ad012fa
--- /dev/null
+++ b/mail/mimedefang/DESCR
@@ -0,0 +1,20 @@
+MIMEDefang is an e-mail filter program which works with Sendmail 8.12
+and later. MIMEDefang filters all e-mail messages sent via SMTP.
+MIMEDefang splits multi-part MIME messages into their components and
+potentially deletes or modifies the various parts. It then
+reassembles the parts back into an e-mail message and sends it on its
+way.
+
+MIMEDefang is written (mostly) in Perl, and the filter actions are
+expressed in Perl. This makes MIMEDefang highly flexible and
+configurable. As a simple example, you can delete all *.exe and *.com
+files, convert all Word documents to HTML, and allow other attachments
+through.
+
+MIMEDefang uses the "milter" feature of Sendmail to "listen in" to
+SMTP connections. It runs a scan once for each message, not once for
+each recipient (as simpler procmail-based systems do.) Therefore, it
+is more CPU-friendly than procmail-based systems. In addition,
+because MIMEDefang can participate in the SMTP connection, you can
+bounce messages (something impossible to do with procmail-based
+systems.)
diff --git a/mail/mimedefang/INSTALL b/mail/mimedefang/INSTALL
new file mode 100644
index 00000000000..72f32520158
--- /dev/null
+++ b/mail/mimedefang/INSTALL
@@ -0,0 +1,11 @@
+# $NetBSD: INSTALL,v 1.1.1.1 2002/09/23 13:08:52 markd Exp $
+
+case ${STAGE} in
+POST-INSTALL)
+ if test ! -f @PKG_SYSCONFDIR@/mimedefang-ip-key ; then
+ ${PERL5} @SHAREDIR@/gen-ip-validator.pl > @PKG_SYSCONFDIR@/mimedefang-ip-key
+ fi
+ ${CHOWN} @DEFANG_USER@ @PKG_SYSCONFDIR@/mimedefang-ip-key
+ ${CHMOD} 600 @PKG_SYSCONFDIR@/mimedefang-ip-key
+ ;;
+esac
diff --git a/mail/mimedefang/Makefile b/mail/mimedefang/Makefile
new file mode 100644
index 00000000000..0d14d7a43cc
--- /dev/null
+++ b/mail/mimedefang/Makefile
@@ -0,0 +1,72 @@
+# $NetBSD: Makefile,v 1.1.1.1 2002/09/23 13:08:52 markd Exp $
+
+DISTNAME= mimedefang-2.21
+CATEGORIES= mail
+MASTER_SITES= http://www.roaringpenguin.com/mimedefang/
+
+MAINTAINER= markd@netbsd.org
+HOMEPAGE= http://www.roaringpenguin.com/mimedefang/
+COMMENT= To inspect/modify e-mail as it passes through your mail relay
+
+DEPENDS+= p5-Digest-SHA1>=2.00:../../security/p5-Digest-SHA1
+DEPENDS+= p5-HTML-Parser>=3.26:../../www/p5-HTML-Parser
+DEPENDS+= p5-HTML-Tagset>=3.03:../../www/p5-HTML-Tagset
+DEPENDS+= p5-IO-stringy>=2.108:../../devel/p5-IO-stringy
+DEPENDS+= p5-MailTools>=1.44:../../mail/p5-MailTools
+DEPENDS+= p5-MIME-Base64>=2.11:../../converters/p5-MIME-Base64
+DEPENDS+= p5-MIME-tools>=5.411a:../../mail/p5-MIME-tools
+DEPENDS+= spamassassin>=2.31:../../mail/spamassassin
+
+USE_BUILDLINK2= YES
+USE_PERL5= YES
+GNU_CONFIGURE= YES
+PKG_SYSCONFSUBDIR?= mimedefang
+
+DEFANG_SPOOLDIR?= /var/spool/MIMEDefang
+DEFANG_USER?= defang
+DEFANG_GROUP?= defang
+
+PKG_GROUPS= ${DEFANG_GROUP}
+PKG_USERS= ${DEFANG_USER}:${DEFANG_GROUP}
+
+EGDIR= ${PREFIX}/share/examples/mimedefang
+SHAREDIR= ${PREFIX}/share/mimedefang
+
+INSTALL_EXTRA_TMPL= ${.CURDIR}/INSTALL
+
+FILES_SUBST+= SHAREDIR=${SHAREDIR}
+FILES_SUBST+= DEFANG_USER=${DEFANG_USER}
+
+OWN_DIRS_PERMS+= ${DEFANG_SPOOLDIR} ${DEFANG_USER} ${DEFANG_GROUP} 0700
+
+CONF_FILES+= ${EGDIR}/mimedefang-filter ${PKG_SYSCONFDIR}/mimedefang-filter
+CONF_FILES+= ${EGDIR}/sa-mimedefang.cf ${PKG_SYSCONFDIR}/spamassassin/sa-mimedefang.cf
+
+CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
+CONFIGURE_ARGS+= --with-confsubdir=
+CONFIGURE_ARGS+= --with-milterinc=${BUILDLINK_PREFIX.libmilter}/include
+CONFIGURE_ARGS+= --with-milterlib=${BUILDLINK_PREFIX.libmilter}/lib
+CONFIGURE_ARGS+= --with-spooldir=${DEFANG_SPOOLDIR}
+CONFIGURE_ARGS+= --with-quarantinedir=${DEFANG_SPOOLDIR}
+
+do-install:
+ ${INSTALL_DATA_DIR} ${PKG_SYSCONFDIR}
+ ${INSTALL_DATA_DIR} ${PKG_SYSCONFDIR}/spamassassin
+ ${INSTALL_DATA_DIR} ${EGDIR}
+ ${INSTALL_DATA_DIR} ${SHAREDIR}
+ ${INSTALL_DATA} ${WRKSRC}/gen-ip-validator.pl ${SHAREDIR}
+ ${INSTALL_PROGRAM} ${WRKSRC}/mimedefang-multiplexor ${PREFIX}/bin
+ ${INSTALL_PROGRAM} ${WRKSRC}/mimedefang ${PREFIX}/bin
+ ${INSTALL_SCRIPT} ${WRKSRC}/mimedefang.pl ${PREFIX}/bin
+ ${INSTALL_DATA} ${WRKSRC}/mimedefang.8 ${PREFIX}/man/man8
+ ${INSTALL_DATA} ${WRKSRC}/mimedefang.pl.8 ${PREFIX}/man/man8
+ ${INSTALL_DATA} ${WRKSRC}/mimedefang-multiplexor.8 ${PREFIX}/man/man8
+ ${INSTALL_DATA} ${WRKSRC}/mimedefang-filter.5 ${PREFIX}/man/man5
+ ${INSTALL_DATA} ${WRKSRC}/mimedefang-protocol.7 ${PREFIX}/man/man7
+ ${INSTALL_DATA} ${WRKSRC}/examples/suggested-minimum-filter-for-windows-clients ${EGDIR}/mimedefang-filter
+ ${INSTALL_DATA} ${WRKSRC}/SpamAssassin/spamassassin.cf ${EGDIR}/sa-mimedefang.cf
+
+.include "../../mail/libmilter/buildlink2.mk"
+.include "../../mk/pthread.buildlink2.mk"
+.include "../../mk/bsd.pkg.install.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/mail/mimedefang/PLIST b/mail/mimedefang/PLIST
new file mode 100644
index 00000000000..d0031ef0f33
--- /dev/null
+++ b/mail/mimedefang/PLIST
@@ -0,0 +1,14 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2002/09/23 13:08:52 markd Exp $
+bin/mimedefang
+bin/mimedefang-multiplexor
+bin/mimedefang.pl
+man/man5/mimedefang-filter.5
+man/man7/mimedefang-protocol.7
+man/man8/mimedefang-multiplexor.8
+man/man8/mimedefang.8
+man/man8/mimedefang.pl.8
+share/examples/mimedefang/mimedefang-filter
+share/examples/mimedefang/sa-mimedefang.cf
+share/mimedefang/gen-ip-validator.pl
+@dirrm share/mimedefang
+@dirrm share/examples/mimedefang
diff --git a/mail/mimedefang/distinfo b/mail/mimedefang/distinfo
new file mode 100644
index 00000000000..6982f80959a
--- /dev/null
+++ b/mail/mimedefang/distinfo
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1.1.1 2002/09/23 13:08:52 markd Exp $
+
+SHA1 (mimedefang-2.21.tar.gz) = 6103858e0691b8ad6db485895d2a969d40f313ff
+Size (mimedefang-2.21.tar.gz) = 155058 bytes
+SHA1 (patch-aa) = 7ab60d4658ff20d35855589b20ecbc3227d4f6b4
+SHA1 (patch-ab) = 5292221656aa46f49873ccfbadf3e7a95042baed
diff --git a/mail/mimedefang/patches/patch-aa b/mail/mimedefang/patches/patch-aa
new file mode 100644
index 00000000000..59253380701
--- /dev/null
+++ b/mail/mimedefang/patches/patch-aa
@@ -0,0 +1,32 @@
+$NetBSD: patch-aa,v 1.1.1.1 2002/09/23 13:08:52 markd Exp $
+
+--- rm_r.c~ Sat Sep 7 01:43:35 2002
++++ rm_r.c Mon Sep 23 16:57:39 2002
+@@ -24,6 +24,27 @@
+ #include <syslog.h>
+ #include <string.h>
+
++#ifdef __NetBSD__
++/*
++ * Fake an readdir_r until such time as NetBSD has one
++ * think this should be good enough for the nonpreemptive thread packages
++ */
++int
++readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result)
++{
++ struct dirent *tmp_dirp;
++
++ tmp_dirp = readdir(dirp);
++ if (!tmp_dirp) {
++ *result = NULL;
++ return -1;
++ }
++ memcpy (entry, tmp_dirp, sizeof(struct dirent));
++ *result = entry;
++ return 0;
++}
++#endif
++
+ /**********************************************************************
+ * %FUNCTION: rm_r
+ * %ARGUMENTS:
diff --git a/mail/mimedefang/patches/patch-ab b/mail/mimedefang/patches/patch-ab
new file mode 100644
index 00000000000..85ad2586a7f
--- /dev/null
+++ b/mail/mimedefang/patches/patch-ab
@@ -0,0 +1,22 @@
+$NetBSD: patch-ab,v 1.1.1.1 2002/09/23 13:08:52 markd Exp $
+
+--- Makefile.in~ Mon Sep 23 17:06:19 2002
++++ Makefile.in Mon Sep 23 17:15:41 2002
+@@ -51,7 +51,7 @@
+ all: mimedefang mimedefang-multiplexor
+
+ mimedefang-multiplexor: mimedefang-multiplexor.o event.o event_tcp.o drop_privs.o
+- @CC@ @CFLAGS@ -o mimedefang-multiplexor mimedefang-multiplexor.o event.o event_tcp.o drop_privs.o @LIBS@
++ @CC@ @CFLAGS@ -o mimedefang-multiplexor mimedefang-multiplexor.o event.o event_tcp.o drop_privs.o @LDFLAGS@ @LIBS@
+ -strip mimedefang-multiplexor
+
+ rm_r.o: rm_r.c
+@@ -70,7 +70,7 @@
+ @CC@ @CFLAGS@ $(DEFS) $(MINCLUDE) -c -o mimedefang-multiplexor.o mimedefang-multiplexor.c
+
+ mimedefang: mimedefang.o drop_privs.o utils.o rm_r.o
+- @CC@ @CFLAGS@ @PTHREAD_FLAG@ -o mimedefang mimedefang.o drop_privs.o utils.o rm_r.o @LIBMILTER@ @LIBS@
++ @CC@ @CFLAGS@ @PTHREAD_FLAG@ -o mimedefang mimedefang.o drop_privs.o utils.o rm_r.o @LDFLAGS@ @LIBMILTER@ @LIBS@
+ -strip mimedefang
+
+ mimedefang.o: mimedefang.c mimedefang.h