diff options
author | dinoex <dinoex@FreeBSD.org> | 2001-03-13 06:47:30 +0000 |
---|---|---|
committer | dinoex <dinoex@FreeBSD.org> | 2001-03-13 06:47:30 +0000 |
commit | 17c0cd7377e4d1a3b32fcbf924d4bc6acf6abedd (patch) | |
tree | 9c2bcec35d4161507c1c8e71c8680c7be28ac5de | |
parent | 8c0906ab26e2f61c50d46529c843929da639a3b8 (diff) | |
download | FreeBSD-ports-17c0cd7377e4d1a3b32fcbf924d4bc6acf6abedd.zip FreeBSD-ports-17c0cd7377e4d1a3b32fcbf924d4bc6acf6abedd.tar.gz |
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
-rw-r--r-- | mail/Makefile | 1 | ||||
-rw-r--r-- | mail/vbsfilter/Makefile | 59 | ||||
-rw-r--r-- | mail/vbsfilter/distinfo | 1 | ||||
-rw-r--r-- | mail/vbsfilter/files/patch-vbsfilter.c | 30 | ||||
-rw-r--r-- | mail/vbsfilter/files/vbsfilter.sh | 23 | ||||
-rw-r--r-- | mail/vbsfilter/pkg-comment | 1 | ||||
-rw-r--r-- | mail/vbsfilter/pkg-descr | 11 | ||||
-rw-r--r-- | mail/vbsfilter/pkg-plist | 3 |
8 files changed, 129 insertions, 0 deletions
diff --git a/mail/Makefile b/mail/Makefile index b529feb..f43fdf4 100644 --- a/mail/Makefile +++ b/mail/Makefile @@ -155,6 +155,7 @@ SUBDIR += teapop SUBDIR += tkrat SUBDIR += tkrat2 + SUBDIR += vbsfilter SUBDIR += vpopmail SUBDIR += vrfy SUBDIR += wanderlust-emacs diff --git a/mail/vbsfilter/Makefile b/mail/vbsfilter/Makefile new file mode 100644 index 0000000..a589877 --- /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 0000000..8a7f1b5 --- /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 0000000..01f54df --- /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 0000000..31e7922 --- /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 0000000..5a424fd --- /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 0000000..46d9d5d --- /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 0000000..d1872a3 --- /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 |