From sa2c@sa2c.net  Sun Jun  3 00:03:51 2007
Return-Path: <sa2c@sa2c.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 13BD616A47D
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  3 Jun 2007 00:03:51 +0000 (UTC)
	(envelope-from sa2c@sa2c.net)
Received: from sakura.and.or.jp (sakura.and.or.jp [59.106.20.85])
	by mx1.freebsd.org (Postfix) with ESMTP id CBA7713C44C
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  3 Jun 2007 00:01:05 +0000 (UTC)
	(envelope-from sa2c@sa2c.net)
Received: from sakura.and.or.jp (localhost [127.0.0.1])
	by sakura.and.or.jp (Postfix) with ESMTP id 0E85661C34
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  3 Jun 2007 09:01:04 +0900 (JST)
Received: from berkeley.l.sa2c.net (berkeley.vpn.and.or.jp [10.46.49.3])
	by sakura.and.or.jp (Postfix) with ESMTP id E398B61C2D
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  3 Jun 2007 09:01:03 +0900 (JST)
Received: by berkeley.l.sa2c.net (Postfix, from userid 3104)
	id DA2F640EA; Sun,  3 Jun 2007 09:01:03 +0900 (JST)
Message-Id: <20070603000103.DA2F640EA@berkeley.l.sa2c.net>
Date: Sun,  3 Jun 2007 09:01:03 +0900 (JST)
From: NIIMI Satoshi <sa2c@sa2c.net>
Reply-To: NIIMI Satoshi <sa2c@sa2c.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: mail/p5-Mail-SpamAssassin: periodic script to update rules 
X-Send-Pr-Version: 3.113
X-GNATS-Notify: scheidell@secnap.net

>Number:         113270
>Category:       ports
>Synopsis:       mail/p5-Mail-SpamAssassin: periodic script to update rules
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    clsung
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 03 00:10:04 GMT 2007
>Closed-Date:    Wed Jun 06 01:30:47 GMT 2007
>Last-Modified:  Wed Jun 06 01:30:47 GMT 2007
>Originator:     NIIMI Satoshi
>Release:        FreeBSD 6.2-RELEASE-p5 i386
>Organization:
>Environment:
System: FreeBSD berkeley.l.sa2c.net 6.2-RELEASE-p5 FreeBSD 6.2-RELEASE-p5 #1: Thu May 24 05:05:36 JST 2007 root@berkeley.l.sa2c.net:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:
This PR adds a daily periodic script to run "sa-update" to fetch updated
rules.  (disabled by default)

This PR also adds a reload command to rc script so that updated rules
are reloaded gracefully.

	
>How-To-Repeat:
	
>Fix:
Please note to run "cvs add files/350.sa-update.in" before commit.

	

--- sa.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/mail/p5-Mail-SpamAssassin/Makefile,v
retrieving revision 1.106
diff -u -r1.106 Makefile
--- Makefile	2 Jun 2007 07:09:46 -0000	1.106
+++ Makefile	2 Jun 2007 23:41:05 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	Mail-SpamAssassin
 PORTVERSION=	3.2.0
+PORTREVISION=	1
 CATEGORIES=	mail perl5
 MASTER_SITES=	${MASTER_SITE_APACHE:S/$/:apache/} ${MASTER_SITE_PERL_CPAN:S/$/:cpan/}
 MASTER_SITE_SUBDIR=	spamassassin/source/:apache Mail/:cpan
@@ -47,6 +48,8 @@
 		SPF_QUERY "Add SPF query support" off \
 		RELAY_COUNTRY "Relay country support" off
 
+SUB_FILES=	350.sa-update
+
 .include <bsd.port.pre.mk>
 
 .if defined (WITH_SPAMC)
@@ -237,6 +240,9 @@
 	@[ -f ${PREFIX}/etc/mail/spamassassin/v320.pre ] || \
 		${CP} ${PREFIX}/etc/mail/spamassassin/v320.pre.sample \
 			${PREFIX}/etc/mail/spamassassin/v320.pre
+	@${MKDIR} ${PREFIX}/etc/periodic/daily
+	@${INSTALL_SCRIPT} ${WRKDIR}/350.sa-update \
+			${PREFIX}/etc/periodic/daily/350.sa-update
 
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR} ${DOCSDIR}/sql ${DOCSDIR}/ldap
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/mail/p5-Mail-SpamAssassin/pkg-plist,v
retrieving revision 1.38
diff -u -r1.38 pkg-plist
--- pkg-plist	2 Jun 2007 07:09:46 -0000	1.38
+++ pkg-plist	2 Jun 2007 23:43:35 -0000
@@ -20,6 +20,7 @@
 @unexec if cmp -s %B/v320.pre.sample %B/v320.pre; then rm -f %B/v320.pre; fi
 etc/mail/spamassassin/v320.pre.sample
 @exec [ -f %B/v320.pre ] || cp %B/%f %B/v320.pre
+etc/periodic/daily/350.sa-update
 %%SITE_PERL%%/Mail/SpamAssassin.pm
 %%SITE_PERL%%/Mail/SpamAssassin/AICache.pm
 %%SITE_PERL%%/Mail/SpamAssassin/ArchiveIterator.pm
@@ -181,6 +182,8 @@
 @dirrm %%SITE_PERL%%/Mail/SpamAssassin/Bayes
 @dirrm %%SITE_PERL%%/Mail/SpamAssassin
 @dirrmtry %%SITE_PERL%%/Mail
+@dirrmtry etc/periodic/daily
+@dirrmtry etc/periodic
 @dirrmtry etc/mail/spamassassin
 @dirrmtry etc/mail
 @dirrmtry /var/run/spamd
Index: files/350.sa-update.in
===================================================================
RCS file: files/350.sa-update.in
diff -N files/350.sa-update.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/350.sa-update.in	2 Jun 2007 23:12:14 -0000
@@ -0,0 +1,31 @@
+#! /bin/sh
+#
+# $FreeBSD$
+#
+# Update SpamAssassin rules.
+
+# If there is a global system configuration file, suck it in.
+#
+if [ -r /etc/defaults/periodic.conf ]
+then
+    . /etc/defaults/periodic.conf
+    source_periodic_confs
+fi
+
+rc=0
+case "$daily_sa_update_enable" in
+    [Yy][Ee][Ss])
+	if [ ! -x %%PREFIX%%/bin/sa-update ]; then
+	    echo '$daily_sa_update_enable is set but sa-update does not exist'
+	    rc=2
+	else
+	    echo ''
+	    echo 'Updating SpamAssassin rules:'
+	    if %%PREFIX%%/bin/sa-update; then
+		%%PREFIX%%/etc/rc.d/sa-spamd reload || rc=1
+	    fi
+	fi
+	;;
+esac
+
+exit $rc
Index: files/sa-spamd.sh.in
===================================================================
RCS file: /home/ncvs/ports/mail/p5-Mail-SpamAssassin/files/sa-spamd.sh.in,v
retrieving revision 1.1
diff -u -r1.1 sa-spamd.sh.in
--- files/sa-spamd.sh.in	20 Mar 2006 13:03:33 -0000	1.1
+++ files/sa-spamd.sh.in	2 Jun 2007 22:27:35 -0000
@@ -31,6 +31,7 @@
 command=%%PREFIX%%/bin/spamd
 command_args="-d -r ${pidfile}"
 required_dirs=%%PREFIX%%/share/spamassassin
+extra_commands="reload"
 
 stop_postcmd=stop_postcmd
 
--- sa.diff ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Sun Jun 3 00:10:12 UTC 2007 
State-Changed-Why:  
Awaiting maintainers feedback 

http://www.freebsd.org/cgi/query-pr.cgi?pr=113270 
Responsible-Changed-From-To: freebsd-ports-bugs->clsung 
Responsible-Changed-By: clsung 
Responsible-Changed-When: Sun Jun 3 10:03:20 UTC 2007 
Responsible-Changed-Why:  
I'll take it. 

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

From: Michael Scheidell <scheidell@secnap.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/113270: mail/p5-Mail-SpamAssassin: periodic script to update
 rules
Date: Sun, 03 Jun 2007 07:38:10 -0400

 Edwin Groothuis wrote:
 > Maintainer of mail/p5-Mail-SpamAssassin,
 >
 > Please note that PR ports/113270 has just been submitted.
 >
 > If it contains a patch for an upgrade, an enhancement or a bug fix
 > you agree on, reply to this email stating that you approve the patch
 > and a committer will take care of it.
 >
 > The full text of the PR can be found at:
 >     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/113270
 >
 >   
 Not without a lot of QA on this and all localized non-standard enhancements.
 
 Enhancements like this should be kept local, don't need or interfere 
 with upgrades (for you) and don't need to be part of the core product.
 
 this is not a SpamAssassin Feature, increases complexity.
 _________________________________________________________________________
 This email has been scanned and certified safe by SpammerTrap(tm). 
 For Information please see http://www.spammertrap.com
 _________________________________________________________________________
State-Changed-From-To: feedback->closed 
State-Changed-By: clsung 
State-Changed-When: Mon Jun 4 07:55:04 UTC 2007 
State-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=113270 
State-Changed-From-To: closed->feedback 
State-Changed-By: clsung 
State-Changed-When: Mon Jun 4 07:55:44 UTC 2007 
State-Changed-Why:  
maintainer declined this PR. I'll trace for a period of time. 

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

From: NIIMI Satoshi <sa2c@sa2c.net>
To: bug-followup@FreeBSD.org, Michael Scheidell <scheidell@secnap.net>
Cc: Cheng-Lung Sung <clsung@FreeBSD.org>
Subject: Re: ports/113270: mail/p5-Mail-SpamAssassin: periodic script to update
 rules
Date: Mon, 04 Jun 2007 17:26:11 +0900

 > Not without a lot of QA on this and all localized non-standard enhancements.
 > 
 > Enhancements like this should be kept local, don't need or interfere
 > with upgrades (for you) and don't need to be part of the core product.
 > 
 > this is not a SpamAssassin Feature, increases complexity.
 
 Okay, I resign periodic script part of the PR.  But I think it's useful
 to have reload command on rc script.  Do you approve the following
 change for rc script?
 
 > Index: files/sa-spamd.sh.in
 > ===================================================================
 > RCS file: /home/ncvs/ports/mail/p5-Mail-SpamAssassin/files/sa-spamd.sh.in,v
 > retrieving revision 1.1
 > diff -u -r1.1 sa-spamd.sh.in
 > --- files/sa-spamd.sh.in 20 Mar 2006 13:03:33 -0000      1.1
 > +++ files/sa-spamd.sh.in 2 Jun 2007 22:27:35 -0000
 > @@ -31,6 +31,7 @@
 >  command=%%PREFIX%%/bin/spamd
 >  command_args="-d -r ${pidfile}"
 >  required_dirs=%%PREFIX%%/share/spamassassin
 > +extra_commands="reload"
 >  stop_postcmd=stop_postcmd
 
 -- 
 NIIMI Satoshi

From: "Michael Scheidell" <scheidell@secnap.net>
To: "NIIMI Satoshi" <sa2c@sa2c.net>,
	<bug-followup@FreeBSD.org>
Cc: "Cheng-Lung Sung" <clsung@FreeBSD.org>
Subject: RE: ports/113270: mail/p5-Mail-SpamAssassin: periodic script to update rules
Date: Mon, 4 Jun 2007 07:29:36 -0400

 I will QA this, and do have another minor PR to incorporate.  I will
 send maintainer update later today with both included.
 
 Keep in mind, if you do you OWN sa-update script, that you need to:
 1) account for proxy servers (if you need a proxy, that script will
 fail)
 2) account for chuser (should run as SA user)
 3) account for sa-compile (sa-compile has to be run after sa-update if
 there is an update)
 
 Others too numerous today, but I will look at rc scripts.
 
 Do you know if this rc script fails in the case of chrooted setup?
 Many times the environment is changed and not available to chrooted
 system.
 
 
 --=20
 Michael Scheidell, CTO
 SECNAP Network Security Corporation
 Keep up to date with latest information on IT security: Real time
 security alerts:
 http://www.secnap.com/news
 =20
 
 > -----Original Message-----
 > From: NIIMI Satoshi [mailto:sa2c@sa2c.net]=20
 > Sent: Monday, June 04, 2007 4:26 AM
 > To: bug-followup@FreeBSD.org; Michael Scheidell
 > Cc: Cheng-Lung Sung
 > Subject: Re: ports/113270: mail/p5-Mail-SpamAssassin:=20
 > periodic script to update rules
 >=20
 >=20
 > > Not without a lot of QA on this and all localized non-standard=20
 > > enhancements.
 > >=20
 > > Enhancements like this should be kept local, don't need or=20
 > interfere=20
 > > with upgrades (for you) and don't need to be part of the=20
 > core product.
 > >=20
 > > this is not a SpamAssassin Feature, increases complexity.
 >=20
 > Okay, I resign periodic script part of the PR.  But I think=20
 > it's useful to have reload command on rc script.  Do you=20
 > approve the following change for rc script?
 >=20
 > > Index: files/sa-spamd.sh.in=20
 > > =
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 > > RCS file:=20
 > > /home/ncvs/ports/mail/p5-Mail-SpamAssassin/files/sa-spamd.sh.in,v
 > > retrieving revision 1.1
 > > diff -u -r1.1 sa-spamd.sh.in
 > > --- files/sa-spamd.sh.in 20 Mar 2006 13:03:33 -0000      1.1
 > > +++ files/sa-spamd.sh.in 2 Jun 2007 22:27:35 -0000
 > > @@ -31,6 +31,7 @@
 > >  command=3D%%PREFIX%%/bin/spamd
 > >  command_args=3D"-d -r ${pidfile}" =20
 > > required_dirs=3D%%PREFIX%%/share/spamassassin
 > > +extra_commands=3D"reload"
 > >  stop_postcmd=3Dstop_postcmd
 >=20
 > --=20
 > NIIMI Satoshi
 >=20
 >=20
 _________________________________________________________________________
 This email has been scanned and certified safe by SpammerTrap(tm). 
 For Information please see http://www.spammertrap.com
 _________________________________________________________________________

From: Michael Scheidell <scheidell@secnap.net>
To: NIIMI Satoshi <sa2c@sa2c.net>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/113270: mail/p5-Mail-SpamAssassin: periodic script to update
 rules
Date: Mon, 04 Jun 2007 10:59:19 -0400

 This is a multi-part message in MIME format.
 --------------010906030804050805070107
 Content-Type: text/plain; charset=ISO-2022-JP
 Content-Transfer-Encoding: 7bit
 
 NIIMI Satoshi wrote:
 >> Not without a lot of QA on this and all localized non-standard enhancements.
 >>
 >> Enhancements like this should be kept local, don't need or interfere
 >> with upgrades (for you) and don't need to be part of the core product.
 >>
 >> this is not a SpamAssassin Feature, increases complexity.
 >>     
 >
 > Okay, I resign periodic script part of the PR.  But I think it's useful
 > to have reload command on rc script.  Do you approve the following
 > change for rc script?
 >
 >   
 
 spamassassin recommends a 'restart', not a reload.
 
 I will need to look at what happens in rc, restart vs a reload.
 
 Does a reload do a HUP? if so, this could cause problems with incomplete
 restart, and might have issues with chroot and chown systems.
 
 Does an rc do a stop/start? than maybe this will be fine.
 
 http://wiki.apache.org/spamassassin/RuleUpdates
 
 
 _________________________________________________________________________
 This email has been scanned and certified safe by SpammerTrap(tm). 
 For Information please see http://www.spammertrap.com
 _________________________________________________________________________
 
 --------------010906030804050805070107
 Content-Type: text/html; charset=ISO-2022-JP
 Content-Transfer-Encoding: 7bit
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
 <head>
   <meta content="text/html;charset=ISO-2022-JP"
  http-equiv="Content-Type">
 </head>
 <body bgcolor="#ffffff" text="#000000">
 NIIMI Satoshi wrote:
 <blockquote cite="mid4663CCA3.80109@sa2c.net" type="cite">
   <blockquote type="cite">
     <pre wrap="">Not without a lot of QA on this and all localized non-standard enhancements.
 
 Enhancements like this should be kept local, don't need or interfere
 with upgrades (for you) and don't need to be part of the core product.
 
 this is not a SpamAssassin Feature, increases complexity.
     </pre>
   </blockquote>
   <pre wrap=""><!---->
 Okay, I resign periodic script part of the PR.  But I think it's useful
 to have reload command on rc script.  Do you approve the following
 change for rc script?
 
   </pre>
 </blockquote>
 <br>
 spamassassin recommends a 'restart', not a reload.<br>
 <br>
 I will need to look at what happens in rc, restart vs a reload.<br>
 <br>
 Does a reload do a HUP? if so, this could cause problems with
 incomplete restart, and might have issues with chroot and chown systems.<br>
 <br>
 Does an rc do a stop/start? than maybe this will be fine.<br>
 <br>
 <a class="moz-txt-link-freetext" href="http://wiki.apache.org/spamassassin/RuleUpdates">http://wiki.apache.org/spamassassin/RuleUpdates</a><br>
 <br>
 
 <br>
 <div id="disclaimer.secnap.com"> <hr>
 This email has been scanned and certified safe by SpammerTrap&#8482;.
 <br>For Information please see 
 <a href=http://www.spammertrap.com>www.spammertrap.com</a>
 <hr> </div>
 <br>
 </body>
 </html>
 
 --------------010906030804050805070107--

From: Michael Scheidell <scheidell@secnap.net>
To: bug-followup@FreeBSD.org,  clsung@FreeBSD.org
Cc:  
Subject: [maintainer comments] Re: ports/113270: mail/p5-Mail-SpamAssassin:
 periodic script to update rules
Date: Tue, 05 Jun 2007 19:50:35 -0400

 Please close pr 113270 without applying.
 
 too many variables, not enough diagnostic and error checking in this patch.
 
 
 
 
 _________________________________________________________________________
 This email has been scanned and certified safe by SpammerTrap(tm). 
 For Information please see http://www.spammertrap.com
 _________________________________________________________________________
State-Changed-From-To: feedback->closed 
State-Changed-By: clsung 
State-Changed-When: Wed Jun 6 01:30:19 UTC 2007 
State-Changed-Why:  
per maintainer's request 
'too many variables, not enough diagnostic and error checking in this patch.' 

http://www.freebsd.org/cgi/query-pr.cgi?pr=113270 
>Unformatted:
