Re: Re: [PEAR-BUG] Bug #9507 [Opn->NoF]: Envelope FROM isn't decoded properly

[email protected] ("Alan Knowles") Mon, 05 Sep 2011 16:43:18 +0800
Newsgroups php.pear.qa
Message-ID <c245eed437a4ec10b0da2745e4ebc910-*[email protected]>
Can you let me know what generated a header like that, as I could not find any examples of it, and could not quickly find any reference to it on google.

Most of the examples I found look like this.

Return-path: <xxxx>
Envelope-to: [email protected]
Received: from mail-pz0-f47.google.com ([209.85.210.47])
	by akbkhome.com with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16)
	(Mailfort v1.2)
	(envelope-from <xxxx.com>)
	id 1R0SVR-0005Sx-Jh
	for [email protected]; Mon, 05 Sep 2011 14:18:05 +0800

Regards
Alan



 --- On 05/Sep/2011, David Ford wrote: 
> i guess the following was too difficult?  emailed because pear.php.net
> is broken
> 
> cat << EOF > test.txt
> >From -  Tue Nov 28 23:42:23 2006
> Someheader: somejunk data
> 
> body
> EOF
> 
> 
> On 09/05/2011 05:04 AM, PEARBug Database wrote:
> > ID:               9507
> >  Updated by:       [email protected]
> >  Reported By:      david at blue-labs dot org
> >  Summary:          Envelope FROM isn't decoded properly
> > -Status:           Open
> > +Status:           No Feedback
> >  Type:             Bug
> >  Package:          Mail_mimeDecode
> >  Operating System: Linux
> >  Package Version:  1.3.1
> >  PHP Version:      5.1.6
> > -Roadmap Versions: 1.6.0
> > +Roadmap Versions: 
> >  New Comment:
> >
> > -Status:           Open
> > +Status:           No Feedback
> > -Roadmap Versions: 1.6.0
> > +Roadmap Versions:
> >
> >
> >
> > Previous Comments:
> > ------------------------------------------------------------------------
> >
> > [2010-09-02 13:32:04] alan_k
> >
> > -Status: Open
> > +Status: Feedback
> > needs simple test case.
> >
> > ------------------------------------------------------------------------
> >
> > [2006-12-16 11:50:46] david at blue-labs dot org
> >
> > I beg to differ.  It is a header added by the delivering MTA /MDA and
> > many do it.  It is part of the header block as defined by RFC.  It is
> > nonsense to pipe all incoming emails through "tail +1" before delivering
> > to the LDA or to expect any LDA to accept a message then pipe it through
> > "tail +1" before attempting to process it.
> >
> > The envelope from header is referenced in numerous RFCs and there are
> > particular rules for it's use and what should and should not be present
> > in it at any given time.
> >
> > There are many SMTP based applications that rely on the envelope from
> > header, one such is SPF.  Message Disposition Notification may also
> > utilize envelope-from.
> >
> > Envelope from is also used with some IMAP servers and for the Extended
> > Facsimile via Internet Mail.
> >
> > Envelope from is decidedly a header and Mail_mimeDecode already parses
> > it as a header, it just parses it incorrectly.
> >
> > Please support it's use.
> >
> > ------------------------------------------------------------------------
> >
> > [2006-12-06 19:06:04] glen at delfi dot ee
> >
> > "From Tue Nov 28 23:42:23 2006" is not email header. email 
> > headers are separated by colon. use for example shell 
> > command 'tail +1' to skip that line.
> >
> > ------------------------------------------------------------------------
> >
> > [2006-11-29 23:40:57] david at blue-labs dot org
> >
> > Description:
> > ------------
> > Mail header's envelope from isn't decoded properly
> >
> > Scott PHP # grep "^From " ../src/debug/mime.mgt3
> > >From - Tue Nov 28 23:42:23 2006
> >
> > a) the header isn't properly split
> > b) it's lowercased because of (a)
> >
> > Test script:
> > ---------------
> > ./bluelist.php <  ../src/debug/mime.mgt3
> >
> >
> > /*
> >  * caution is prudent when using this mime stuff as the entire message
> > is
> >  * loaded into memory ...
> >  */
> > $input = stream_get_contents($config['msg on disk handle']);
> >
> > $params['include_bodies'] = true;
> > $params['decode_bodies']  = true;
> > $params['decode_headers'] = true;
> >
> > $mime_obj = new Mail_mimeDecode($input);
> > $config['mime struct'] = $mime_obj->decode($params);
> >
> > var_dump($config['mime struct']);
> >
> >
> > Expected result:
> > ----------------
> > ./bluelist.php <  ../src/debug/mime.mgt3
> > object(stdClass)#2 (5) {
> >   ["headers"]=>
> >   array(28) {
> >     ["from"]=>
> >     string(27) " - Tue Nov 28 23:42:23 2006"
> >
> >
> > Actual result:
> > --------------
> > ./bluelist.php <  ../src/debug/mime.mgt3
> > object(stdClass)#2 (5) {
> >   ["headers"]=>
> >   array(28) {
> >     ["from - tue nov 28 23"]=>
> >     string(10) "42:23 2006"
> >
> > ------------------------------------------------------------------------
> >