aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorleeym <leeym@FreeBSD.org>2005-02-27 19:10:23 +0800
committerleeym <leeym@FreeBSD.org>2005-02-27 19:10:23 +0800
commit9ad39c0acc171b6b3ce3a56a506272b3400175ea (patch)
tree754646f1007b82d8e4392f7b48696ce6861b2c2f /mail
parentdc006757ca3ef281670022fda8c8b41cde5a5b26 (diff)
downloadfreebsd-ports-gnome-9ad39c0acc171b6b3ce3a56a506272b3400175ea.tar.gz
freebsd-ports-gnome-9ad39c0acc171b6b3ce3a56a506272b3400175ea.tar.zst
freebsd-ports-gnome-9ad39c0acc171b6b3ce3a56a506272b3400175ea.zip
- add clamfilter-0.5
Clamfilter is a small, secure, and very efficient content filter for Postfix, designed to filter messages efficiently through the clamd daemon. Hurried by: vanilla PR: 77380 Submitted by: SeaD <sead@mail.ru>
Diffstat (limited to 'mail')
-rw-r--r--mail/Makefile1
-rw-r--r--mail/clamfilter/Makefile25
-rw-r--r--mail/clamfilter/distinfo2
-rw-r--r--mail/clamfilter/files/patch-Makefile17
-rw-r--r--mail/clamfilter/files/patch-clamfilter.c79
-rw-r--r--mail/clamfilter/files/pkg-message13
-rw-r--r--mail/clamfilter/pkg-descr13
7 files changed, 150 insertions, 0 deletions
diff --git a/mail/Makefile b/mail/Makefile
index 5a60142b75d0..a67a6db6768a 100644
--- a/mail/Makefile
+++ b/mail/Makefile
@@ -35,6 +35,7 @@
SUBDIR += c-sig
SUBDIR += cclient
SUBDIR += chk4mail
+ SUBDIR += clamfilter
SUBDIR += cmail
SUBDIR += cone
SUBDIR += contact-lookup-applet
diff --git a/mail/clamfilter/Makefile b/mail/clamfilter/Makefile
new file mode 100644
index 000000000000..70745511bc78
--- /dev/null
+++ b/mail/clamfilter/Makefile
@@ -0,0 +1,25 @@
+# New ports collection makefile for: clamfilter
+# Date created: 11 Feb 2005
+# Whom: SeaD
+#
+# $FreeBSD$
+#
+
+PORTNAME= clamfilter
+PORTVERSION= 0.5
+CATEGORIES= mail
+MASTER_SITES= http://www.ensita.net/products/clamfilter/
+
+MAINTAINER= sead@mail.ru
+COMMENT= A small, efficient clamav content filter for Postfix
+
+RUN_DEPENDS= ${LOCALBASE}/bin/clamdscan:${PORTSDIR}/security/clamav
+
+PKGMESSAGE= ${WRKSRC}/pkg-message
+PLIST_FILES= bin/clamfilter
+
+post-install:
+ @${SED} -e 's,%%PREFIX%%,${PREFIX},g' ${FILESDIR}/pkg-message > ${PKGMESSAGE}
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/mail/clamfilter/distinfo b/mail/clamfilter/distinfo
new file mode 100644
index 000000000000..3888de658a2f
--- /dev/null
+++ b/mail/clamfilter/distinfo
@@ -0,0 +1,2 @@
+MD5 (clamfilter-0.5.tar.gz) = 27047253d5eda132f93d276a31798e08
+SIZE (clamfilter-0.5.tar.gz) = 13975
diff --git a/mail/clamfilter/files/patch-Makefile b/mail/clamfilter/files/patch-Makefile
new file mode 100644
index 000000000000..4f74dea0c64c
--- /dev/null
+++ b/mail/clamfilter/files/patch-Makefile
@@ -0,0 +1,17 @@
+--- Makefile.orig Fri Dec 3 02:50:42 2004
++++ Makefile Sun Feb 27 18:50:00 2005
+@@ -3,5 +5,4 @@
+
+-PREFIX=/usr/
+ VERSION=0.5
+
+ all: clamfilter
+@@ -27,7 +26,7 @@
+
+ clamfilter: clamfilter.c
+ cc -o clamfilter clamfilter.c \
+- -DVERSION=\"$(VERSION)\"
++ -DVERSION=\"$(VERSION)\" -DLOCALBASE=\"$(LOCALBASE)\"
+ strip clamfilter
+
+ dist: clamfilter
diff --git a/mail/clamfilter/files/patch-clamfilter.c b/mail/clamfilter/files/patch-clamfilter.c
new file mode 100644
index 000000000000..8ad2afaa1279
--- /dev/null
+++ b/mail/clamfilter/files/patch-clamfilter.c
@@ -0,0 +1,79 @@
+--- clamfilter.c.orig Fri Dec 3 02:50:42 2004
++++ clamfilter.c Sun Feb 27 18:50:00 2005
+@@ -11,6 +11,7 @@
+ #include <sys/wait.h>
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <stdio.h>
+ #include <syslog.h>
+ #include <stdarg.h>
+ #include <errno.h>
+@@ -20,7 +21,7 @@
+ #endif
+
+ #ifndef CLAMDSCAN
+-#define CLAMDSCAN "/usr/bin/clamdscan"
++#define CLAMDSCAN LOCALBASE "/bin/clamdscan"
+ #endif
+
+ #ifndef VIRUS_NOTIFY
+@@ -63,7 +64,7 @@
+ //skip header, move to header content
+ *result += strlen(header);
+ //search for header content end
+- if (!(tmp = strstr(*result,"\n")))
++ if (!(tmp = (char *) strstr(*result,"\n")))
+ {
+ //not found - all header
+ tmp = *result+strlen(*result);
+@@ -77,7 +78,7 @@
+ //skip header, move to header content
+ *result += strlen(header);
+ //search for header content end
+- if (!(tmp = strstr(*result,"\n")))
++ if (!(tmp = (char *) strstr(*result,"\n")))
+ {
+ //not found - all header
+ tmp = *result+strlen(*result);
+@@ -291,7 +292,7 @@
+ int readfd,writefd;
+ int status;
+ char buffer[102401];
+- int size;
++ int size, res;
+
+ if (pipe(childread)) {
+ syslog(LOG_MAIL|LOG_ERR, "check_file: " \
+@@ -314,7 +315,7 @@
+ dup2(open("/dev/null","w"),2);
+ dup2(readfd,0);
+ dup2(open("/dev/null","w"),1);
+- int res=execl(CLAMDSCAN, CLAMDSCAN, "--quiet", temporalfile, NULL);
++ res=execl(CLAMDSCAN, CLAMDSCAN, "--quiet", temporalfile, NULL);
+ syslog(LOG_MAIL|LOG_ERR, "check_file: " \
+ "child: cannot exec, return code %d", res);
+ return(EX_TEMPFAIL);
+@@ -339,8 +340,8 @@
+ }
+
+
+-void read_args(int argc, char** argv, const char** returnpath,
+- const char** receipent, const char ** fromemail) {
++void read_args(int argc, char** argv, char** returnpath,
++ char** receipent, char ** fromemail) {
+ int opt, i, j; int restlen;
+
+ while(-1 != (opt = getopt(argc, argv, "f:F:D"))) {
+@@ -433,9 +434,9 @@
+ int exitcode = 0;
+ int len = 0;
+ int virusresult = 0;
+- const char *returnpath = NULL;
+- const char *receipent = NULL;
+- const char *fromemail = NULL;
++ char *returnpath = NULL;
++ char *receipent = NULL;
++ char *fromemail = NULL;
+
+ read_args(argc, argv, &returnpath, &receipent, &fromemail);
+
diff --git a/mail/clamfilter/files/pkg-message b/mail/clamfilter/files/pkg-message
new file mode 100644
index 000000000000..4df7f9440ef6
--- /dev/null
+++ b/mail/clamfilter/files/pkg-message
@@ -0,0 +1,13 @@
+======================================================================
+For Postfix users:
+
+1. Edit master.cf and put there:
+filter unix - n n - - pipe flags=R user=postfix \
+ argv=%%PREFIX%%/bin/clamfilter -F admin@domain.com \
+ -f ${sender} -- ${recipient}
+
+2. Add the content_filter option to smtpd binary:
+smtp inet n - n - - smtpd -o content_filter=filter:dummy
+
+3. Restart Postfix.
+======================================================================
diff --git a/mail/clamfilter/pkg-descr b/mail/clamfilter/pkg-descr
new file mode 100644
index 000000000000..d3b6125f5d10
--- /dev/null
+++ b/mail/clamfilter/pkg-descr
@@ -0,0 +1,13 @@
+This is a small, efficient clamav content filter for Postfix. What is does
+is just a content filtering of messages passing via Postfix MTA thru clamav.
+
+This version will fork and run clamdscan binary. Next version will connect
+to clamd directly via libclamav.
+
+Clamfilter was designed to be the only content filter in Postfix installation,
+and this is why this software appeared. All other content filters for Postfix
+are designed to be flexible; clamfilter is not. It is just designed to perform
+a single task - filtering thru clamav.
+
+Author Egor Egorov <egor@ensita.net>
+WWW: http://www.ensita.net/products/clamfilter/