aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2010-08-26 22:57:15 +0800
committerpav <pav@FreeBSD.org>2010-08-26 22:57:15 +0800
commit645b62080199525612ad398d43739a44ecb86cc7 (patch)
tree80e98ac629b86eb6fe465647c961a6274db65fdf /mail
parent716c960b7a481dbe6a90a5d380e1bb295b0c1c8c (diff)
downloadfreebsd-ports-gnome-645b62080199525612ad398d43739a44ecb86cc7.tar.gz
freebsd-ports-gnome-645b62080199525612ad398d43739a44ecb86cc7.tar.zst
freebsd-ports-gnome-645b62080199525612ad398d43739a44ecb86cc7.zip
scam-backscatter milter
Scam-backscatter prevents spam backscatter (accept and bounce) on mail servers which don't host mailboxes locally. It validates mailboxes by verifying the recipient addresses hosted on a different mail server. WWW: http://www.elandsys.com/scam/scam-backscatter/ PR: ports/147115 Submitted by: Janne Snabb <snabb@epipe.com>
Diffstat (limited to 'mail')
-rw-r--r--mail/Makefile1
-rw-r--r--mail/scam-backscatter/Makefile72
-rw-r--r--mail/scam-backscatter/distinfo3
-rw-r--r--mail/scam-backscatter/files/patch-scam-back.c20
-rw-r--r--mail/scam-backscatter/files/patch-scam.conf17
-rw-r--r--mail/scam-backscatter/files/pkg-message.in21
-rw-r--r--mail/scam-backscatter/files/scam-backscatter.in56
-rw-r--r--mail/scam-backscatter/pkg-descr8
-rw-r--r--mail/scam-backscatter/pkg-plist8
9 files changed, 206 insertions, 0 deletions
diff --git a/mail/Makefile b/mail/Makefile
index b608afdd6b37..911742248444 100644
--- a/mail/Makefile
+++ b/mail/Makefile
@@ -602,6 +602,7 @@
SUBDIR += sa-stats
SUBDIR += sa-utils
SUBDIR += sastatd
+ SUBDIR += scam-backscatter
SUBDIR += sccmilter
SUBDIR += scmail
SUBDIR += sendmail
diff --git a/mail/scam-backscatter/Makefile b/mail/scam-backscatter/Makefile
new file mode 100644
index 000000000000..02823bc18de3
--- /dev/null
+++ b/mail/scam-backscatter/Makefile
@@ -0,0 +1,72 @@
+# New ports collection makefile for: scam-backscatter
+# Date created: 2010-05-27
+# Whom: Janne Snabb <snabb@epipe.com>
+#
+# $FreeBSD$
+#
+
+PORTNAME= scam-backscatter
+PORTVERSION= 1.5.1
+CATEGORIES= mail
+MASTER_SITES= http://www.elandsys.com/scam/scam-backscatter/ \
+ http://dist.epipe.com/mirrors/scam-backscatter/
+DISTNAME= scamback-${PORTVERSION}
+EXTRACT_SUFX= .tgz
+
+MAINTAINER= snabb@epipe.com
+COMMENT= Address verification milter to prevent spam backscatter
+
+WRKSRC= ${WRKDIR}/scamback
+USE_RC_SUBR= scam-backscatter
+SUB_FILES= pkg-message
+
+MAKEFILE= Makefile.freebsd
+ALL_TARGET=
+
+OPTIONS= ALLDOMAINS "Verify any domain with the backend" Off \
+ EHLO "Use EHLO instead of HELO in SMTP session" Off \
+ USEMAILERTABLE "Use mailertable to map domains to backends" Off
+
+.include <bsd.port.options.mk>
+.include "${PORTSDIR}/mail/sendmail/bsd.milter.mk"
+
+LDFLAGS+= ${SENDMAIL_LDFLAGS}
+LIBS+= -lmilter
+LIBS+= ${SENDMAIL_LDADD}
+
+CFLAGS+= ${PTHREAD_CFLAGS}
+LIBS+= ${PTHREAD_LIBS}
+
+.if defined(WITH_ALLDOMAINS)
+CFLAGS+= -DALLDOMAINS
+.endif
+.if defined(WITH_EHLO)
+CFLAGS+= -DEHLO
+.endif
+.if defined(WITH_USEMAILERTABLE)
+CFLAGS+= -DUSEMAILERTABLE
+.endif
+
+MAKE_ARGS+= CC="${CC}" CCFLAGS="${CFLAGS}" CFLAGS="" \
+ LDFLAGS="${LDFLAGS}" LIBS="${LIBS}"
+
+post-patch:
+ @${REINPLACE_CMD} -e \
+ 's|/var/spool/scam/scam-back\.pid|/var/run/scam-back\.pid|g; \
+ s|/etc/mail/scam\.conf|${PREFIX}/etc/mail/scam-back\.conf|g;' \
+ ${WRKSRC}/scam-back.c
+
+do-install:
+ ${MKDIR} ${PREFIX}/etc/mail
+ ${INSTALL_PROGRAM} ${WRKSRC}/scam-back ${PREFIX}/libexec/scam-back
+ ${INSTALL_DATA} ${WRKSRC}/scam.conf ${PREFIX}/etc/mail/scam-back.conf.sample
+
+post-install:
+.if !defined(NOPORTDOCS)
+ ${MKDIR} ${DOCSDIR}
+ ${INSTALL_MAN} ${WRKSRC}/INSTALL ${DOCSDIR}
+ ${INSTALL_MAN} ${WRKSRC}/License ${DOCSDIR}
+.endif
+ ${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/mail/scam-backscatter/distinfo b/mail/scam-backscatter/distinfo
new file mode 100644
index 000000000000..64daa501c395
--- /dev/null
+++ b/mail/scam-backscatter/distinfo
@@ -0,0 +1,3 @@
+MD5 (scamback-1.5.1.tgz) = 63165c21ba6bde4bc0532f4af67c3e09
+SHA256 (scamback-1.5.1.tgz) = db5b650f92f51cfddf1e2e172791396f01375fefd0456eaee910f0645bae6738
+SIZE (scamback-1.5.1.tgz) = 22748
diff --git a/mail/scam-backscatter/files/patch-scam-back.c b/mail/scam-backscatter/files/patch-scam-back.c
new file mode 100644
index 000000000000..f88db65d1c1c
--- /dev/null
+++ b/mail/scam-backscatter/files/patch-scam-back.c
@@ -0,0 +1,20 @@
+--- scam-back.c.orig 2010-02-21 07:20:47.000000000 +0000
++++ scam-back.c 2010-05-26 17:39:32.000000000 +0000
+@@ -437,7 +437,7 @@
+
+ #ifndef LINUX
+ #ifdef ALLDOMAINS
+- backsslen = backss.ss_len
++ backsslen = backss.ss_len;
+ #else
+ backsslen = priv->backss.ss_len;
+ #ifdef FALLBACKEND
+@@ -1174,7 +1174,7 @@
+ {
+ syslog (LOG_ERR, "cannot open pidfile");
+ } else {
+- snprintf (buf, sizeof (buf), "%ld", (long) pid);
++ snprintf (buf, sizeof (buf), "%ld\n", (long) pid);
+ if (write (fd, buf, strlen (buf)) != strlen (buf)) {
+ syslog (LOG_ERR, "cannot write to pidfile");
+ }
diff --git a/mail/scam-backscatter/files/patch-scam.conf b/mail/scam-backscatter/files/patch-scam.conf
new file mode 100644
index 000000000000..c36cefabe31c
--- /dev/null
+++ b/mail/scam-backscatter/files/patch-scam.conf
@@ -0,0 +1,17 @@
+--- scam.conf.orig 2010-05-26 17:27:03.000000000 +0000
++++ scam.conf 2010-05-26 17:28:31.000000000 +0000
+@@ -58,12 +58,12 @@
+ # SMTP timeouts, in seconds
+ # Determines the time to wait for a connection to the backend SMTP server.
+
+-#TimeoutSMTPconnect:2
++#TimeoutSMTPConnect:2
+
+ # Determines the time to wait for a reply from the backend SMTP
+ # server after sending a SMTP command.
+
+-#TimeoutSMTPreply:3
++#TimeoutSMTPReply:3
+
+ # Bypass the Scam-backscatter check
+
diff --git a/mail/scam-backscatter/files/pkg-message.in b/mail/scam-backscatter/files/pkg-message.in
new file mode 100644
index 000000000000..372175dc72b2
--- /dev/null
+++ b/mail/scam-backscatter/files/pkg-message.in
@@ -0,0 +1,21 @@
+===> IMPORTANT NOTE
+
+ A sample configuration file has been installed in %%PREFIX%%/etc/mail
+ directory. Copy and edit it to suit your needs before launching
+ scam-backscatter milter.
+
+ Add the following lines to your /etc/mail/<your_host>.mc configuration.
+
+ define(`confMILTER_MACROS_ENVRCPT', `{rcpt_mailer}, {rcpt_host}, {rcpt_addr}'')dnl
+ INPUT_MAIL_FILTER(`scam-back', `S=unix:/var/scam-back/scam-back.sock, F=T, T=S:240s;R:240s;E:5m')dnl
+
+ If you are already using another milter, you might have
+ confMILTER_MACROS_ENVRCPT already defined. In that case you
+ should ensure that it includes the macros listed above (and add
+ any missing ones).
+
+ To run scam-backscatter from startup, add scambackscatter_enable="YES"
+ in your /etc/rc.conf or your /etc/rc.conf.local
+
+ See %%DOCSDIR%%/INSTALL for configuration details.
+
diff --git a/mail/scam-backscatter/files/scam-backscatter.in b/mail/scam-backscatter/files/scam-backscatter.in
new file mode 100644
index 000000000000..001b5524a470
--- /dev/null
+++ b/mail/scam-backscatter/files/scam-backscatter.in
@@ -0,0 +1,56 @@
+#!/bin/sh
+# $FreeBSD$
+
+# PROVIDE: scambackscatter
+# REQUIRE: LOGIN
+# BEFORE: mail
+
+# This file should be installed as %%PREFIX%%/etc/rc.d/scam-backscatter
+#
+# Define scambackscatter_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/scambackscatter
+#
+# Add the following line to enable:
+# scambackscatter_enable="YES"
+#
+# DO NOT CHANGE THE DEFAULT VALUES BELOW
+#
+
+. /etc/rc.subr
+
+name="scambackscatter"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/libexec/scam-back"
+start_precmd="${name}_prestart"
+
+scambackscatter_user=${scambackscatter_user-"mailnull"}
+scambackscatter_group=${scambackscatter_group-"mailnull"}
+
+scambackscatter_enable=${scambackscatter_enable-"NO"}
+scambackscatter_dir=${scambackscatter_dir-"/var/scam-back"}
+scambackscatter_runas=${scambackscatter_runas-"$scambackscatter_user"}
+scambackscatter_pidfile=${scambackscatter_pidfile-"/var/run/scam-back.pid"}
+scambackscatter_sockfile=${scambackscatter_sockfile-"$scambackscatter_dir/scam-back.sock"}
+scambackscatter_cfgfile=${scambackscatter_cfgfile-"%%PREFIX%%/etc/mail/scam-back.conf"}
+scambackscatter_flags=${scambackscatter_flags-"-p unix:$scambackscatter_sockfile \
+-f $scambackscatter_cfgfile -u $scambackscatter_runas -P $scambackscatter_pidfile \
+-b $scambackscatter_dir/backscatter.txt -D"}
+
+load_rc_config ${name}
+
+scambackscatter_prestart()
+{
+ if [ ! -d "${scambackscatter_dir}/." ]; then
+ mkdir ${scambackscatter_dir}
+ chown ${scambackscatter_user}:${scambackscatter_group} ${scambackscatter_dir}
+ chmod 700 ${scambackscatter_dir}
+ fi
+ if [ ! -f "${scambackscatter_pidfile}" ]; then
+ touch ${scambackscatter_pidfile}
+ chown ${scambackscatter_user}:${scambackscatter_group} ${scambackscatter_pidfile}
+ fi
+}
+
+run_rc_command "$1"
diff --git a/mail/scam-backscatter/pkg-descr b/mail/scam-backscatter/pkg-descr
new file mode 100644
index 000000000000..d139e77a06a7
--- /dev/null
+++ b/mail/scam-backscatter/pkg-descr
@@ -0,0 +1,8 @@
+scam-backscatter milter
+
+Scam-backscatter prevents spam backscatter (accept and bounce) on
+mail servers which don't host mailboxes locally. It validates
+mailboxes by verifying the recipient addresses hosted on a different
+mail server.
+
+WWW: http://www.elandsys.com/scam/scam-backscatter/
diff --git a/mail/scam-backscatter/pkg-plist b/mail/scam-backscatter/pkg-plist
new file mode 100644
index 000000000000..5407287b5e5d
--- /dev/null
+++ b/mail/scam-backscatter/pkg-plist
@@ -0,0 +1,8 @@
+@comment $FreeBSD$
+libexec/scam-back
+etc/mail/scam-back.conf.sample
+%%PORTDOCS%%%%DOCSDIR%%/INSTALL
+%%PORTDOCS%%%%DOCSDIR%%/License
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
+@dirrmtry etc/mail
+@unexec [ -f /var/scam-back/backscatter.txt ] || /bin/rmdir /var/scam-back 2>/dev/null || true