aboutsummaryrefslogtreecommitdiff
path: root/mail/smfsav
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2008-02-17 21:16:46 +0000
committerPav Lucistnik <pav@FreeBSD.org>2008-02-17 21:16:46 +0000
commitc80e1983fbabc35a806e5bb81b8e4e01af02efb9 (patch)
treee287fbfa3c52c1fe70be85dcf01cfcc651e52005 /mail/smfsav
parente3301dcda29c98536690fdf6cdd74af25afc4e57 (diff)
downloadports-c80e1983fbabc35a806e5bb81b8e4e01af02efb9.tar.gz
ports-c80e1983fbabc35a806e5bb81b8e4e01af02efb9.zip
It's a lightweight, fast and reliable Sendmail milter that implements
a real-time Sender e-Mail Address Verification technology. This technology can stop some kinds of SPAM with a spoofed sender's e-Mail address. Also it implements a real-time Recipient e-Mail Address Verification technology. It can be useful if your machine is a backup MX for the recipient's domains or if your machine forwards all e-Mail messages as a relay host for your domains to another internal or external e-Mail servers. It's a lite alternative for the spamilter, milter-sender and milter-ahead milters. WWW: http://smfs.sourceforge.net/ PR: ports/116948 Submitted by: Anton Lysenok / Bart Tapolsky <bart@tapolsky.net.ua>
Notes
Notes: svn path=/head/; revision=207486
Diffstat (limited to 'mail/smfsav')
-rw-r--r--mail/smfsav/Makefile59
-rw-r--r--mail/smfsav/distinfo6
-rw-r--r--mail/smfsav/files/patch-Makefile48
-rw-r--r--mail/smfsav/files/patch-readme28
-rw-r--r--mail/smfsav/files/patch-smf-sav.c57
-rw-r--r--mail/smfsav/files/patch-smf-sav.conf28
-rw-r--r--mail/smfsav/files/pkg-message.in9
-rw-r--r--mail/smfsav/files/smfsav.in24
-rw-r--r--mail/smfsav/pkg-deinstall27
-rw-r--r--mail/smfsav/pkg-descr14
-rw-r--r--mail/smfsav/pkg-install32
11 files changed, 332 insertions, 0 deletions
diff --git a/mail/smfsav/Makefile b/mail/smfsav/Makefile
new file mode 100644
index 000000000000..2104dc4bb085
--- /dev/null
+++ b/mail/smfsav/Makefile
@@ -0,0 +1,59 @@
+# New ports collection makefile for: smfsav
+# Date created: 17 February 2008
+# Whom: Anton Lysenok <bart@tapolsky.net.ua>
+#
+# $FreeBSD$
+#
+
+PORTNAME= smfsav
+PORTVERSION= 1.4.0
+CATEGORIES= mail
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}:0 \
+ ${MASTER_SITE_ISC}:1
+MASTER_SITE_SUBDIR= smfs/:0 \
+ bind8/src/8.4.7/:1
+DISTNAME= smf-sav-1.4.0
+DISTFILES= smf-sav-1.4.0.tar.gz:0 \
+ bind-src.tar.gz:1
+DIST_SUBDIR= ${PORTNAME}
+
+MAINTAINER= bart@tapolsky.net.ua
+COMMENT= Sendmail Sender Address Validator
+
+PLIST_FILES= sbin/smfsav \
+ etc/smfsav.conf-dist
+
+.if !defined(NOPORTDOCS)
+PLIST_FILES+= %%PORTDOCS%%%%DOCSDIR%%/COPYING \
+ %%PORTDOCS%%%%DOCSDIR%%/CHANGES \
+ %%PORTDOCS%%%%DOCSDIR%%/README
+PLIST_DIRS= share/doc/${PORTNAME}
+.endif
+
+USE_RC_SUBR= smfsav
+
+SUB_FILES= pkg-message
+
+pre-build:
+ @${ECHO}
+ @${ECHO} [*] Compiling BIND 8 to make SmfSav able to resolve DNS names
+ ${MAKE} all -C ${WRKDIR}/src
+ @${ECHO}
+ @${ECHO} [*] Compiling SmfSav
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/smf-sav ${PREFIX}/sbin/smfsav
+ ${INSTALL_DATA} ${WRKSRC}/smf-sav.conf ${PREFIX}/etc/smfsav.conf-dist
+
+post-install:
+.if !defined(NOPORTDOCS)
+ ${MKDIR} ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/COPYING ${DOCSDIR}/COPYING
+ ${INSTALL_DATA} ${WRKSRC}/ChangeLog ${DOCSDIR}/CHANGES
+ ${INSTALL_DATA} ${WRKSRC}/readme ${DOCSDIR}/README
+.endif
+
+ ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/mail/smfsav/distinfo b/mail/smfsav/distinfo
new file mode 100644
index 000000000000..c9b3ec807fa9
--- /dev/null
+++ b/mail/smfsav/distinfo
@@ -0,0 +1,6 @@
+MD5 (smfsav/smf-sav-1.4.0.tar.gz) = 7f3d0b66a2b940c86b47e94afe5f96a2
+SHA256 (smfsav/smf-sav-1.4.0.tar.gz) = 77a28d012330581b5ecaf126a153f049731c399e294aab0ded53c1b0abab68cc
+SIZE (smfsav/smf-sav-1.4.0.tar.gz) = 21968
+MD5 (smfsav/bind-src.tar.gz) = 3a801b15791647beb90c226d2674eb4d
+SHA256 (smfsav/bind-src.tar.gz) = a0ef8506227797ee57a6c9488fc9ef355ba2fc1fa4616fe68abf0ed6cd009b68
+SIZE (smfsav/bind-src.tar.gz) = 1484718
diff --git a/mail/smfsav/files/patch-Makefile b/mail/smfsav/files/patch-Makefile
new file mode 100644
index 000000000000..24e9994745eb
--- /dev/null
+++ b/mail/smfsav/files/patch-Makefile
@@ -0,0 +1,48 @@
+--- Makefile.orig 2006-10-25 23:15:10.000000000 +0300
++++ Makefile 2008-02-17 14:19:30.000000000 +0200
+@@ -1,17 +1,17 @@
+ CC = gcc
+ PREFIX = /usr/local
+ SBINDIR = $(PREFIX)/sbin
+-DATADIR = /var/run/smfs
+-CONFDIR = /etc/mail/smfs
+-USER = smfs
+-GROUP = smfs
+-CFLAGS = -O2 -D_REENTRANT -fomit-frame-pointer -I/usr/local/include
++DATADIR = /var/run/smfsav
++CONFDIR = $(PREFIX)/etc
++USER = smfsav
++GROUP = smfsav
++CFLAGS = -O2 -D_REENTRANT -fomit-frame-pointer -I../src/include
+
+ # Linux
+-LDFLAGS = -lmilter -lpthread -lresolv
++#LDFLAGS = -lmilter -lpthread -lresolv
+
+ # FreeBSD (BIND v8 is required)
+-#LDFLAGS = -lmilter -pthread -L/usr/local/lib -lbind_r
++LDFLAGS = -lmilter -pthread -L../src/lib -lbind_r
+
+ # Solaris
+ #LDFLAGS = -lmilter -lpthread -lsocket -lnsl -lresolv
+@@ -30,20 +30,3 @@
+
+ clean:
+ rm -f smf-sav.o smf-sav
+-
+-install:
+- @./install.sh
+- @cp -f -p smf-sav $(SBINDIR)
+- @if test ! -d $(DATADIR); then \
+- mkdir -m 700 $(DATADIR); \
+- chown $(USER):$(GROUP) $(DATADIR); \
+- fi
+- @if test ! -d $(CONFDIR); then \
+- mkdir -m 755 $(CONFDIR); \
+- fi
+- @if test ! -f $(CONFDIR)/smf-sav.conf; then \
+- cp -p smf-sav.conf $(CONFDIR)/smf-sav.conf; \
+- else \
+- cp -p smf-sav.conf $(CONFDIR)/smf-sav.conf.new; \
+- fi
+- @echo Please, inspect and edit the $(CONFDIR)/smf-sav.conf file.
diff --git a/mail/smfsav/files/patch-readme b/mail/smfsav/files/patch-readme
new file mode 100644
index 000000000000..d2daf8a5bc52
--- /dev/null
+++ b/mail/smfsav/files/patch-readme
@@ -0,0 +1,28 @@
+--- readme.orig 2006-10-25 23:15:10.000000000 +0300
++++ readme 2008-02-17 14:50:09.000000000 +0200
+@@ -38,21 +38,18 @@
+ make
+ make install
+
+- Inspect and edit the /etc/mail/smfs/smf-sav.conf file.
++ Inspect and edit the /usr/local/etc/smfsav.conf file.
+
+-/usr/local/sbin/smf-sav
++/usr/local/sbin/smfsav
+ or
+-/usr/local/sbin/smf-sav -c /etc/mail/smfs/smf-sav.conf
++/usr/local/sbin/smfsav -c /usr/local/etc/smfsav.conf
+
+ Add this milter to start-up scripts before starting a Sendmail daemon.
+ Look at the contributed samples of start-up scripts.
+
+ Add these lines to your Sendmail configuration file (usually sendmail.mc):
+ define(`confMILTER_MACROS_HELO', confMILTER_MACROS_HELO`, {verify}')dnl
+-INPUT_MAIL_FILTER(`smf-sav', `S=unix:/var/run/smfs/smf-sav.sock, T=S:30s;R:4m')dnl
+-
+-IMPORTANT: make sure that /var/run is not a group writable directory! If so,
+-or chmod 755 /var/run, or if it's impossible switch to another directory.
++INPUT_MAIL_FILTER(`smfsav', `S=unix:/var/run/smfsav/smfsav.sock, T=S:30s;R:4m')dnl
+
+ IMPORTANT: make sure that libmilter is compiled with BROKEN_PTHREAD_SLEEP defined.
+ If this symbol is not defined, libmilter will use sleep() in signal-handler thread,
diff --git a/mail/smfsav/files/patch-smf-sav.c b/mail/smfsav/files/patch-smf-sav.c
new file mode 100644
index 000000000000..6c1bbc21004a
--- /dev/null
+++ b/mail/smfsav/files/patch-smf-sav.c
@@ -0,0 +1,57 @@
+--- smf-sav.c.orig Wed Oct 25 23:15:10 2006
++++ smf-sav.c Wed Aug 29 15:54:13 2007
+@@ -20,11 +20,7 @@
+ #endif
+
+ #include <arpa/inet.h>
+-#if __linux__ || __sun__
+ #include <arpa/nameser.h>
+-#else
+-#include <bind/arpa/nameser.h>
+-#endif
+ #include <ctype.h>
+ #include <errno.h>
+ #include <fcntl.h>
+@@ -33,20 +29,12 @@
+ #endif
+ #include <grp.h>
+ #include <libmilter/mfapi.h>
+-#if __linux__ || __sun__
+ #include <netdb.h>
+-#else
+-#include <bind/netdb.h>
+-#endif
+ #include <netinet/in.h>
+ #include <pthread.h>
+ #include <pwd.h>
+ #include <regex.h>
+-#if __linux__ || __sun__
+ #include <resolv.h>
+-#else
+-#include <bind/resolv.h>
+-#endif
+ #include <signal.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -68,7 +56,7 @@
+ #define hash_size(x) ((unsigned long) 1 << x)
+ #define hash_mask(x) (hash_size(x) - 1)
+
+-#define CONFIG_FILE "/etc/mail/smfs/smf-sav.conf"
++#define CONFIG_FILE "/usr/local/etc/smfsav.conf"
+ #define PUBLIC_NAME "yourhost.yourdomain.tld"
+ #define SAFE_CALLBACK "postmaster@yourdomain.tld"
+ #define SYSLOG_FACILITY LOG_MAIL
+@@ -81,9 +69,9 @@
+ #define TO_PASS_TTL 3600
+ #define TO_TEMPFAIL_TTL 300
+ #define TO_FAIL_TTL 3600
+-#define WORK_SPACE "/var/run/smfs"
+-#define OCONN "unix:" WORK_SPACE "/smf-sav.sock"
+-#define USER "smfs"
++#define WORK_SPACE "/var/run/smfsav"
++#define OCONN "unix:" WORK_SPACE "/smfsav.sock"
++#define USER "smfsav"
+
+ #define DNS_RETRANS 7
+ #define DNS_RETRY 4
diff --git a/mail/smfsav/files/patch-smf-sav.conf b/mail/smfsav/files/patch-smf-sav.conf
new file mode 100644
index 000000000000..e2d4aa44bb1f
--- /dev/null
+++ b/mail/smfsav/files/patch-smf-sav.conf
@@ -0,0 +1,28 @@
+--- smf-sav.conf.orig 2006-10-25 23:15:10.000000000 +0300
++++ smf-sav.conf 2008-02-17 14:25:26.000000000 +0200
+@@ -1,4 +1,4 @@
+-# /etc/mail/smfs/smf-sav.conf
++# /usr/local/etc/smfsav.conf
+ #
+ # smf-sav configuration file v1.4.0 (it's read at start)
+ #
+@@ -97,15 +97,15 @@
+
+ # Run as a selected user (smf-sav must be started by root)
+ #
+-# Default: smfs
++# Default: smfsav
+ #
+-#User smfs
++#User smfsav
+
+ # Socket used to communicate with a Sendmail daemon
+ #
+-# Default: unix:/var/run/smfs/smf-sav.sock
++# Default: unix:/var/run/smfsav/smfsav.sock
+ #
+-#Socket unix:/var/run/smfs/smf-sav.sock
++#Socket unix:/var/run/smfsav/smfsav.sock
+
+ # Facility for logging via a Syslog daemon
+ #
diff --git a/mail/smfsav/files/pkg-message.in b/mail/smfsav/files/pkg-message.in
new file mode 100644
index 000000000000..8bfaf8488b02
--- /dev/null
+++ b/mail/smfsav/files/pkg-message.in
@@ -0,0 +1,9 @@
+
+=====================================================================================
+1. Inspect and edit the %%PREFIX%%/etc/smfsav.conf file
+2. Add these lines to your Sendmail configuration file (usually sendmail.mc):
+ define(`confMILTER_MACROS_HELO', confMILTER_MACROS_HELO`, {verify}')dnl
+ INPUT_MAIL_FILTER(`smfsav', `S=unix:/var/run/smfsav/smfsav.sock, T=S:30s;R:4m')dnl
+3. Put line smfsav_enable="YES" to /etc/rc.conf file
+4. Run %%PREFIX%%/etc/rc.d/smfsav start
+=====================================================================================
diff --git a/mail/smfsav/files/smfsav.in b/mail/smfsav/files/smfsav.in
new file mode 100644
index 000000000000..0bb9d2a54208
--- /dev/null
+++ b/mail/smfsav/files/smfsav.in
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# PROVIDE: smfsav
+# REQUIRE: NETWORKING
+# BEFORE: sendmail
+
+# Written for FreeBSD.
+#
+# $FreeBSD$
+#
+# Copy this file into /usr/local/etc/rc.d as /usr/local/etc/rc.d/smfsav
+# Add this line to /etc/rc.conf:
+#
+# smfsav_enable="YES"
+
+. %%RC_SUBR%%
+
+name="smfsav"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/sbin/smfsav"
+
+load_rc_config ${name}
+run_rc_command "$1"
+
diff --git a/mail/smfsav/pkg-deinstall b/mail/smfsav/pkg-deinstall
new file mode 100644
index 000000000000..f24af6e46af3
--- /dev/null
+++ b/mail/smfsav/pkg-deinstall
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+#
+# $FreeBSD$
+#
+
+PATH=$PATH:/bin:/usr/sbin
+export PATH
+
+if [ "$2" = "POST-DEINSTALL" ]; then
+
+ if pw group show -g 666 2>&1 >/dev/null; then
+ echo "[*] Removing group \"smfsav\""
+ pw groupdel -g 666
+ fi
+
+ if pw user show -u 666 2>&1 >/dev/null; then
+ echo "[*] Removing user \"smfsav\""
+ pw userdel -u 666
+ fi
+
+ if [ -d /var/run/smfsav ]; then
+ echo "[*] Removing directory \"/var/run/smfsav\""
+ rmdir /var/run/smfsav
+ fi
+
+fi
diff --git a/mail/smfsav/pkg-descr b/mail/smfsav/pkg-descr
new file mode 100644
index 000000000000..4035c298c696
--- /dev/null
+++ b/mail/smfsav/pkg-descr
@@ -0,0 +1,14 @@
+ It's a lightweight, fast and reliable Sendmail milter that implements
+a real-time Sender e-Mail Address Verification technology. This technology
+can stop some kinds of SPAM with a spoofed sender's e-Mail address.
+ Also it implements a real-time Recipient e-Mail Address Verification
+technology. It can be useful if your machine is a backup MX for the recipient's
+domains or if your machine forwards all e-Mail messages as a relay host for your
+domains to another internal or external e-Mail servers.
+ It's a lite alternative for the spamilter, milter-sender and milter-ahead
+milters.
+
+WWW: http://smfs.sourceforge.net/
+
+- Eugene Kurmanin
+me@kurmanin.info
diff --git a/mail/smfsav/pkg-install b/mail/smfsav/pkg-install
new file mode 100644
index 000000000000..90e611687f93
--- /dev/null
+++ b/mail/smfsav/pkg-install
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+#
+# $FreeBSD$
+#
+
+PATH=$PATH:/bin:/usr/sbin
+export PATH
+
+
+if [ "$2" = "POST-INSTALL" ]; then
+
+ if grep "^smfsav:" /etc/group > /dev/null; then
+ :
+ else
+ echo "[*] Adding group \"smfsav\""
+ pw groupadd -n smfsav -g 666
+ fi
+
+ if grep "^smfsav:" /etc/passwd > /dev/null; then
+ :
+ else
+ echo "[*] Adding user \"smfsav\""
+ pw useradd -c SMFSAV -g smfsav -n smfsav -d /nonexistent -s /usr/sbin/nologin -u 666
+ fi
+
+ echo "[*] Creating directory \"/var/run/smfsav\""
+ mkdir /var/run/smfsav
+ chown smfsav:smfsav /var/run/smfsav
+ chmod 700 /var/run/smfsav
+
+fi