Add milter-greylist, a milter for sendmail written in C that implements

grey listing. Grey listing is a spam filtering technique, which uses a behavior
trick: spammers never resend a message when they get a temporary error,
whereas real MTA do. The idea is to refuse any mail on first attempt, and
accept it after some time has elapsed.

PR:		ports/67252
Submitted by:	Cyril Guibourg <aragorn+ports@teaser.fr>
This commit is contained in:
Pav Lucistnik 2004-05-27 21:12:08 +00:00
parent fb552ecb61
commit b1770230b2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=110144
13 changed files with 247 additions and 0 deletions

View file

@ -179,6 +179,7 @@
SUBDIR += mew3
SUBDIR += mew3-emacs20
SUBDIR += mew3-xemacs21-mule
SUBDIR += milter-greylist
SUBDIR += milter-regex
SUBDIR += milter-sender
SUBDIR += mimedefang

View file

@ -0,0 +1,46 @@
# New ports collection makefile for: milter-greylist
# Date created: 27 Apr 2004
# Whom: Cyril Guibourg
#
# $FreeBSD$
#
PORTNAME= milter-greylist
PORTVERSION= 1.2.2
CATEGORIES= mail
MASTER_SITES= ftp://ftp.espci.fr/pub/milter-greylist/
EXTRACT_SUFX= .tgz
MAINTAINER= aragorn+ports@teaser.fr
COMMENT= Easy-to-use greylist milter for sendmail
MAN5= greylist.conf.5
MAN8= milter-greylist.8
GNU_CONFIGURE= yes
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ARGS+= --with-user=smmsp
ALL_TARGET= milter-greylist
USE_RC_SUBR= yes
RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
post-extract:
@${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${FILESDIR}/milter-greylist.sh > ${WRKSRC}/milter-greylist.sh
post-install:
${MKDIR} /var/milter-greylist /var/db/milter-greylist
${CHOWN} smmsp /var/milter-greylist /var/db/milter-greylist
${MKDIR} ${PREFIX}/etc/rc.d
${INSTALL_SCRIPT} ${WRKSRC}/milter-greylist.sh ${PREFIX}/etc/rc.d/
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
${MKDIR} ${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/greylist.conf ${EXAMPLESDIR}
.endif
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>

View file

@ -0,0 +1,2 @@
MD5 (milter-greylist-1.2.2.tgz) = 7c313a482cec2b4e406eefe121c1e5e7
SIZE (milter-greylist-1.2.2.tgz) = 88297

View file

@ -0,0 +1,32 @@
#!/bin/sh
# $FreeBSD$
# PROVIDE: miltergreylist
# REQUIRE: LOGIN
# BEFORE: sendmail
# KEYWORD: milter-greylist
# Define these miltergreylist_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.miltergreylist
# /etc/rc.conf.d/miltergreylist
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
miltergreylist_enable="NO"
miltergreylist_runas="smmsp"
miltergreylist_pidfile="/var/run/milter-greylist.pid"
miltergreylist_sockfile="/var/milter-greylist/milter-greylist.sock"
miltergreylist_cfgfile="%%PREFIX%%/etc/mail/greylist.conf"
miltergreylist_flags="-P $miltergreylist_pidfile -f $miltergreylist_cfgfile
-p $miltergreylist_sockfile -u $miltergreylist_runas"
. %%RC_SUBR%%
name="miltergreylist"
rcvar=`set_rcvar`
command="%%PREFIX%%/bin/milter-greylist"
load_rc_config $name
run_rc_command "$1"

View file

@ -0,0 +1,32 @@
#!/bin/sh
# $FreeBSD$
# PROVIDE: miltergreylist
# REQUIRE: LOGIN
# BEFORE: sendmail
# KEYWORD: milter-greylist
# Define these miltergreylist_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.miltergreylist
# /etc/rc.conf.d/miltergreylist
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
miltergreylist_enable="NO"
miltergreylist_runas="smmsp"
miltergreylist_pidfile="/var/run/milter-greylist.pid"
miltergreylist_sockfile="/var/milter-greylist/milter-greylist.sock"
miltergreylist_cfgfile="%%PREFIX%%/etc/mail/greylist.conf"
miltergreylist_flags="-P $miltergreylist_pidfile -f $miltergreylist_cfgfile
-p $miltergreylist_sockfile -u $miltergreylist_runas"
. %%RC_SUBR%%
name="miltergreylist"
rcvar=`set_rcvar`
command="%%PREFIX%%/bin/milter-greylist"
load_rc_config $name
run_rc_command "$1"

View file

@ -0,0 +1,57 @@
--- Makefile.in.orig Sat Apr 3 11:26:11 2004
+++ Makefile.in Tue May 25 23:04:47 2004
@@ -29,9 +29,9 @@
# OF THE POSSIBILITY OF SUCH DAMAGE.
#
-CFLAGS= @CFLAGS@ -D_BSD_SOURCE -Wall -ansi
-LDFLAGS= @LDFLAGS@
-LIBS= @LIBS@
+CFLAGS= @CFLAGS@ -D_BSD_SOURCE -Wall -ansi -pthread
+LDFLAGS= @LDFLAGS@ -pthread
+LIBS= -lmilter
prefix= @prefix@
exec_prefix= @exec_prefix@
SYSCONFDIR= @sysconfdir@
@@ -66,34 +66,20 @@
dump_yacc.o: dump_yacc.c dump_lex.c
rc-bsd.sh: rc-bsd.sh.in
- ${SED} "s|@BINDIR@|${BINDIR}|g" rc-bsd.sh.in > rc-bsd.sh
+ ${SED} -e "s|@BINDIR@|${BINDIR}|g" \
+ -e "s|@SYSCONFDIR@|${SYSCONFDIR}|g" rc-bsd.sh.in > rc-bsd.sh
rc-linux.sh: rc-linux.sh.in
${SED} "s|@BINDIR@|${BINDIR}|g" rc-linux.sh.in > rc-linux.sh
install: milter-greylist
- ${INSTALL} -d 755 ${BINDIR}
- ${INSTALL} -d 755 ${MANDIR}/man8
- ${INSTALL} -d 755 ${MANDIR}/man5
+ ${INSTALL} -d -m 755 ${BINDIR}
+ ${INSTALL} -d -m 755 ${SYSCONFDIR}/mail
+ ${INSTALL} -d -m 755 ${MANDIR}/man8
+ ${INSTALL} -d -m 755 ${MANDIR}/man5
${INSTALL} -m 755 milter-greylist ${BINDIR}
${INSTALL} -m 644 milter-greylist.8 ${MANDIR}/man8
${INSTALL} -m 644 greylist.conf.5 ${MANDIR}/man5
- ${TEST} -f /etc/mail/greylist.conf -o -f /etc/mail/greylist.except || \
- ${INSTALL} -m 644 greylist.conf /etc/mail
- ${INSTALL} -d -m 755 -o ${USER} /var/milter-greylist
- @${TEST} -f /var/db/greylist.db && ( \
- echo " ================================================"; \
- echo " WARNING: the dump file location has changed, "; \
- echo " Please move /var/db/greylist.db, the default "; \
- echo " location is now in /var/milter-greylist/ "; \
- echo " ================================================"; \
- ) || ${TRUE}
- @${TEST} -f /etc/mail/greylist.except && ( \
- echo " ================================================"; \
- echo " WARNING: the config file name has changed, "; \
- echo " Please rename /etc/mail/greylist.except, the "; \
- echo " default name is now in /etc/mail/greylist.conf "; \
- echo " ================================================"; \
- ) || ${TRUE}
+ ${INSTALL} -m 644 greylist.conf ${SYSCONFDIR}/mail/greylist.conf.sample
depend:
${MKDEP} ${CFLAGS} ${SRC}

View file

@ -0,0 +1,10 @@
--- dump.c.orig Wed Mar 31 19:02:08 2004
+++ dump.c Thu Apr 29 15:12:53 2004
@@ -53,6 +53,7 @@
#include <sysexits.h>
#include <syslog.h>
#include <time.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/param.h>

View file

@ -0,0 +1,11 @@
--- dump.h.orig Thu May 6 15:54:01 2004
+++ dump.h Tue May 25 22:48:33 2004
@@ -46,7 +46,7 @@
#include <arpa/inet.h>
#ifndef DUMPFILE
-#define DUMPFILE "/var/milter-greylist/greylist.db"
+#define DUMPFILE "/var/db/milter-greylist/greylist.db"
#endif
#define DATELEN 40

View file

@ -0,0 +1,12 @@
--- spf.c.orig Wed Apr 14 10:46:14 2004
+++ spf.c Thu Apr 29 15:19:01 2004
@@ -45,8 +45,8 @@
#include <syslog.h>
#include <sys/types.h>
#include <sys/socket.h>
-#include <arpa/inet.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
#include "conf.h"
#include "spf.h"

View file

@ -0,0 +1,10 @@
===> IMPORTANT NOTE
A sample configuration file has been installed in ${PREFIX}/etc/mail
directory. Copy and edit it to suit your needs before launching
milter-greylist.
To run milter-greylist from startup, add miltergreylist_enable="YES"
in your /etc/rc.conf or your /etc/rc.conf.local
See ${DOCSDIR}/README for operation details.

View file

@ -0,0 +1,11 @@
This is a port of Emmanuel Dreyfus' milter-greylist.
Grey listing is a wonderful spam filtering technique, which uses a behavior
trick: spammers never resend a message when they get a temporary error,
whereas real MTA do. The idea is to refuse any mail on first attempt, and
accept it after some time has elapsed.
milter-greylist is a stand-alone milter written in C that implement grey
listing.
WWW: http://hcpnet.free.fr/milter-greylist/

View file

@ -0,0 +1,10 @@
===> IMPORTANT NOTE
A sample configuration file has been installed in ${PREFIX}/etc/mail
directory. Copy and edit it to suit your needs before launching
milter-greylist.
To run milter-greylist from startup, add miltergreylist_enable="YES"
in your /etc/rc.conf or your /etc/rc.conf.local
See ${DOCSDIR}/README for operation details.

View file

@ -0,0 +1,13 @@
bin/milter-greylist
etc/mail/greylist.conf.sample
etc/rc.d/milter-greylist.sh
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%EXAMPLESDIR%%/greylist.conf
@exec /bin/mkdir -p /var/milter-greylist
@exec /bin/mkdir -p /var/db/milter-greylist
@exec /usr/sbin/chown smmsp /var/milter-greylist /var/db/milter-greylist
%%PORTDOCS%%@dirrm %%DOCSDIR%%
%%PORTDOCS%%@dirrm %%EXAMPLESDIR%%
@dirrm etc/mail
@unexec /bin/rmdir /var/milter-greylist 2>/dev/null || true
@unexec [ -f /var/db/milter-greylist/greylist.db ] || /bin/rmdir /var/db/milter-greylist || true