From nikola.lecic@anthesphoria.net  Thu Nov 29 19:34:14 2007
Return-Path: <nikola.lecic@anthesphoria.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1B6D416A41A
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 29 Nov 2007 19:34:14 +0000 (UTC)
	(envelope-from nikola.lecic@anthesphoria.net)
Received: from anthesphoria.net (anthesphoria.net [200.46.204.219])
	by mx1.freebsd.org (Postfix) with ESMTP id AC2FF13C474
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 29 Nov 2007 19:34:12 +0000 (UTC)
	(envelope-from nikola.lecic@anthesphoria.net)
Received: from anthesphoria.net (anthesphoria.net [200.46.204.219])
	by anthesphoria.net (8.14.1/8.14.1) with ESMTP id lATJYAkd072972
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 29 Nov 2007 20:34:11 +0100 (CET)
	(envelope-from nl@anthesphoria.net)
Received: (from nl@localhost)
	by anthesphoria.net (8.14.1/8.14.1/Submit) id lATJYAlP072966;
	Thu, 29 Nov 2007 20:34:10 +0100 (CET)
	(envelope-from nl)
Message-Id: <200711291934.lATJYAlP072966@anthesphoria.net>
Date: Thu, 29 Nov 2007 20:34:10 +0100 (CET)
From: Nikola Lecic <nikola.lecic@anthesphoria.net>
Reply-To: Nikola Lecic <nikola.lecic@anthesphoria.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] mail/squirrelmail: loses References: and In-Reply-To: headers when replying
X-Send-Pr-Version: 3.113
X-GNATS-Notify: simond@irrelevant.org

>Number:         118334
>Category:       ports
>Synopsis:       [patch] mail/squirrelmail: loses References: and In-Reply-To: headers when replying
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 29 19:40:00 UTC 2007
>Closed-Date:    Fri Dec 21 13:48:28 UTC 2007
>Last-Modified:  Fri Dec 21 13:48:28 UTC 2007
>Originator:     Nikola Lecic
>Release:        FreeBSD 6.3-PRERELEASE amd64
>Organization:
>Environment:
System: FreeBSD xxx.xxx 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #1: Mon Nov 26 16:30:52 2007 root@xxx.xxx.xxx:/usr/obj/usr/src/sys/kernel amd64


	
>Description:
	

SquirrelMail fails to create proper References: and In-Reply-To:
headers, and the problem appears only on 6.3-PRERELEASE (amd64). Exactly
the same config worked on i386 and squirrelmail-devel works normally in
both cases.

The problem is that in function deliverMessage of src/compose.php
$composeMessage arrives without $composeMessage->reply_rfc822_header,
although it was properly set earlier. Consequently, the conditonal

        if (is_object($reply_rfc822_header) &&
            isset($reply_rfc822_header->message_id) &&
            $reply_rfc822_header->message_id) {

(of class/deliver/Deliver.class.php, line 452) fails and message will
not be treated as a reply => will be sent without those two headers.

I don't precisely know what is the cause and how this relates to the
architecture, but the patch below solved the problem for me on amd64.

BTW, I have "session.auto_start = 1", but this doesn't seem to be
related to the problem. All php5 ports are up-to-date.

>How-To-Repeat:
	
cd /usr/ports/mail/squirrelmail ; make install

Then try to reply to any message, preferably to one which already has
References: header. References will be lost and no In-Reply-To: header
will be added (message won't be treated as a reply in
class/deliver/Deliver.class.php).

>Fix:

	

Notes:
* This is a patch against _installed_ (FreeBSD-patched) file.
* The replacement code is taken from the equivalent file of squirrelmail-devel.

--- squirrelmail-1.4.11-src-compose.php.patch begins here ---
--- squirrelmail.orig/src/compose.php	2007-11-29 19:00:04.000000000 +0100
+++ squirrelmail/src/compose.php	2007-11-29 19:45:11.000000000 +0100
@@ -354,13 +354,17 @@
     $composesession = $session;
     sqsession_register($composesession,'composesession');
 }
-if (!empty($compose_messages[$session])) {
-    $composeMessage = $compose_messages[$session];
+
+if (!isset($compose_messages[$session]) || ($compose_messages[$session] == NULL)) {
+	$composeMessage = new Message();
+	$rfc822_header = new Rfc822Header();
+	$composeMessage->rfc822_header = $rfc822_header;
+	$composeMessage->reply_rfc822_header = '';
+	$compose_messages[$session] = $composeMessage;
+
+	sqsession_register($compose_messages,'compose_messages');
 } else {
-    $composeMessage = new Message();
-    $rfc822_header = new Rfc822Header();
-    $composeMessage->rfc822_header = $rfc822_header;
-    $composeMessage->reply_rfc822_header = '';
+	$composeMessage=$compose_messages[$session];
 }
 
 // re-add attachments that were already in this message
--- squirrelmail-1.4.11-src-compose.php.patch ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Thu Nov 29 19:40:11 UTC 2007 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118334 
Responsible-Changed-From-To: freebsd-ports-bugs->tabthorpe 
Responsible-Changed-By: tabthorpe 
Responsible-Changed-When: Thu Nov 29 19:49:53 UTC 2007 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118334 
Responsible-Changed-From-To: tabthorpe->freebsd-ports-bugs@FreeBSD.org 
Responsible-Changed-By: tabthorpe 
Responsible-Changed-When: Wed Dec 5 06:26:38 UTC 2007 
Responsible-Changed-Why:  
Back to the pool 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118334 
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: miwi 
Responsible-Changed-When: Sat Dec 15 22:18:02 UTC 2007 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118334 
State-Changed-From-To: feedback->open 
State-Changed-By: miwi 
State-Changed-When: Tue Dec 18 16:04:00 UTC 2007 
State-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=118334 
State-Changed-From-To: open->feedback 
State-Changed-By: miwi 
State-Changed-When: Tue Dec 18 16:04:17 UTC 2007 
State-Changed-Why:  
hi, 

The newer version is already in the ports tree. Does this solve the 
problem? 

Martin 


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

From: Nikola =?UTF-8?B?TGXEjWnEhw==?= <nikola.lecic@anthesphoria.net>
To: miwi@FreeBSD.org
Cc: simond@irrelevant.org, miwi@FreeBSD.org, bug-followup@FreeBSD.org
Subject: Re: ports/118334: [patch] mail/squirrelmail: loses References: and
 In-Reply-To: headers when replying
Date: Wed, 19 Dec 2007 03:11:19 +0100

 On Tue, 18 Dec 2007 16:07:59 GMT
 miwi@FreeBSD.org wrote:
 =20
 > hi,
 >=20
 > The newer version is already in the ports tree. Does this solve the
 > problem?
 
 Hi Martin,
 
 Yes, it does. Please close this PR.
 
 --=20
 Nikola Le=C4=8Di=C4=87 :: =D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0 =D0=9B=D0=B5=
 =D1=87=D0=B8=D1=9B
State-Changed-From-To: feedback->closed 
State-Changed-By: miwi 
State-Changed-When: Fri Dec 21 13:48:27 UTC 2007 
State-Changed-Why:  
already fixed in 1.4.13. Thanks for you're report. 

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