From nobody@FreeBSD.org  Tue Apr 24 21:50:42 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 24B0D106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Apr 2012 21:50:42 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id EA3818FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Apr 2012 21:50:41 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q3OLofKr017822
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Apr 2012 21:50:41 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q3OLofZX017821;
	Tue, 24 Apr 2012 21:50:41 GMT
	(envelope-from nobody)
Message-Id: <201204242150.q3OLofZX017821@red.freebsd.org>
Date: Tue, 24 Apr 2012 21:50:41 GMT
From: Klaus Mayr <klaus@mayr-software.net>
To: freebsd-gnats-submit@FreeBSD.org
Cc: ahicks@p-o.co.uk
Subject: [Patch] dbmail 3.0.2 - Added Option for full date and time in datefield
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         167279
>Category:       ports
>Synopsis:       [Patch] mail/dbmail: 3.0.2 - Added Option for full date and time in datefield
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jgh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 24 22:00:25 UTC 2012
>Closed-Date:    Mon May 21 17:04:58 UTC 2012
>Last-Modified:  Mon May 21 17:04:58 UTC 2012
>Originator:     Klaus Mayr
>Release:        8.2-RELEASE
>Organization:
Mayr Software & Netzwerke
>Environment:
8.2-RELEASE GENERIC amd64
>Description:
In DBMail 3.0 the values in dbmail_datefield.datefield are reduced to DATE
instead of DATETIME like in previous version 2.3.x.

In some applications i wrote based on dbmail i use datefield for displaying
(and sorting by) date and time of a message. 

I added an option (default is Off) and extra patch to set datefield back to
a full datetime as a workaround. 
>How-To-Repeat:
n/a
>Fix:
--- ./src/dbmail-message.c.orig	2012-04-24 22:23:38.000000000 +0200
+++ ./src/dbmail-message.c	2012-04-24 22:25:16.000000000 +0200
@@ -1334,7 +1334,7 @@
 		date += (self->internal_date_gmtoff * 36);
 
 	datefield = g_new0(gchar, 20);
-	strftime(datefield, 20, "%Y-%m-%d", gmtime(&date));
+	strftime(datefield, 20, "%Y-%m-%d %H:%M:%S", gmtime(&date));
 
 	_header_name_get_id(self, "Date", &headername_id);
 	_header_value_get_id(value, sortfield, datefield, &headervalue_id);
@@ -1716,7 +1716,7 @@
 
 			date += (offset * 36); // +0200 -> offset 200
 			datefield = g_new0(gchar,20);
-			strftime(datefield,20,"%Y-%m-%d", gmtime(&date));
+			strftime(datefield,20,"%Y-%m-%d %H:%M:%S", gmtime(&date));
 
 			TRACE(TRACE_DEBUG,"Date is [%s] offset [%d], datefield [%s]",
 					value, offset, datefield);

******************************************************************************

--- Makefile.org	2012-04-24 22:05:15.000000000 +0200
+++ Makefile	2012-04-24 23:14:58.000000000 +0200
@@ -27,7 +27,8 @@
 CONFLICTS=	dbmail-*-2.0.* dbmail-2.*
 
 OPTIONS=	SIEVE	"Build with support for Sieve mail sorting language" off \
-		LDAP	"Build with support for LDAP authentication" off
+		LDAP	"Build with support for LDAP authentication" off \
+                DATEFIELD "Use DATETIME instead of DATE in datefield" off
 
 USE_AUTOTOOLS=	libtool
 USE_GMAKE=	yes
@@ -85,6 +86,10 @@
 CONFIGURE_ARGS+=	--enable-manpages
 .endif
 
+.if defined(WITH_DATEFIELD)
+EXTRA_PATCHES = ${FILESDIR}/extra-patch-dbmail-message.patch
+.endif
+
 post-install:
 	@${INSTALL_DATA} ${WRKSRC}/dbmail.conf ${PREFIX}/etc/dbmail.conf-dist
 	@if [ ! -f ${PREFIX}/etc/dbmail.conf ] ; then \


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->jgh 
Responsible-Changed-By: jgh 
Responsible-Changed-When: Wed Apr 25 02:47:00 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=167279 
State-Changed-From-To: open->feedback 
State-Changed-By: jgh 
State-Changed-When: Wed Apr 25 04:16:06 UTC 2012 
State-Changed-Why:  
request for feedback 

http://www.freebsd.org/cgi/query-pr.cgi?pr=167279 
State-Changed-From-To: feedback->closed 
State-Changed-By: jgh 
State-Changed-When: Mon May 21 17:04:56 UTC 2012 
State-Changed-Why:  
maintainer requests this patch be pushed to upstream vendor, please feel 
free to copy me on update of version that may include this patch. 
thanks. 

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