1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-22 04:17:44 +00:00

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>
This commit is contained in:
Pav Lucistnik 2010-08-26 14:57:15 +00:00
parent f519976002
commit 7b2283bcfc
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=260020
9 changed files with 206 additions and 0 deletions

View File

@ -602,6 +602,7 @@
SUBDIR += sa-stats
SUBDIR += sa-utils
SUBDIR += sastatd
SUBDIR += scam-backscatter
SUBDIR += sccmilter
SUBDIR += scmail
SUBDIR += sendmail

View File

@ -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>

View File

@ -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

View File

@ -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");
}

View File

@ -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

View File

@ -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.

View File

@ -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"

View File

@ -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/

View File

@ -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