aboutsummaryrefslogtreecommitdiff
path: root/mail/smc-milter
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2005-04-06 08:48:12 +0000
committerPav Lucistnik <pav@FreeBSD.org>2005-04-06 08:48:12 +0000
commit0bf8041719eca759b1a6a24fc74b258b6e96bd8e (patch)
treee0c958cc97fb8f8ee18afd695576f7fc4258891a /mail/smc-milter
parentb20cce15d956c37a39fda19e27bcf4c4b4ca691a (diff)
downloadports-0bf8041719eca759b1a6a24fc74b258b6e96bd8e.tar.gz
ports-0bf8041719eca759b1a6a24fc74b258b6e96bd8e.zip
Notes
Diffstat (limited to 'mail/smc-milter')
-rw-r--r--mail/smc-milter/Makefile34
-rw-r--r--mail/smc-milter/distinfo2
-rw-r--r--mail/smc-milter/files/patch-Makefile62
-rw-r--r--mail/smc-milter/files/patch-regex.c36
-rw-r--r--mail/smc-milter/files/patch-relay.c21
-rw-r--r--mail/smc-milter/files/patch-smc-milter.c45
-rw-r--r--mail/smc-milter/files/patch-smtp.c35
-rw-r--r--mail/smc-milter/files/patch-utils.c15
-rw-r--r--mail/smc-milter/files/smc-milter.sh20
-rw-r--r--mail/smc-milter/pkg-descr10
-rw-r--r--mail/smc-milter/pkg-message11
-rw-r--r--mail/smc-milter/pkg-plist6
12 files changed, 297 insertions, 0 deletions
diff --git a/mail/smc-milter/Makefile b/mail/smc-milter/Makefile
new file mode 100644
index 000000000000..be5cffc3b1cd
--- /dev/null
+++ b/mail/smc-milter/Makefile
@@ -0,0 +1,34 @@
+# New ports collection makefile for: smc-milter
+# Date created: 30 March 2005
+# Whom: Andrey E. Shevtsov
+#
+# $FreeBSD$
+#
+
+PORTNAME= smc-milter
+PORTVERSION= 1.5
+CATEGORIES= mail
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= milter
+
+MAINTAINER= nyxo@dnuc.polyn.kiae.su
+COMMENT= A non-context email filter
+
+BUILD_DEPENDS= ${LOCALBASE}/lib/libbind_r.a:${PORTSDIR}/dns/bind84
+LIB_DEPENDS= db-4.2.2:${PORTSDIR}/databases/db42
+
+USE_GMAKE= yes
+USE_REINPLACE= yes
+
+NOMAN=
+
+post-extract:
+ @${REINPLACE_CMD} -e 's|\/opt\/SMC|\/usr\/local\/etc\/smc|g ; \
+ s|aliases|mail\/aliases|g' \
+ ${WRKSRC}/smc-milter.h
+
+post-install:
+ ${INSTALL_SCRIPT} ${FILESDIR}/smc-milter.sh \
+ ${PREFIX}/etc/rc.d/smc-milter.sh
+
+.include <bsd.port.mk>
diff --git a/mail/smc-milter/distinfo b/mail/smc-milter/distinfo
new file mode 100644
index 000000000000..4ba79b4b1bf4
--- /dev/null
+++ b/mail/smc-milter/distinfo
@@ -0,0 +1,2 @@
+MD5 (smc-milter-1.5.tar.gz) = d772a8f0d2d6cfccd50ea8668a4881d0
+SIZE (smc-milter-1.5.tar.gz) = 96274
diff --git a/mail/smc-milter/files/patch-Makefile b/mail/smc-milter/files/patch-Makefile
new file mode 100644
index 000000000000..c7646a450afd
--- /dev/null
+++ b/mail/smc-milter/files/patch-Makefile
@@ -0,0 +1,62 @@
+*** Makefile.orig Mon Mar 14 08:27:09 2005
+--- Makefile Sun Apr 3 17:28:21 2005
+***************
+*** 10,20 ****
+ # CFLAGS = -g -O2 -Wall -D_GNU_SOURCE -D_REENTRANT -I/usr/lib/bind/include
+ # LIBS = /usr/lib/bind/lib/libbind_r.a -lmilter -pthread -lssl -ldb
+ # if glibc >= 2.2
+! CFLAGS = -g -O2 -Wall -D_GNU_SOURCE -D_REENTRANT
+! LIBS = -lmilter -pthread -lssl -ldb -lresolv
+ MILTER = smc-milter
+! INSDIR = /opt/SMC
+! CC = gcc
+
+ all: milter
+
+--- 10,24 ----
+ # CFLAGS = -g -O2 -Wall -D_GNU_SOURCE -D_REENTRANT -I/usr/lib/bind/include
+ # LIBS = /usr/lib/bind/lib/libbind_r.a -lmilter -pthread -lssl -ldb
+ # if glibc >= 2.2
+! CFLAGS += -g -O2 -Wall -D_GNU_SOURCE -D_REENTRANT \
+! -I/usr/local/include/bind -I/usr/local/include/db42
+! LIBS = -lmilter -pthread -lssl -L/usr/local/lib/db42 -ldb \
+! -L/usr/local/lib -lbind_r -lcrypto
+ MILTER = smc-milter
+! BASEINSDIR = /usr/local
+! CONFINSDIR = $(BASEINSDIR)/etc/smc
+! BININSDIR = $(BASEINSDIR)/bin
+! CC ?= gcc
+
+ all: milter
+
+***************
+*** 29,42 ****
+
+
+ install:
+! [ -d "$(INSDIR)" ] || mkdir $(INSDIR)
+ if [ -n "$(MILTER)" ]; then \
+ strip $(MILTER) ; \
+! install -m 755 $(MILTER) $(INSDIR) ; \
+ fi
+! install -m 644 $(MILTER).conf $(INSDIR)
+! install -m 644 $(MILTER).policy $(INSDIR)
+! install -m 644 $(MILTER).users $(INSDIR)
+
+ remove:
+ rm -f $(INSDIR)/$(MILTER)*
+--- 33,46 ----
+
+
+ install:
+! [ -d "$(CONFINSDIR)" ] || mkdir $(CONFINSDIR)
+ if [ -n "$(MILTER)" ]; then \
+ strip $(MILTER) ; \
+! install -m 755 $(MILTER) $(BININSDIR) ; \
+ fi
+! install -m 644 $(MILTER).conf $(CONFINSDIR)
+! install -m 644 $(MILTER).policy $(CONFINSDIR)
+! install -m 644 $(MILTER).users $(CONFINSDIR)
+
+ remove:
+ rm -f $(INSDIR)/$(MILTER)*
diff --git a/mail/smc-milter/files/patch-regex.c b/mail/smc-milter/files/patch-regex.c
new file mode 100644
index 000000000000..94abbf2c8bd2
--- /dev/null
+++ b/mail/smc-milter/files/patch-regex.c
@@ -0,0 +1,36 @@
+*** regex.c.orig Thu Mar 10 06:10:48 2005
+--- regex.c Wed Mar 23 17:51:06 2005
+***************
+*** 58,64 ****
+ # include <wctype.h>
+ #endif
+
+! #include <malloc.h>
+ #include "regex.h"
+
+ /* This is for multi byte string support. */
+--- 58,64 ----
+ # include <wctype.h>
+ #endif
+
+! #include <stdlib.h>
+ #include "regex.h"
+
+ /* This is for multi byte string support. */
+***************
+*** 148,159 ****
+--- 148,161 ----
+ even if config.h says that we can. */
+ # undef REL_ALLOC
+
++ #ifndef _STDLIB_H_
+ # if defined STDC_HEADERS || defined _LIBC
+ # include <stdlib.h>
+ # else
+ char *malloc ();
+ char *realloc ();
+ # endif
++ #endif /* _STDLIB_H_ */
+
+ /* When used in Emacs's lib-src, we need to get bzero and bcopy somehow.
+ If nothing else has been done, use the method below. */
diff --git a/mail/smc-milter/files/patch-relay.c b/mail/smc-milter/files/patch-relay.c
new file mode 100644
index 000000000000..02c635a09348
--- /dev/null
+++ b/mail/smc-milter/files/patch-relay.c
@@ -0,0 +1,21 @@
+*** relay.c.orig Thu Mar 10 06:23:13 2005
+--- relay.c Thu Mar 24 11:23:49 2005
+***************
+*** 202,209 ****
+ return -1;
+ }
+
+! if (!(gethostbyname_r(host_name, &host_buf, buffer, sizeof(buffer),
+! &host, &ret))) {
+ while (*host->h_addr_list) {
+ if (host_addr == *(uint32_t *)(*host->h_addr_list)) {
+ resolver_close(&res_local);
+--- 202,209 ----
+ return -1;
+ }
+
+! host = gethostbyname_r(host_name, &host_buf, buffer, sizeof(buffer), &ret);
+! if (!ret) {
+ while (*host->h_addr_list) {
+ if (host_addr == *(uint32_t *)(*host->h_addr_list)) {
+ resolver_close(&res_local);
diff --git a/mail/smc-milter/files/patch-smc-milter.c b/mail/smc-milter/files/patch-smc-milter.c
new file mode 100644
index 000000000000..1b019fa0c47c
--- /dev/null
+++ b/mail/smc-milter/files/patch-smc-milter.c
@@ -0,0 +1,45 @@
+*** smc-milter.c.orig Thu Mar 10 06:10:48 2005
+--- smc-milter.c Thu Mar 24 12:09:11 2005
+***************
+*** 65,70 ****
+--- 65,74 ----
+ #include "relay.h"
+ #include "smtp.h"
+
++ #if !defined O_SYNC && defined O_FSYNC
++ #define O_SYNC O_FSYNC
++ #endif
++
+ /* Static variables for config defaults, etc. */
+ static int runmode = 0;
+ static char *smfisock = NULL;
+***************
+*** 161,166 ****
+--- 165,191 ----
+ "<(i?frame|object|embed|applet)[^>]*>",
+ "\\son(\\w+)=[^> ]+", NULL
+ };
++
++ #ifndef strndup
++ char *strndup(char const* s, size_t n)
++ {
++ void* voided = (void*)s;
++ void* match;
++ char *ret;
++ size_t len;
++
++ if (!s || !n) return NULL;
++ match = memchr(voided, 0, n);
++ len =
++ match
++ ? (char*)match - s
++ : n+1;
++ ret = (char*)malloc(len);
++ memcpy(ret, s, len-1);
++ ret[len] = '\0';
++ return ret;
++ }
++ #endif
+
+ void
+ signal_handler (int sig) {
diff --git a/mail/smc-milter/files/patch-smtp.c b/mail/smc-milter/files/patch-smtp.c
new file mode 100644
index 000000000000..c27a7da23458
--- /dev/null
+++ b/mail/smc-milter/files/patch-smtp.c
@@ -0,0 +1,35 @@
+*** smtp.c.orig Thu Mar 10 06:10:48 2005
+--- smtp.c Thu Mar 24 11:38:42 2005
+***************
+*** 50,55 ****
+--- 50,59 ----
+ #define SMTP_CMD_PERM(x) (500 <= (x) && (x) < 600)
+ #define SMTP_DATA_OK(x) ((x) == 354)
+
++ #ifndef MSG_NOSIGNAL
++ #define MSG_NOSIGNAL 0
++ #endif
++
+ typedef union {
+ HEADER hdr;
+ u_char buf[MAXPACKET];
+***************
+*** 326,333 ****
+ int optval = 1;
+ char buffer[8192];
+
+! if ((gethostbyname_r(mxhost, &host_buf, buffer, sizeof(buffer),
+! &host, &ret))) return -1;
+
+ memset(&address, 0, sizeof(struct sockaddr));
+ address.sin_addr.s_addr = *(uint32_t *)host->h_addr_list[0];
+--- 330,338 ----
+ int optval = 1;
+ char buffer[8192];
+
+! host = gethostbyname_r(mxhost, &host_buf, buffer, sizeof(buffer), &ret);
+! if(ret)
+! return -1;
+
+ memset(&address, 0, sizeof(struct sockaddr));
+ address.sin_addr.s_addr = *(uint32_t *)host->h_addr_list[0];
diff --git a/mail/smc-milter/files/patch-utils.c b/mail/smc-milter/files/patch-utils.c
new file mode 100644
index 000000000000..fde8597ffe92
--- /dev/null
+++ b/mail/smc-milter/files/patch-utils.c
@@ -0,0 +1,15 @@
+*** utils.c.orig Thu Mar 10 06:10:48 2005
+--- utils.c Thu Mar 24 11:40:56 2005
+***************
+*** 32,37 ****
+--- 32,41 ----
+ #define MAXLINE 4096
+ #endif
+
++ #if !defined O_SYNC && defined O_FSYNC
++ #define O_SYNC O_FSYNC
++ #endif
++
+ typedef struct {
+ char name[PATH_MAX+1];
+ pthread_mutex_t lock;
diff --git a/mail/smc-milter/files/smc-milter.sh b/mail/smc-milter/files/smc-milter.sh
new file mode 100644
index 000000000000..0de4eb84047a
--- /dev/null
+++ b/mail/smc-milter/files/smc-milter.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+case "$1" in
+ start)
+ /usr/local/bin/smc-milter
+ echo ' smc-milter'
+ ;;
+ stop)
+ if [ -f /var/run/smc-milter.pid ]; then
+ kill `cat /var/run/smc-milter.pid`
+ echo ' smc-milter'
+ fi
+ ;;
+ *)
+ echo ""
+ echo "Usage: `basename $0` { start | stop }"
+ echo ""
+ exit 64
+ ;;
+esac
diff --git a/mail/smc-milter/pkg-descr b/mail/smc-milter/pkg-descr
new file mode 100644
index 000000000000..dcc951753f67
--- /dev/null
+++ b/mail/smc-milter/pkg-descr
@@ -0,0 +1,10 @@
+Sendmail Confirmation System (SMC) is an Sendmail milter plugin that is
+designed to significantly reduce the amount of junk email you receive. It
+uses dynamic local and DNS-based remote whitelists, blacklists, and an
+original auto-confirmation system for unknown but legitimate senders. It
+includes features for protecting recipients from dangerous attachments and
+HTML includes. It uses a set of original algorithms, including "Check relay
+by NS", which simulates a dynamic whitelisting technique, and "Check delays",
+also known as "Greylisting".
+
+WWW: http://milter.sourceforge.net/
diff --git a/mail/smc-milter/pkg-message b/mail/smc-milter/pkg-message
new file mode 100644
index 000000000000..4e21d5fb8f79
--- /dev/null
+++ b/mail/smc-milter/pkg-message
@@ -0,0 +1,11 @@
+The start/stop script has been placed in $PREFIX/etc/rc.d/smc-milter.sh
+Configuration files has been placed in $PREFIX/etc/smc/
+
+Add this lines to your sendmail's .mc file:
+
+define(`confMILTER_MACROS_CONNECT', `{client_addr}')dnl
+INPUT_MAIL_FILTER(`SMC-milter', `S=local:/var/run/smc-milter.sock, F=T, T=C:30m;S:10m;R:10m;E:30m')dnl
+
+Then generate new sendmail.cf, install it, start smc-milter and finally
+restart sendmail.
+
diff --git a/mail/smc-milter/pkg-plist b/mail/smc-milter/pkg-plist
new file mode 100644
index 000000000000..03a6c5a34d27
--- /dev/null
+++ b/mail/smc-milter/pkg-plist
@@ -0,0 +1,6 @@
+bin/smc-milter
+etc/smc/smc-milter.conf
+etc/smc/smc-milter.policy
+etc/smc/smc-milter.users
+@dirrm etc/smc
+etc/rc.d/smc-milter.sh