icaine / php-mime-mail-parser

Automatically exported from code.google.com/p/php-mime-mail-parser
0 stars 0 forks source link

Does not decode headers according to RFC2047 #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
* Parse a message with a header (i.e. subject line) encoded according to
RFC2047

What is the expected output? What do you see instead?
* Expected output is the decoded subject line
* Instead, the subject line is passed through unencoded, i.e.
=?UTF-8?Q?stuff_A=C3=A5_B=E2=88=AB_C=C3=A7_D=E2=88=82_E?=
=?UTF-8?Q?=C2=B4_R=C2=AE_$=C2=A2?=

What version of the product are you using? On what operating system?
* Revision 15

Please provide any additional information below.
* Attached is a diff of my changes to properly decode the message headers
if they are encoded. The code is mostly copied from Pear's Mail_Mime class.
* This also fixes the issue where the message body is not decoded properly
based on its encoding type
* Also adds a function for retrieving the inline attachments

Original issue reported on code.google.com by aaron.parecki on 20 Mar 2010 at 10:44

Attachments:

GoogleCodeExporter commented 9 years ago
I am also experiencing trouble with body text not properly being decoded.  I 
have pasted an example below.  Please note the #### signs WERE NOT present in 
this email; that is where I removed personal information from the original 
message.

I have applied the above patch and will try to report back if it indeed solves 
the problem.

=0D=0AApartments.com =0D=0AHot Lead=0D=0ATo: Bound Brook Apartments/Leasing=
 Office=0D=0APropid: 10166648012    =0D=0A=0D=0A8/12/2010 10:18:14 AM=0D=0A=
=0D=0AApartments.com is pleased to send you this Hot Lead!=0D=0AThis 
prospective=
 resident used Apartments.com to view your apartment community. So you know=
 they are already interested in renting! It is best to respond to them immediately,=
 while their interest is high, via phone or email. We look forward to sending=
 you many more Hot Leads in the future! =0D=0A=0D=0ARenter Last Name =3D=
 #######=0D=0AFirst Name =3D ###=0D=0AAddress =3D =0D=0ACity =3D =0D=0AState=
 =3D =0D=0AZip =3D =0D=0ADayPhone =3D =0D=0AEveningPhone =3D ###########=
=0D=0AE-mail Address =3D ##########=0D=0A=0D=0APreferred contact=
 method =3D =0D=0A=0D=0AMove Date=0D=0A=0D=0A Month =3D 10=0D=0A Day =3D=
 15=0D=0A Year =3D =0D=0A=0D=0AComments=0D=0Astudio or one bedroom=0D=0A=
=0D=0ASearch Criteria=0D=0A=0D=0AState =3D New Jersey=0D=0A Area =3D Middlesex,=
 Union & Somerset=0D=0ACommunity =3D Middlesex County, Somerset County,=
 Union County=0D=0A=0D=0ARent =3D All Price Ranges=0D=0ABedrooms =3D Studio,One=
=0D=0A=0D=0ABathrooms =3D Any Bathroom Size=0D=0A=0D=0A=0D=0A=0D=0AFraud=
 Alert: Don't Fall for Internet Scams=0D=0A=0D=0A-Do not accept cashier=
 checks that are for more than the rent/deposit you are asking for. =0D=0A=
=0D=0A-Do not enter into an agreement that requires you to wire money to=
 the renter.=0D=0A=0D=0AReport fraud at feedback@apartments.com. For more=
 information visit our Fraud Tips. =0D=0A

Original comment by davidcroda on 12 Aug 2010 at 3:38

GoogleCodeExporter commented 9 years ago
aaron.parecki, Great THX to you! This problem is still present in file in repo! 
I am googling for hours and found your nice patch!

Best regards,
Ilia

Original comment by ilia...@mail.ru on 20 Oct 2012 at 4:35

GoogleCodeExporter commented 9 years ago
This issue is reproduced, corrected and tested 
(https://github.com/eXorus/php-mime-mail-parser/issues/3)

You could use my fork if you want : 
https://github.com/eXorus/php-mime-mail-parser

Original comment by eXorus.m...@gmail.com on 28 Jul 2013 at 4:23