From nobody@FreeBSD.org  Thu May  7 21:56:43 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E5DC0106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  7 May 2009 21:56:43 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id BA7518FC19
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  7 May 2009 21:56:43 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n47LuhIk091709
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 7 May 2009 21:56:43 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n47LuhPO091708;
	Thu, 7 May 2009 21:56:43 GMT
	(envelope-from nobody)
Message-Id: <200905072156.n47LuhPO091708@www.freebsd.org>
Date: Thu, 7 May 2009 21:56:43 GMT
From: "R. Schulze" <rs@bytecamp.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: spamlogd's whitelist expiration period is hardcoded
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: samm@os2.kiev.ua

>Number:         134347
>Category:       ports
>Synopsis:       mail/spamd: spamlogd's whitelist expiration period is hardcoded
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    wxs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 07 22:00:09 UTC 2009
>Closed-Date:    Thu Jul 23 16:03:59 UTC 2009
>Last-Modified:  Thu Jul 23 16:03:59 UTC 2009
>Originator:     R. Schulze
>Release:        7.1-RELEASE-p5
>Organization:
>Environment:
>Description:
Spamlogd's whiteexp should not be hardcoded in grey.h.
Instead there should be a configurable whitelist expiration like stated in the docs.
>How-To-Repeat:
Configure spamd_flags "-G 4:4:192" and have a look of whitelisted entries, they do not expire after 192 hours, but after 36 days, like defined in spamd/grey.h.
>Fix:
Just add a parameter.

>Release-Note:
>Audit-Trail:

From: "Olli Hauer" <ohauer@gmx.de>
To: bug-followup@FreeBSD.org, rs@bytecamp.net, ohauer@gmx.de
Cc:  
Subject: Re: ports/134347: mail/spamd: spamlogd's whitelist expiration period
 is hardcoded
Date: Sat, 09 May 2009 20:33:11 +0200

 Hi,
 
 is it possible that you have also spamlogd running?
 
 spamd honors the times given (spamd.c line ~1132 variable whiteexp),
 but if you have spamlogd running then the white times are pushed to
 36 days (from grey.h) after the sending machine is whitelisted and
 connects to your MTA.
 
 
 See the following test.
 
 # -- file /etc/rc.conf.local
 obspamd_enable="YES"
 obspamd_times="-G 1:6:2"
 obspamd_flags="-5 -v -l127.0.0.1 -S0 -s0 ${obspamd_times}"
 
 
 # 1st. connect
 # spamdb
 GREY|127.0.0.1|foo|sender@example.com|rcpt@example.com|1241892180|1241913780|1241913780|1|0
 
 # 2nd. connect after one minute
 # spamdb
 GREY|127.0.0.1|foo|sender@example.com|rcpt@example.com|1241892180|1241892278|1241913780|2|0
 
 # again after DB_SCAN_INTERVAL 60
 # spamdb
 WHITE|127.0.0.1|||1241892180|1241892278|1241899531|2|0
 
 
 Now look at the timestamps from the white entry
 
 # date -j -r 1241892180
 Sa  9 Mai 2009 20:03:00 CEST
 
 # date -j -r 1241892278
 Sa  9 Mai 2009 20:04:38 CEST
 
 # date -j -r 1241913780
 Sa  9 Mai 2009 22:05:31 CEST
 
 The whitelist time is around 2 hours.
 
 
 //olli
 -- 
 Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss fr nur 17,95 Euro/mtl.!* http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a

From: olli hauer <ohauer@gmx.de>
To: bug-followup@FreeBSD.org, rs@bytecamp.net, ohauer@gmx.de
Cc:  
Subject: Re: ports/134347: mail/spamd: spamlogd's whitelist expiration
	period is hardcoded
Date: Sun, 10 May 2009 00:41:40 +0200

 --r5Pyd7+fXNt84Ff3
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Hi,
 
 overlooked in the first mail that you mean spamlogd and not spamd.
 
 Ok, I created a patch for spamlogd which adds a new parameter -W.
 
 This new parameter takes the whiteexp time in hours (min 1 max 2160)
 
 To apply the patch:
 
 cd /usr/ports/mail/spamd/
  patch < patch_spamd_spamlogd.txt
 
 I think this is what you want, also I will send the patch uptstream
 to OpenBSD (this means that parameters can change if the patch goes
 official into OpenBSD)
 
 Please give feedback if the patch works for you, so others can also
 benefit from your expirience.
 
 
 //olli
 
 
 
 --r5Pyd7+fXNt84Ff3
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="patch_spamd_spamlogd.txt"
 
 --- files/patch-spamlogd.orig	2007-10-05 21:03:52.000000000 +0200
 +++ files/patch-spamlogd	2009-05-10 00:16:29.000000000 +0200
 @@ -1,6 +1,14 @@
 ---- spamlogd/spamlogd.c.orig	Sat Jun 23 15:28:14 2007
 -+++ spamlogd/spamlogd.c	Sat Jun 23 15:28:27 2007
 -@@ -158,10 +158,12 @@
 +--- spamlogd/spamlogd.c.orig	2007-06-03 17:22:33.000000000 +0200
 ++++ spamlogd/spamlogd.c	2009-05-10 00:09:47.000000000 +0200
 +@@ -85,6 +85,7 @@
 + int sdata = 0;					/* dummy */
 + char *pid_file = "/var/run/spamlogd.pid";
 + int use_pf = 1;
 ++time_t whiteexp = WHITEEXP;
 + #endif
 + 
 + extern char		*__progname;
 +@@ -158,10 +159,12 @@
   
   	pcap_freecode(&bpfp);
   
 @@ -13,3 +21,85 @@
   
   	return (0);
   }
 +@@ -269,7 +272,11 @@
 + 		gd.first = now;
 + 		gd.bcount = 1;
 + 		gd.pass = now;
 ++#ifdef __FreeBSD__
 ++		gd.expire = now + whiteexp;
 ++#else
 + 		gd.expire = now + WHITEEXP;
 ++#endif
 + 		memset(&dbk, 0, sizeof(dbk));
 + 		dbk.size = strlen(ip);
 + 		dbk.data = ip;
 +@@ -289,7 +296,11 @@
 + 		}
 + 		memcpy(&gd, dbd.data, sizeof(gd));
 + 		gd.pcount++;
 ++#ifdef __FreeBSD__
 ++		gd.expire = now + whiteexp;
 ++#else
 + 		gd.expire = now + WHITEEXP;
 ++#endif
 + 		memset(&dbk, 0, sizeof(dbk));
 + 		dbk.size = strlen(ip);
 + 		dbk.data = ip;
 +@@ -305,7 +316,11 @@
 + 	db->close(db);
 + 	db = NULL;
 + 	if (syncsend)
 ++#ifdef __FreeBSD__
 ++		sync_white(now, now + whiteexp, ip);
 ++#else
 + 		sync_white(now, now + WHITEEXP, ip);
 ++#endif
 + 	return (0);
 +  bad:
 + 	db->close(db);
 +@@ -317,9 +332,11 @@
 + usage(void)
 + {
 + 	fprintf(stderr,
 ++#ifndef __FreeBSD__
 + 	    "usage: %s [-DI] [-i interface] [-l pflog_interface] [-Y synctarget]\n"
 +-#ifdef __FreeBSD__
 +-		"\t[-m mode]\n"
 ++#else
 ++	    "usage: %s [-DI] [-i interface] [-l pflog_interface] [-W whiteexp]\n"
 ++        "\t[-Y synctarget] [-m mode]\n"
 + #endif
 + 	    ,__progname);
 + 	exit(1);
 +@@ -330,6 +347,8 @@
 + {
 + #ifdef __FreeBSD__
 + 	FILE		*fpid = NULL;
 ++    const char *errstr;
 ++    int i;
 + #endif	
 + 	int		 ch;
 + 	struct passwd	*pw;
 +@@ -345,7 +364,7 @@
 + #ifndef __FreeBSD__
 + 	while ((ch = getopt(argc, argv, "DIi:l:Y:")) != -1) {
 + #else
 +-	while ((ch = getopt(argc, argv, "DIi:l:Y:m:")) != -1) {
 ++	while ((ch = getopt(argc, argv, "DIi:l:W:Y:m:")) != -1) {
 + #endif
 + 		switch (ch) {
 + 		case 'D':
 +@@ -360,6 +379,13 @@
 + 		case 'l':
 + 			pflogif = optarg;
 + 			break;
 ++		case 'W':
 ++            /* limit whiteexp to 2160h (90 days) */
 ++			i = strtonum(optarg, 1, (24 * 90), &errstr);
 ++			if (errstr)
 ++				usage();
 ++			whiteexp = (i * 60 * 60);
 ++			break;
 + 		case 'Y':
 + 			if (sync_addhost(optarg, sync_port) != 0)
 + 				sync_iface = optarg;
 --- files/patch-spamlogd_8.orig	2009-05-10 00:24:45.000000000 +0200
 +++ files/patch-spamlogd_8	2009-05-10 00:13:44.000000000 +0200
 @@ -0,0 +1,21 @@
 +--- spamlogd/spamlogd.8.orig	2007-04-02 13:27:07.000000000 +0200
 ++++ spamlogd/spamlogd.8	2009-05-10 00:12:32.000000000 +0200
 +@@ -25,6 +25,7 @@
 + .Op Fl DI
 + .Op Fl i Ar interface
 + .Op Fl l Ar pflog_interface
 ++.Op Fl W Ar whiteexp
 + .Op Fl Y Ar synctarget
 + .Sh DESCRIPTION
 + .Nm
 +@@ -77,6 +78,10 @@
 + interface to listen for connection notifications.
 + The default is to watch for connections logged on
 + .Dq pflog0 .
 ++.It Fl W Ar whiteexp
 ++Adjust the time for whiteexp in hours (default is 864
 ++hours, approximately 36 days, min is 1 hour, max is 2160 
 ++hours or 90 days).
 + .It Fl Y Ar synctarget
 + Add a target to receive synchronisation messages; see
 + .Sx SYNCHRONISATION
 
 --r5Pyd7+fXNt84Ff3--
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Mon May 18 22:28:17 UTC 2009 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

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

From: Edwin Groothuis <edwin@FreeBSD.org>
To: samm@os2.kiev.ua
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/134347: mail/spamd: spamlogd's whitelist expiration period is hardcoded
Date: Mon, 18 May 2009 22:28:15 UT

 Maintainer of mail/spamd,
 
 Please note that PR ports/134347 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/134347
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org

From: olli hauer <ohauer@gmx.de>
To: bug-followup@FreeBSD.org, rs@bytecamp.net
Cc: ohauer@gmx.de
Subject: Re: ports/134347: mail/spamd: spamlogd's whitelist expiration
	period is hardcoded
Date: Tue, 19 May 2009 17:47:47 +0200

 Hi Robert,
 
 thanks for the feedback, and the suggestion for the feature request.
 
 Changes are already merged to the next version of spamd
 http://svn.berlios.de/viewvc/freebsdspamd/trunk/spamlogd/spamlogd.c?r1=85&r2=87
 
 Hope I can finish testing at amd64, Sparc this weekend for the new spamd-4.5.0
 (OpenBSD 4.5 + current).
 
 Regards,
 olli
 
 
State-Changed-From-To: feedback->suspended 
State-Changed-By: linimon 
State-Changed-When: Tue May 19 23:10:19 UTC 2009 
State-Changed-Why:  
Maintainer is working on a patch to upgrade the next version. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=134347 
State-Changed-From-To: suspended->open 
State-Changed-By: miwi 
State-Changed-When: Sat Jul 18 09:41:14 UTC 2009 
State-Changed-Why:  
. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=134347 
State-Changed-From-To: open->feedback 
State-Changed-By: miwi 
State-Changed-When: Sat Jul 18 09:41:23 UTC 2009 
State-Changed-Why:  
any news here? 

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

From: Robert Schulze <rs@bytecamp.net>
To: bug-followup@FreeBSD.org, rs@bytecamp.net
Cc:  
Subject: Re: ports/134347: mail/spamd: spamlogd's whitelist expiration period
 is hardcoded
Date: Mon, 20 Jul 2009 10:19:44 +0200

 Hi,
 
 I've tested Olli's patch and it worked well.
 
 Robert Schulze
Responsible-Changed-From-To: freebsd-ports-bugs->wxs 
Responsible-Changed-By: wxs 
Responsible-Changed-When: Mon Jul 20 13:42:54 UTC 2009 
Responsible-Changed-Why:  
I'll take it. 

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

From: Wesley Shields <wxs@FreeBSD.org>
To: ohauer@gmx.de
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/134347: mail/spamd: spamlogd's whitelist expiration
 period is hardcoded
Date: Thu, 23 Jul 2009 11:47:26 -0400

 Olli,
 
 It is my understanding from reading the audit trail of this PR that this
 bug has been fixed now that I committed the spamd update. Can you
 confirm this so that I can close this PR.
 
 -- WXS

From: olli hauer <ohauer@gmx.de>
To: wxs@FreeBSD.org, ohauer@gmx.de
Cc: bug-followup@FreeBSD.org
Subject: RE: ports/134347: mail/spamd: spamlogd's whitelist expiration
	period is hardcoded
Date: Thu, 23 Jul 2009 17:54:13 +0200

 > Olli,
 > 
 > It is my understanding from reading the audit trail of this PR that
 > this
 > bug has been fixed now that I committed the spamd update. Can you
 > confirm this so that I can close this PR.
 > 
 > -- WXS
 
 
 Hi Wesley,
 
 yes you can close the PR 134347.
 
 The patches for this feature request are now per default in the port.
 
 Thanks,
 olli
 
 
State-Changed-From-To: feedback->closed 
State-Changed-By: wxs 
State-Changed-When: Thu Jul 23 16:03:57 UTC 2009 
State-Changed-Why:  
This is fixed in the latest version of the port. 

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