Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.6

Bug #9507 Envelope FROM isn't decoded properly
Submitted: 2006-11-30 04:40 UTC
From: david at blue-labs dot org Assigned: alan_k
Status: Closed Package: Mail_mimeDecode (version 1.3.1)
PHP Version: 5.1.6 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2006-11-30 04:40 UTC] david at blue-labs dot org (David)
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"

Comments

 [2006-12-07 00:06 UTC] glen at delfi dot ee (Elan Ruusamäe)
"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-12-16 16:50 UTC] 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.
 [2010-09-02 17:32 UTC] alan_k (Alan Knowles)
-Status: Open +Status: Feedback
needs simple test case.
 [2011-09-05 14:04 UTC] alan_k (Alan Knowles)
-Status: Open +Status: No Feedback -Roadmap Versions: 1.6.0 +Roadmap Versions:
 [2011-09-05 16:05 UTC] alan_k (Alan Knowles)
-Status: No Feedback +Status: Closed -Assigned To: +Assigned To: alan_k
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.