From yds@CoolRat.org  Wed Nov  8 03:26:51 2006
Return-Path: <yds@CoolRat.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 1AFBB16A40F;
	Wed,  8 Nov 2006 03:26:51 +0000 (UTC)
	(envelope-from yds@CoolRat.org)
Received: from CoolRat.org (c-68-83-224-175.hsd1.nj.comcast.net [68.83.224.175])
	by mx1.FreeBSD.org (Postfix) with ESMTP id DFC5343D66;
	Wed,  8 Nov 2006 03:26:44 +0000 (GMT)
	(envelope-from yds@CoolRat.org)
Received: from localhost (localhost [127.0.0.1])
  (uid 1001)
  by CoolRat.org with local; Tue, 07 Nov 2006 22:26:44 -0500
  id 003D7DDE.45514E74.000132A3
Message-Id: <courier.45514E74.000132A3@CoolRat.org>
Date: Tue, 07 Nov 2006 22:26:44 -0500
From: Yarema <yds@CoolRat.org>
Reply-To: Yarema <yds@CoolRat.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: delphij@FreeBSD.org
Subject: [UPDATE] mail/spamd - improvements and clean up
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         105277
>Category:       ports
>Synopsis:       [UPDATE] mail/spamd - improvements and clean up
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 08 03:30:18 GMT 2006
>Closed-Date:    Fri Apr 20 23:01:02 GMT 2007
>Last-Modified:  Sun Jun  3 17:00:10 GMT 2007
>Originator:     Yarema
>Release:        FreeBSD 6.2-PRERELEASE i386
>Organization:
NYCBUG.org
>Environment:
System:  FreeBSD 6.2-PRERELEASE #0: Sat Nov 4 05:14:48 EST 2006 i386

>Description:

New files to be imported:
	files/pfspamlogd.sh.in
	files/greyscanner.sh.in

rcorder(8) settings changed in the startup scripts so that spamd(8),
and now spamlogd(8), start sooner.  This helps catch some spam which
otherwise slips through when running spamd(8) on an edge server/firewall
and the real SMTP server on a different box behind it.

Modifed files/pfspamd.sh.in to backgroud spamd-setup(8).  Speeds up
booting significantly.  There's no reason to have to wait for
spamd-setup(8) to finish before moving on.

When WITH_IPFW defined do not install spamlogd(8) or the new pfspamlogd.sh
RCng script since it only works with pflog(4).

New option WITH_GREYSCANNER to install Bob Beck's <beck@OpenBSD.org>
prototype greytrapping daemon presented at the NYC BSD Conference.
And an accompanying RCng script.
http://www.ualberta.ca/~beck/nycbug06/spamd/mgp00016.html

Add greyscanner to ${IGNOREFILES} for now so the port checksums and
revision don't need to be bumped as Bob works on the prototype.

Instead of ${PREFIX}/etc/spamd.conf.sample install into ${EXAMPLESDIR} as
per hier(7).  Then also install as ${PREFIX}/etc/spamd.conf unless there's
a modified copy there.  Don't uninstall the modified version.

Same goes for the ${PREFIX}/libexec/greyscanner since it needs to be edited
because there is no seperate config for it yet.

Tarball of updated port available at http://yds.CoolRat.org/freebsd/spamd.tbz

>How-To-Repeat:
	cd /usr/ports/mail/spamd && make install

>Fix:
diff -u -ruN spamd~/Makefile spamd/Makefile
--- spamd~/Makefile	Thu May 11 06:55:48 2006
+++ spamd/Makefile	Tue Nov  7 21:10:15 2006
@@ -7,42 +7,80 @@
 
 PORTNAME=	spamd
 PORTVERSION=	3.7
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	mail
 MASTER_SITES=	${MASTER_SITE_LOCAL}
 MASTER_SITE_SUBDIR=	delphij
 DISTNAME=	${PORTNAME}_${PORTVERSION}
+DISTFILES=	${DISTNAME}${EXTRACT_SUFX}
+EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX}
 
 MAINTAINER=	delphij@FreeBSD.org
-COMMENT=	Traps spammers with a very slow smtp-login and return 4xx error
+COMMENT=	Traps spammers with a very slow smtp-login and returns 4xx error
 
 USE_BZIP2=	yes
 
+.if !defined(BATCH) && !defined(PACKAGE_BUILDING)
+IS_INTERACTIVE=	yes
+.endif
+
 .include <bsd.port.pre.mk>
 
+USE_RC_SUBR=	pfspamd.sh
+
 .if defined(WITH_IPFW)
-CFLAGS+= -DIPFW
 .if ${OSVERSION} < 490000
 BROKEN=		IPFW with Tables is required for this port to function properly
 .endif
+CFLAGS+= -DIPFW
+PLIST_SUB+=	PFLOG="@comment "
 .else
 .if ${OSVERSION} < 502117
 BROKEN=		OpenBSD 3.5 pf/pfctl is necessary for this port to function properly.
 .else
+USE_RC_SUBR+=	pfspamlogd.sh
+PLIST_SUB+=	PFLOG=""
 LOCAL_PFCTL=	/sbin/pfctl
 .endif
 .endif
 
-USE_RC_SUBR=	pfspamd.sh
-
-.if !defined(BATCH) && !defined(PACKAGE_BUILDING)
-IS_INTERACTIVE=	yes
+.if defined(WITH_GREYSCANNER)
+MASTER_SITES+=	http://www.ualberta.ca/~beck/
+DISTFILES+=	greyscanner
+IGNOREFILES=	greyscanner
+RUN_DEPENDS=	${SITE_PERL}/Email/Valid.pm:${PORTSDIR}/mail/p5-Email-Valid
+USE_RC_SUBR+=	greyscanner.sh
+SUB_LIST=	PERL=${PERL}
+USE_PERL5=	yes
+PLIST_SUB+=	TRAPPER=""
+.else
+PLIST_SUB+=	TRAPPER="@comment "
 .endif
 
 MAN5=		spamd.conf.5
-MAN8=		spamd.8 spamd-setup.8 spamdb.8 spamlogd.8
+MAN8=		spamd.8 spamd-setup.8 spamdb.8
+.if !defined(WITH_IPFW)
+MAN8+=		spamlogd.8
+.endif
 
-SAMPLE_SPAMD_CONF=	${PREFIX}/etc/spamd.conf.sample
+INSTALL_DIR?=	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 -d
+
+pre-everything::
+.if !defined(WITH_IPFW)
+	@${ECHO_MSG}
+	@${ECHO_MSG} "Define WITH_IPFW to build with support for ipfw(4)"
+	@${ECHO_MSG}
+	@${ECHO_MSG} "Note:	spamlogd(8) requires pflog(4), unsupported"
+	@${ECHO_MSG} "	in ipfw(4) mode and will not be installed."
+	@${ECHO_MSG}
+.endif
+.if !defined(WITH_GREYSCANNER)
+	@${ECHO_MSG}
+	@${ECHO_MSG} "Define WITH_GREYSCANNER to install experimental"
+	@${ECHO_MSG} "spamdb scanner which flags excessively spammish"
+	@${ECHO_MSG} "GREY entries as TRAPPED for the next 24 hours."
+	@${ECHO_MSG}
+.endif
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|%%LOCAL_PFCTL%%|${LOCAL_PFCTL}|;	\
@@ -50,6 +88,10 @@
 	    ${WRKSRC}/spamd-setup/spamd-setup.c
 	@${REINPLACE_CMD} -e 's|/etc/spamd.conf|${PREFIX}/etc/spamd.conf|' \
 	    ${WRKSRC}/spamd/spamd.8 ${WRKSRC}/spamd-setup/spamd-setup.8
+.if defined(WITH_GREYSCANNER)
+	@${SED} -e 's|/usr/bin/perl|${PERL}|'	\
+	    ${DISTDIR}/greyscanner > ${WRKSRC}/greyscanner
+.endif
 
 pre-su-install:
 .if !defined(BATCH) && !defined(PACKAGE_BUILDING)
@@ -58,18 +100,24 @@
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/spamd/spamd ${PREFIX}/libexec
+.if !defined(WITH_IPFW)
 	${INSTALL_PROGRAM} ${WRKSRC}/spamlogd/spamlogd ${PREFIX}/libexec
+.endif
 	${INSTALL_PROGRAM} ${WRKSRC}/spamd-setup/spamd-setup ${PREFIX}/sbin
 	${INSTALL_PROGRAM} ${WRKSRC}/spamdb/spamdb ${PREFIX}/sbin
 	${INSTALL_MAN} ${WRKSRC}/doc/spamd.conf.5 ${PREFIX}/man/man5
 	${INSTALL_MAN} ${WRKSRC}/spamd/spamd.8 ${PREFIX}/man/man8
 	${INSTALL_MAN} ${WRKSRC}/spamd-setup/spamd-setup.8 ${PREFIX}/man/man8
 	${INSTALL_MAN} ${WRKSRC}/spamdb/spamdb.8 ${PREFIX}/man/man8
+.if !defined(WITH_IPFW)
 	${INSTALL_MAN} ${WRKSRC}/spamlogd/spamlogd.8 ${PREFIX}/man/man8
-	@if [ ! -f ${SAMPLE_SPAMD_CONF} ]; then			\
-		${ECHO_MSG} "Installing ${SAMPLE_SPAMD_CONF} file."; \
-		${INSTALL_DATA} ${WRKSRC}/doc/spamd.conf	\
-		${SAMPLE_SPAMD_CONF};				\
-	fi
+.endif
+	${INSTALL_DIR} ${EXAMPLESDIR}
+	${INSTALL_DATA} ${WRKSRC}/doc/spamd.conf ${EXAMPLESDIR}
+	[ -f ${PREFIX}/etc/spamd.conf ] || ${INSTALL_DATA} ${WRKSRC}/doc/spamd.conf ${PREFIX}/etc
+.if defined(WITH_GREYSCANNER)
+	${INSTALL_SCRIPT} ${WRKSRC}/greyscanner ${EXAMPLESDIR}
+	[ -f ${PREFIX}/libexec/greyscanner ] || ${INSTALL_SCRIPT} ${WRKSRC}/greyscanner ${PREFIX}/libexec
+.endif
 
 .include <bsd.port.post.mk>
diff -u -ruN spamd~/distinfo spamd/distinfo
--- spamd~/distinfo	Mon Jan 23 03:37:18 2006
+++ spamd/distinfo	Tue Nov  7 20:54:03 2006
@@ -1,3 +1,5 @@
 MD5 (spamd_3.7.tar.bz2) = e1d96b9d7b1d4189dca510ff0000383f
 SHA256 (spamd_3.7.tar.bz2) = a06ad07ead38240f13ea01c5d0315179e7089ed8fb8fe6544b1860bd8cfdc355
 SIZE (spamd_3.7.tar.bz2) = 28066
+MD5 (greyscanner) = IGNORE
+SHA256 (greyscanner) = IGNORE
diff -u -ruN spamd~/files/greyscanner.sh.in spamd/files/greyscanner.sh.in
--- spamd~/files/greyscanner.sh.in	Wed Dec 31 19:00:00 1969
+++ spamd/files/greyscanner.sh.in	Tue Nov  7 19:28:24 2006
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# $FreeBSD: $
+#
+
+# PROVIDE: greyscanner
+# REQUIRE: LOGIN pfspamd
+# KEYWORD: shutdown
+
+#
+# Define these greyscanner_* variables in one of these files:
+#       /etc/rc.conf
+#       /etc/rc.conf.local
+#       /etc/rc.conf.d/greyscanner
+#
+# greyscanner_enable="YES"	# Run the greyscanner daemon (YES/NO).
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+greyscanner_enable=${greyscanner_enable:-"NO"}
+
+. %%RC_SUBR%%
+
+name="greyscanner"
+rcvar=`set_rcvar`
+
+command="%%PREFIX%%/libexec/${name}"
+command_interpreter="%%PERL%%"
+
+stop_cmd="greyscanner_stop"
+
+greyscanner_stop()
+{
+	pids=`check_process ${command} ${command_interpreter}`
+	if [ -z "${pids}" ]; then
+		echo "${name} not running?"
+	else
+		echo "Stopping ${name}."
+		kill ${sig_stop} ${pids}
+		wait_for_pids ${pids}
+	fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff -u -ruN spamd~/files/pfspamd.sh.in spamd/files/pfspamd.sh.in
--- spamd~/files/pfspamd.sh.in	Tue May  2 04:54:50 2006
+++ spamd/files/pfspamd.sh.in	Tue Nov  7 11:15:45 2006
@@ -4,16 +4,23 @@
 #
 
 # PROVIDE: pfspamd
-# REQUIRE: NETWORKING
-# BEFORE:  mail
+# REQUIRE: NETWORKING SERVERS
+# BEFORE:  DAEMON
 # KEYWORD: shutdown
 
 #
-# Add the following lines to /etc/rc.conf to enable spamd:
-# pfspamd_enable (bool):	Set to "NO" by default.
-#				Set it to "YES" to enable spamd
-# pfspamd_flags (str):		Set to "" by default.
-#				Extra flags passed to start command.
+# Define these pfspamd_* variables in one of these files:
+#       /etc/rc.conf
+#       /etc/rc.conf.local
+#       /etc/rc.conf.d/pfspamd
+#
+# pfspamd_enable="YES"			# Run the spamd(8) daemon (YES/NO).
+# pfspamd_flags="-g -r 451 -w 1"	# Extra flags for spamd(8) (if enabled).
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+pfspamd_enable=${pfspamd_enable:-"NO"}
+pfspamd_flags=${pfspamd_flags:-"-r 451 -w 1"}
 
 . %%RC_SUBR%%
 
@@ -24,16 +31,12 @@
 start_postcmd="pfspamd_postcmd"
 restart_postcmd="pfspamd_postcmd"
 
-[ -z "$pfspamd_enable" ]	&& pfspamd_enable="NO"
-[ -z "$pfspamd_flags" ]		&& pfspamd_flags=""
-
-load_rc_config $name
-
 pfspamd_postcmd() 
 {
 	if [ -x %%PREFIX%%/sbin/spamd-setup ]; then
-		%%PREFIX%%/sbin/spamd-setup
+		%%PREFIX%%/sbin/spamd-setup &
 	fi
 }
 
+load_rc_config $name
 run_rc_command "$1"
diff -u -ruN spamd~/files/pfspamlogd.sh.in spamd/files/pfspamlogd.sh.in
--- spamd~/files/pfspamlogd.sh.in	Wed Dec 31 19:00:00 1969
+++ spamd/files/pfspamlogd.sh.in	Tue Nov  7 11:13:42 2006
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# $FreeBSD:  $
+#
+
+# PROVIDE: pfspamlogd
+# REQUIRE: NETWORKING SERVERS pfspamd
+# BEFORE:  DAEMON
+# KEYWORD: shutdown
+
+#
+# Define these pfspamlogd_* variables in one of these files:
+#       /etc/rc.conf
+#       /etc/rc.conf.local
+#       /etc/rc.conf.d/pfspamlogd
+#
+# pfspamlogd_enable="YES"	# Run the spamlogd(8) daemon (YES/NO).
+# pfspamlogd_flags=""		# Extra flags for spamlogd(8) (if enabled).
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+pfspamlogd_enable=${pfspamlogd_enable:-"NO"}
+pfspamlogd_flags=${pfspamlogd_flags:-""}
+
+. %%RC_SUBR%%
+
+name="pfspamlogd"
+rcvar=`set_rcvar`
+
+command="%%PREFIX%%/libexec/spamlogd"
+
+load_rc_config $name
+run_rc_command "$1"
diff -u -ruN spamd~/pkg-descr spamd/pkg-descr
--- spamd~/pkg-descr	Mon Sep 29 19:01:21 2003
+++ spamd/pkg-descr	Tue Nov  7 19:31:54 2006
@@ -12,6 +12,6 @@
 delay his entire queue handling for several minutes each time he connects to
 the tarpit. And many spammers use badly configured open relays
 
-WWW: http://www.benzedrine.cx/relaydb.html
+WWW: http://www.OpenBSD.org/spamd/
 
 -Max <max@love2party.net>
diff -u -ruN spamd~/pkg-plist spamd/pkg-plist
--- spamd~/pkg-plist	Wed May  3 03:31:44 2006
+++ spamd/pkg-plist	Tue Nov  7 18:33:03 2006
@@ -1,5 +1,11 @@
 libexec/spamd
-libexec/spamlogd
+%%PFLOG%%libexec/spamlogd
 sbin/spamd-setup
 sbin/spamdb
-etc/spamd.conf.sample
+@unexec if cmp -s %D/etc/spamd.conf %D/%%EXAMPLESDIR%%/spamd.conf; then rm -f %D/etc/spamd.conf; fi
+%%EXAMPLESDIR%%/spamd.conf
+@exec [ -f %D/etc/spamd.conf ] || cp %D/%%EXAMPLESDIR%%/spamd.conf %D/etc/spamd.conf
+%%TRAPPER%%@unexec if cmp -s %D/libexec/greyscanner %D/%%EXAMPLESDIR%%/greyscanner; then rm -f %D/libexec/greyscanner; fi
+%%TRAPPER%%%%EXAMPLESDIR%%/greyscanner
+%%TRAPPER%%@exec [ -f %D/libexec/greyscanner ] || cp %D/%%EXAMPLESDIR%%/greyscanner %D/libexec/greyscanner
+@dirrm %%EXAMPLESDIR%%
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->delphij 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Nov 8 03:30:31 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=105277 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/105277: commit references a PR
Date: Wed,  8 Nov 2006 04:04:02 +0000 (UTC)

 delphij     2006-11-08 04:03:20 UTC
 
   FreeBSD ports repository
 
   Modified files:
     mail/spamd           pkg-descr 
   Log:
   Use official OpenBSD spamd website as URL.
   
   Submitted by:   Yarema <yds CoolRat org>
   PR:             ports/105277 (1/many)
   
   Revision  Changes    Path
   1.2       +1 -1      ports/mail/spamd/pkg-descr
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: Janos Mohacsi <mohacsi@niif.hu>
To: bug-followup@FreeBSD.org, yds@CoolRat.org
Cc: delphij@FreeBSD.org
Subject: Re: ports/105277: [UPDATE] mail/spamd - improvements and clean up
Date: Tue, 13 Feb 2007 18:01:13 +0100

 This patch should be approved - might be with some clean up. The pfspamd 
 with greylisting does not work without
 
 pfspamlogd enabled.
 Thanks 
 	Janos Mohacsi 
 
 
 
State-Changed-From-To: open->feedback 
State-Changed-By: delphij 
State-Changed-When: Tue Feb 13 17:20:40 UTC 2007 
State-Changed-Why:  
Dear submitter, 

My reply from my e-mail server at 210.51.165.229 was bounced 
as UBE.  Please let me know if that was resolved.  Your points 
are taken, but in order to act further I have to be able to 
communicate with you. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=105277 
Responsible-Changed-From-To: delphij->freebsd-ports 
Responsible-Changed-By: delphij 
Responsible-Changed-When: Tue Mar 20 14:16:31 UTC 2007 
Responsible-Changed-Why:  
Return to pool. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=105277 
State-Changed-From-To: feedback->closed 
State-Changed-By: miwi 
State-Changed-When: Fri Apr 20 22:59:05 UTC 2007 
State-Changed-Why:  
Patch is already applied from delphij@. 

I think he forget to close the pr. Thanks for you submission. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=105277 

From: Janos Mohacsi <mohacsi@niif.hu>
To: bug-followup@FreeBSD.org, yds@CoolRat.org
Cc: samm@os2.kiev.ua, delhij@freebsd.org
Subject: Re: ports/105277: [UPDATE] mail/spamd - improvements and clean up
Date: Fri, 01 Jun 2007 08:53:52 +0200

 I don't see the greylisting support added in the latest 
 mail/spamd-3.7_3. Can you revise the port or should I send a separate patch?
 Regards,
     Janos Mohacsi

From: Yarema <yds@CoolRat.org>
To: Janos Mohacsi <mohacsi@niif.hu>, bug-followup@FreeBSD.org
Cc: samm@os2.kiev.ua, delhij@freebsd.org
Subject: Re: ports/105277: [UPDATE] mail/spamd - improvements and clean up
Date: Fri, 01 Jun 2007 11:14:00 -0400

 --On Friday, June 01, 2007 8:53 AM +0200 Janos Mohacsi <mohacsi@niif.hu> 
 wrote:
 
 > I don't see the greylisting support added in the latest mail/spamd-3.7_3.
 > Can you revise the port or should I send a separate patch?
 > Regards,
 >     Janos Mohacsi
 
 Seems to me this PR was closed without applying the patch I submitted way 
 back when.  In any case OpenBSD 4.1 is out with official greylisting 
 support rather than Bob Beck's preview variant I submitted.  Perhaps it's 
 time to revisit updating this port to 4.1 rather than 4.0 as the last PR 
 did.  I've made some improvements to the port since so I'll see about 
 rolling another update.
 
 -- 
 Yarema

From: Alex Samorukov <samm@os2.kiev.ua>
To: Yarema <yds@CoolRat.org>
Cc: Janos Mohacsi <mohacsi@niif.hu>,  bug-followup@FreeBSD.org, 
 delhij@freebsd.org
Subject: Re: ports/105277: [UPDATE] mail/spamd - improvements and clean up
Date: Sun, 03 Jun 2007 19:28:05 +0300

 Yarema wrote:
 > --On Friday, June 01, 2007 8:53 AM +0200 Janos Mohacsi 
 > <mohacsi@niif.hu> wrote:
 >
 >> I don't see the greylisting support added in the latest 
 >> mail/spamd-3.7_3.
 >> Can you revise the port or should I send a separate patch?
 >> Regards,
 >>     Janos Mohacsi
 >
 > Seems to me this PR was closed without applying the patch I submitted 
 > way back when.  In any case OpenBSD 4.1 is out with official 
 > greylisting support rather than Bob Beck's preview variant I 
 > submitted.  Perhaps it's time to revisit updating this port to 4.1 
 > rather than 4.0 as the last PR did.  I've made some improvements to 
 > the port since so I'll see about rolling another update.
 Please look into http://www.freebsd.org/cgi/query-pr.cgi?pr=113293
 I hope this one will be submitted soon, so please make all your PR`s 
 based on it.
 
 Also, there is a home of the project on the berlios web site, 
 http://freebsdspamd.berlios.de
 Feel free to use bugreport system or svn to make a patches.
 
 -- 
 Best regards,
 Alex Samorukov, SAMM1-RIPE
 Zend Certified PHP Engineer
 
>Unformatted:
