From nobody@FreeBSD.org  Thu Feb 18 17:29:56 2010
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 B54D11065679
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 18 Feb 2010 17:29:56 +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 A4B0F8FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 18 Feb 2010 17:29:56 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o1IHTugD044944
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 18 Feb 2010 17:29:56 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o1IHTuwu044943;
	Thu, 18 Feb 2010 17:29:56 GMT
	(envelope-from nobody)
Message-Id: <201002181729.o1IHTuwu044943@www.freebsd.org>
Date: Thu, 18 Feb 2010 17:29:56 GMT
From: Andrei Lavreniyuk <andy.lavr@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] Update ports/mail/dbmail to version 2.2.15 
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: mark_sf@kikg.ifmo.ru

>Number:         144068
>Category:       ports
>Synopsis:       [PATCH] Update ports/mail/dbmail to version 2.2.15
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    sahil
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 18 17:40:03 UTC 2010
>Closed-Date:    Wed Jul 14 00:34:57 UTC 2010
>Last-Modified:  Wed Jul 14 00:34:57 UTC 2010
>Originator:     Andrei Lavreniyuk
>Release:        FreeBSD 8.0-STABLE
>Organization:
Technica-03, Inc.
>Environment:
FreeBSD datacenter.technica-03.local 8.0-STABLE FreeBSD 8.0-STABLE #0: Sat Feb 13 11:01:53 EET 2010     root@datacenter.technica-03.local:/usr/obj/usr/src/sys/SMP64  amd64
>Description:

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN dbmail.bak/Makefile dbmail/Makefile
--- dbmail.bak/Makefile	2010-02-18 19:16:06.819302774 +0200
+++ dbmail/Makefile	2010-02-18 19:22:40.411974666 +0200
@@ -6,8 +6,7 @@
 #
 
 PORTNAME=	dbmail
-PORTVERSION=	2.2.11
-PORTREVISION=	0
+PORTVERSION=	2.2.15
 CATEGORIES=	mail
 MASTER_SITES=	http://www.dbmail.org/download/2.2/
 
diff -ruN dbmail.bak/distinfo dbmail/distinfo
--- dbmail.bak/distinfo	2010-02-18 19:16:06.778534513 +0200
+++ dbmail/distinfo	2010-02-18 19:16:28.923239679 +0200
@@ -1,3 +1,3 @@
-MD5 (dbmail-2.2.11.tar.gz) = d535587973d73b85469d92a35f52133b
-SHA256 (dbmail-2.2.11.tar.gz) = 7d61ce32b5f1cbbc42fa39e3c1cc10659c524a7d3135555efe4b272064939148
-SIZE (dbmail-2.2.11.tar.gz) = 901705
+MD5 (dbmail-2.2.15.tar.gz) = 4d0a44c35c02b9c7509489bf5025e113
+SHA256 (dbmail-2.2.15.tar.gz) = ca88e4a3bc1360b3621ffd8567103668a896ecb22102d3886ab5e59e7747217b
+SIZE (dbmail-2.2.15.tar.gz) = 875592
diff -ruN dbmail.bak/files/patch-server.c dbmail/files/patch-server.c
--- dbmail.bak/files/patch-server.c	1970-01-01 03:00:00.000000000 +0300
+++ dbmail/files/patch-server.c	2010-02-18 19:16:11.000000000 +0200
@@ -0,0 +1,105 @@
+--- server.c.orig	2010-02-13 11:17:42.000000000 +0200
++++ server.c	2009-02-02 16:21:55.000000000 +0200
+@@ -44,7 +44,7 @@
+ ChildInfo_t childinfo;
+ 
+ /* some extra prototypes (defintions are below) */
+-static void ParentSigHandler(int sig);
++static void ParentSigHandler(int sig, siginfo_t * info, void *data);
+ static int SetParentSigHandler(void);
+ static int server_setup(serverConfig_t *conf);
+ 
+@@ -59,11 +59,11 @@
+ 
+ 	act.sa_sigaction = ParentSigHandler;
+ 	sigemptyset(&act.sa_mask);
+-	act.sa_flags = 0;
++	act.sa_flags = SA_SIGINFO;
+ 
+ 	sact.sa_sigaction = ParentSigHandler;
+ 	sigemptyset(&sact.sa_mask);
+-	sact.sa_flags = SA_NOCLDSTOP;
++	sact.sa_flags = SA_SIGINFO | SA_NOCLDSTOP;
+ 
+ 	sigaction(SIGCHLD,	&sact, 0);
+ 	sigaction(SIGINT,	&sact, 0);
+@@ -329,7 +329,7 @@
+ 	return result;
+ }
+ 
+-void ParentSigHandler(int sig)
++void ParentSigHandler(int sig, siginfo_t * info UNUSED, void *data UNUSED)
+ {
+ 	int saved_errno = errno;
+ 	Restart = 0;
+@@ -437,41 +437,41 @@
+ 
+ static int create_inet_socket(const char * const ip, int port, int backlog)
+ {
+-        struct addrinfo hints, *res, *ressave;
+-        int sock, n, flags;
++	int sock, err, flags;
++	struct sockaddr_in saServer;
+ 	int so_reuseaddress = 1;
+-	field_t service;
+ 
+-        memset(&hints, 0, sizeof(struct addrinfo));
+-        hints.ai_flags     = AI_PASSIVE;
+-        hints.ai_family    = AF_UNSPEC;
+-        hints.ai_socktype  = SOCK_STREAM;
+-
+-	memset(service, 0, sizeof(field_t));
+-	snprintf(service, sizeof(field_t), "%d", port);
+-
+-        n = getaddrinfo(ip, service, &hints, &res);
+-        if (n < 0) {
+-                TRACE(TRACE_FATAL, "getaddrinfo::error [%s]", gai_strerror(n));
+-                return -1;
+-        }
+-
+-        ressave = res;
+-        if ((sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) < 0) {
+-                int serr = errno;
+-                freeaddrinfo(ressave);
+-                TRACE(TRACE_FATAL, "%s", strerror(serr));
+-        }
++	sock = dm_socket(PF_INET);
++	
++	setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &so_reuseaddress, sizeof(so_reuseaddress));
+ 
+-        TRACE(TRACE_DEBUG, "create socket [%s:%d] backlog [%d]", ip, port, backlog);
++	/* setup sockaddr_in */
++	memset(&saServer, 0, sizeof(saServer));
++	saServer.sin_family	= AF_INET;
++	saServer.sin_port	= htons(port);
+ 
+-	setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &so_reuseaddress, sizeof(so_reuseaddress));
++	TRACE(TRACE_DEBUG, "creating socket on [%s:%d] with backlog [%d]",
++			ip, port, backlog);
++	
++	if (ip[0] == '*') {
++		
++		saServer.sin_addr.s_addr = htonl(INADDR_ANY);
++		
++	} else if (! (inet_aton(ip, &saServer.sin_addr))) {
++		
++		close(sock);
++		TRACE(TRACE_FATAL, "IP invalid [%s]", ip);
++	}
+ 
+-        // any error in dm_bind_and_listen is fatal
+-        dm_bind_and_listen(sock, res->ai_addr, res->ai_addrlen, backlog);
+-        freeaddrinfo(ressave);
++	err = dm_bind_and_listen(sock, (struct sockaddr *)&saServer, sizeof(saServer), backlog);
++	if (err != 0) {
++		close(sock);
++		TRACE(TRACE_FATAL, "Fatal error, could not bind to [%s:%d] %s",
++			ip, port, strerror(err));
++	}
+ 
+-	// unblock
++	// man 2 accept says that if the connection disappears during the accept call 
++	// accept will block forever unless it is set non-blocking with fcntl
+ 	flags = fcntl(sock, F_GETFL);
+ 	fcntl(sock, F_SETFL, flags | O_NONBLOCK);
+ 


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Thu Feb 18 17:41:32 UTC 2010 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

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

From: Edwin Groothuis <edwin@FreeBSD.org>
To: mark_sf@kikg.ifmo.ru
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/144068: [PATCH] Update ports/mail/dbmail to version 2.2.15
Date: Thu, 18 Feb 2010 17:41:30 UT

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

From: Mark Starovoytov <mark_sf@kikg.ifmo.ru>
To: andy.lavr@gmail.com, bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/144068: [PATCH] Update ports/mail/dbmail to version 2.2.15
Date: Fri, 19 Feb 2010 15:52:18 +0300

 Hello andy,
 
   Could you please explain why do you want to disable the
 IPv6 support? As far as I see, your patch just reverts the changes in
 create_inet_socket () introduced by the "backport IPv6 support"
 commit
 (http://git.dbmail.eu/cgit/cgit.cgi/paul/dbmail/commit/?id=fb4e2c74402abfdffcd3583be47691ef6a9252bc)
 
 Also please let me know if you have submitted the issue to the dbmail
 bug tracker if you have problems with the new implementation?
 
 -- 
 Thanks in advance,
  Mark
 

From: "Andrei V. Lavreniyuk" <andy.lavr@reactor-xg.kiev.ua>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/144068: [PATCH] Update ports/mail/dbmail to version 2.2.15
Date: Fri, 19 Feb 2010 16:56:18 +0200

 Hi!
 
 
    If add to /etc/src.conf
 
 WITHOUT_INET6=true
 WITHOUT_INET6_SUPPORT=true
 
 and reinstall world and kernel then dbmail-2.2.15 no work...
 
 The process of dbmail-lmtpd and dbmail-imapd is halted with signal 11.
 
 
 
 -- 
   Best regards, Andrei V. Lavreniyuk.
 

From: Stefan Walter <stefan@freebsd.org>
To: Andrei Lavreniyuk <andy.lavr@gmail.com>,
	Mark Starovoytov <mark_sf@kikg.ifmo.ru>
Cc: GNATS <FreeBSD-gnats-submit@FreeBSD.org>
Subject: Re: ports/144068: [PATCH] Update ports/mail/dbmail to version
 2.2.15
Date: Mon, 28 Jun 2010 12:32:43 +0200

 Hi Mark, hi Andrei,
 
 any news on this issue? Should Andrei's patch be committed as submitted or
 is there an alternative patch to be used?
 
 Regards,
 Stefan
Responsible-Changed-From-To: freebsd-ports-bugs->sahil 
Responsible-Changed-By: sahil 
Responsible-Changed-When: Mon Jul 5 04:34:10 UTC 2010 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=144068 
State-Changed-From-To: feedback->closed 
State-Changed-By: sahil 
State-Changed-When: Wed Jul 14 00:34:56 UTC 2010 
State-Changed-Why:  
Please see ports/148371. 

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