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>
This commit is contained in:
Pav Lucistnik 2008-02-17 21:16:46 +00:00
parent e3301dcda2
commit c80e1983fb
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=207486
12 changed files with 333 additions and 0 deletions

View File

@ -559,6 +559,7 @@
SUBDIR += simscan
SUBDIR += sma
SUBDIR += smail
SUBDIR += smfsav
SUBDIR += smtp-gated
SUBDIR += smtpclient
SUBDIR += smtpd

59
mail/smfsav/Makefile Normal file
View File

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

6
mail/smfsav/distinfo Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

27
mail/smfsav/pkg-deinstall Normal file
View File

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

14
mail/smfsav/pkg-descr Normal file
View File

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

32
mail/smfsav/pkg-install Normal file
View File

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