summaryrefslogtreecommitdiff
path: root/mail/vbsfilter
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2001-03-13 06:47:30 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2001-03-13 06:47:30 +0000
commit8769245118726db4dcc0a54b74e6a5ebf98e0911 (patch)
treebd658ad237d753e20d847e5fe20639e1fc280f90 /mail/vbsfilter
parent- Listed an overview of options (diff)
vbsfilter will rename VBS and SHS attachments to .txt,
thus rendering them harmless. Sendmail 8.10 introduced a new feature called the milter library, which provides filtering callbacks to a user-level program, which in turn can provide a "Yes"/"No"/"I haven't seen enough yet" answer to the question: Can sendmail allow this mail to be delivered? Sendmail is a trademark of Sendmail, Inc. WWW: http://aeschi.ch.eu.org/milter/ Submitted by: maintainer
Notes
Notes: svn path=/head/; revision=39722
Diffstat (limited to 'mail/vbsfilter')
-rw-r--r--mail/vbsfilter/Makefile59
-rw-r--r--mail/vbsfilter/distinfo1
-rw-r--r--mail/vbsfilter/files/patch-vbsfilter.c30
-rw-r--r--mail/vbsfilter/files/vbsfilter.sh23
-rw-r--r--mail/vbsfilter/pkg-comment1
-rw-r--r--mail/vbsfilter/pkg-descr11
-rw-r--r--mail/vbsfilter/pkg-plist3
7 files changed, 128 insertions, 0 deletions
diff --git a/mail/vbsfilter/Makefile b/mail/vbsfilter/Makefile
new file mode 100644
index 000000000000..a589877153fd
--- /dev/null
+++ b/mail/vbsfilter/Makefile
@@ -0,0 +1,59 @@
+# New ports collection makefile for: vbsfilter
+# Date created: 10.Mar 2001
+# Whom: dirk.meyer@dinoex.sub.org
+#
+# $FreeBSD$
+#
+
+PORTNAME= vbsfilter
+PORTVERSION= 1.3
+CATEGORIES= mail
+MASTER_SITES= http://aeschi.ch.eu.org/milter/
+DISTNAME= ${PORTNAME}-${PORTVERSION}
+EXTRACT_SUFX= .c
+EXTRACT_ONLY= # empty
+
+MAINTAINER= dirk.meyer@dinoex.sub.org
+
+BUILD_DEPENDS= ${LOCALBASE}/lib/libmilter.a:${PORTSDIR}/mail/sendmail
+
+NO_PACKAGE= "only with sendmail from the ports"
+
+CTARGETS+= vbsfilter-1.3
+CFLAGS+= -Wall -I$(LOCALBASE)/include -D_THREAD_SAFE
+FLAGS+= -pthread
+LDFLAGS+= -L$(LOCALBASE)/lib
+LIBS+= -lmilter -lsmutil
+.if defined(SENDMAIL_WITH_SFIO)
+LIBS+= -lsfio
+.endif
+
+.if ! defined(SENDMAIL_WITH_MILTER)
+pre-fetch:
+ @${ECHO_MSG}
+ @${ECHO_MSG} You must set variable SENDMAIL_WITH_MILTER to YES,
+ @${ECHO_MSG} and rebuild sendmail in the ports
+ @${FALSE}
+.endif
+
+do-extract:
+ @${MKDIR} ${WRKSRC}
+ @${CP} ${_DISTDIR}vbsfilter-1.3.c ${WRKSRC}
+ @${SED} -e "s=%%PREFIX%%=${PREFIX}=" ${FILESDIR}/vbsfilter.sh \
+ > ${WRKSRC}/vbsfilter.sh
+
+.for i in ${CTARGETS}
+${i}:
+ cd ${WRKSRC} && \
+ $(CC) $(CFLAGS) $(LDFLAGS) -o ${i} ${i}.c $(LIBS) $(FLAGS)
+
+.endfor
+
+do-build: ${CTARGETS}
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/vbsfilter-1.3 ${PREFIX}/libexec/vbsfilter
+ ${INSTALL_DATA} ${WRKSRC}/vbsfilter.sh \
+ ${PREFIX}/etc/rc.d/vbsfilter.sh.sample
+
+.include <bsd.port.mk>
diff --git a/mail/vbsfilter/distinfo b/mail/vbsfilter/distinfo
new file mode 100644
index 000000000000..8a7f1b542659
--- /dev/null
+++ b/mail/vbsfilter/distinfo
@@ -0,0 +1 @@
+MD5 (vbsfilter-1.3.c) = da70a84416927d0ba0a0c4e69cc4532e
diff --git a/mail/vbsfilter/files/patch-vbsfilter.c b/mail/vbsfilter/files/patch-vbsfilter.c
new file mode 100644
index 000000000000..01f54df27d6e
--- /dev/null
+++ b/mail/vbsfilter/files/patch-vbsfilter.c
@@ -0,0 +1,30 @@
+--- vbsfilter-1.3.c.neu.orig Wed Feb 14 10:45:06 2001
++++ vbsfilter-1.3.c Wed Feb 14 12:40:38 2001
+@@ -2,6 +2,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sysexits.h>
++#include <ctype.h>
++#include <stdlib.h>
++#include <netdb.h>
++#include <unistd.h>
+ #include "libmilter/mfapi.h"
+
+ /*
+@@ -172,7 +176,7 @@
+ sfsistat mlfi_body(SMFICTX *ctx, u_char *bodyp, size_t bodylen) {
+ struct mlfiPriv *priv = MLFIPRIV;
+
+- priv->body = (char *) realloc(priv->body, priv->len + bodylen);
++ priv->body = (char *) realloc(priv->body, priv->len + bodylen + 1);
+
+ if (!priv->body) {
+ /* can't accept this message right now */
+@@ -181,6 +185,7 @@
+
+ memcpy((u_char*)(priv->body+priv->len), bodyp, bodylen);
+ priv->len += bodylen;
++ priv->body[priv->len] = 0;
+
+ /* continue processing */
+ return SMFIS_CONTINUE;
diff --git a/mail/vbsfilter/files/vbsfilter.sh b/mail/vbsfilter/files/vbsfilter.sh
new file mode 100644
index 000000000000..31e79220bfa9
--- /dev/null
+++ b/mail/vbsfilter/files/vbsfilter.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# $FreeBSD: /tmp/pcvs/ports/mail/vbsfilter/files/Attic/vbsfilter.sh,v 1.1 2001-03-13 06:47:30 dinoex Exp $
+#
+if ! test -x %%PREFIX%%/libexec/vbsfilter
+then
+# exit 0
+fi
+case $1 in
+start)
+ rm -f /var/run/vbsfilter
+ %%PREFIX%%/libexec/vbsfilter -p local:/var/run/vbsfilter &&
+ echo -n ' vbsfilter'
+ ;;
+stop)
+ killall vbsfilter
+ rm -f /var/run/vbsfilter
+ ;;
+*)
+ echo "Usage: $0: [ start | stop ]" 2>&1
+ exit 65
+ ;;
+esac
diff --git a/mail/vbsfilter/pkg-comment b/mail/vbsfilter/pkg-comment
new file mode 100644
index 000000000000..5a424fd634cd
--- /dev/null
+++ b/mail/vbsfilter/pkg-comment
@@ -0,0 +1 @@
+A vbs-attachment filter for Sendmail
diff --git a/mail/vbsfilter/pkg-descr b/mail/vbsfilter/pkg-descr
new file mode 100644
index 000000000000..46d9d5d13422
--- /dev/null
+++ b/mail/vbsfilter/pkg-descr
@@ -0,0 +1,11 @@
+vbsfilter will rename VBS and SHS attachments to .txt,
+thus rendering them harmless.
+
+Sendmail 8.10 introduced a new feature called the milter library,
+which provides filtering callbacks to a user-level program, which in
+turn can provide a "Yes"/"No"/"I haven't seen enough yet" answer to
+the question: Can sendmail allow this mail to be delivered?
+
+Sendmail is a trademark of Sendmail, Inc.
+
+WWW: http://aeschi.ch.eu.org/milter/
diff --git a/mail/vbsfilter/pkg-plist b/mail/vbsfilter/pkg-plist
new file mode 100644
index 000000000000..d1872a395cd7
--- /dev/null
+++ b/mail/vbsfilter/pkg-plist
@@ -0,0 +1,3 @@
+@comment $FreeBSD: /tmp/pcvs/ports/mail/vbsfilter/Attic/pkg-plist,v 1.1 2001-03-13 06:47:25 dinoex Exp $
+libexec/vbsfilter
+etc/rc.d/vbsfilter.sh.sample