From nobody@FreeBSD.org  Mon Jan 29 16:09:37 2007
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 B863F16A404
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 29 Jan 2007 16:09:37 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id A7EFA13C441
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 29 Jan 2007 16:09:37 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l0TG9bnH020805
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 29 Jan 2007 16:09:37 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l0TG9bBe020804;
	Mon, 29 Jan 2007 16:09:37 GMT
	(envelope-from nobody)
Message-Id: <200701291609.l0TG9bBe020804@www.freebsd.org>
Date: Mon, 29 Jan 2007 16:09:37 GMT
From: Cristian KLEIN<cristi@net.utcluj.ro>
To: freebsd-gnats-submit@FreeBSD.org
Subject: mail/squirrelmail-devel sets incorrect From in return receipt
X-Send-Pr-Version: www-3.0

>Number:         108519
>Category:       ports
>Synopsis:       mail/squirrelmail-devel sets incorrect From in return receipt
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    rafan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 29 16:10:19 GMT 2007
>Closed-Date:    Tue Mar 20 14:53:19 GMT 2007
>Last-Modified:  Tue Mar 20 15:00:18 GMT 2007
>Originator:     Cristian KLEIN
>Release:        FreeBSD 5.4
>Organization:
Technical University of Cluj-Napoca
>Environment:
FreeBSD bavaria.utcluj.ro 5.4-RELEASE-p13 FreeBSD 5.4-RELEASE-p13 #0: Tue Mar 28 16:16:32 EEST 2006     cristiklein@bavaria.utcluj.ro:/usr/obj/usr/src/sys/BAVARIA  i386
>Description:
A return receipt is a small e-mail notice which is sent by a user, to confirm that he has received / read an e-mail.

When using squirrelmail-devel to send such notices, the From header of the e-mail is set incorrectly.

This error happens because the Deliver_SMTP class alters the From header for its internal processing. Due to the way PHP works, the altered From header is altered in subsequent processing, including the composition of the return receipt.
>How-To-Repeat:
* Install squirrelmail-devel.
* Send an e-mail which requires return receipt
* Open that e-mail in squirrelmail
* Send a return receipt for that e-mail

Expected behaviour:
The user which sent the first e-mail should receive a notice with the From header equal to the destination of that first e-mail.

Actual behaviour:
The user which sent the first e-mail receives a notice from a strange e-mail address.

>Fix:
The following patch will dupplicate the $rfc822_header variable for Deliver_SMTP's internal processing, so that is alternation won't affect other squirrelmail components.

--- class/deliver/Deliver_SMTP.class.php.orig   Sat Jan 28 21:24:07 2006
+++ class/deliver/Deliver_SMTP.class.php        Mon Nov 13 16:26:14 2006
@@ -69,7 +69,7 @@
             $this->authPop($host, '', $user, $pass);
         }

-        $rfc822_header = $message->rfc822_header;
+        $rfc822_header = unserialize(serialize($message->rfc822_header));

         $from = $rfc822_header->from[0];
         $to =   $rfc822_header->to;

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Mon Jan 29 16:10:25 UTC 2007 
State-Changed-Why:  
Awaiting maintainers feedback 

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

From: Simon Dick <simond@irrelevant.org>
To: bug-followup@FreeBSD.org
Cc: Cristian KLEIN <cristi@net.utcluj.ro>
Subject: Re: ports/108519: mail/squirrelmail-devel sets incorrect From in
	return receipt
Date: Mon, 29 Jan 2007 16:39:18 +0000

 I'll have a look at this shortly, but it looks like the current source
 version does the same, do you want to feed it back to the authors too?
 

From: Cristian KLEIN <cristi@net.utcluj.ro>
To: Simon Dick <simond@irrelevant.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/108519: mail/squirrelmail-devel sets incorrect From in
 return receipt
Date: Mon, 29 Jan 2007 18:47:58 +0200

 Simon Dick wrote:
 > I'll have a look at this shortly, but it looks like the current source
 > version does the same, do you want to feed it back to the authors too?
 
 This issue and ports/108521 are known by the authors and are corrected
 in both the stable branch and the lastest development SVN. However, I
 felt that FreeBSD users should have these bug corrected until a new SQ
 1.5 release will come out.
Responsible-Changed-From-To: freebsd-ports-bugs->rafan 
Responsible-Changed-By: rafan 
Responsible-Changed-When: Tue Feb 27 16:12:40 UTC 2007 
Responsible-Changed-Why:  
Eat. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=108519 
State-Changed-From-To: feedback->closed 
State-Changed-By: rafan 
State-Changed-When: Tue Mar 20 14:53:18 UTC 2007 
State-Changed-Why:  
Committed. Thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/108519: commit references a PR
Date: Tue, 20 Mar 2007 14:53:09 +0000 (UTC)

 rafan       2007-03-20 14:53:03 UTC
 
   FreeBSD ports repository
 
   Modified files:
     mail/squirrelmail-devel Makefile 
   Added files:
     mail/squirrelmail-devel/files 
                                   patch-class-deliver-Deliver_SMTP.class.php 
                                   patch-functions-imap_messages.php 
   Log:
   - Fix error while reading an already read mail which is caused by
     incorrect constant passed to preg_split()
   - Correct recipient address in return receipt
   
   These are submitted to upstream, too.
   
   PR:             ports/108519, ports/108521
   Submitted by:   Cristian KLEIN <cristi at net.utcluj.ro>
   Approved by:    maintainer timeout (7 weeks)
   
   Revision  Changes    Path
   1.3       +1 -0      ports/mail/squirrelmail-devel/Makefile
   1.1       +12 -0     ports/mail/squirrelmail-devel/files/patch-class-deliver-Deliver_SMTP.class.php (new)
   1.1       +12 -0     ports/mail/squirrelmail-devel/files/patch-functions-imap_messages.php (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
