PHP Classes

Encoded Subject Spacing

Recommend this page to a friend!

      PHP MIME Email Message Parser  >  All threads  >  Encoded Subject Spacing  >  (Un) Subscribe thread alerts  
Subject:Encoded Subject Spacing
Summary:Multi-line encoded subjects seem to have a spacing issue
Messages:5
Author:Kieran
Date:2016-07-08 16:59:28
 

  1. Encoded Subject Spacing   Reply   Report abuse  
Picture of Kieran Kieran - 2016-07-08 16:59:28
Given the below email, I am expecting to see the following subject:
"If you can read this you understand the example."

However, due to the subject being spread over two lines and the second prefixed by a space the following subject is returned:
"If you can read this yo u understand the example."

I am using the latest version (1.79), downloaded via composer.

Delivered-To: asdasd@gmail.com
Received: by 10.152.1.193 with SMTP id 1csp311490lao;
Mon, 20 Oct 2014 05:33:31 -0700 (PDT)
Return-Path: <sender@test.com>
Received: from vps4596.inmotionhosting.com (vps4596.inmotionhosting.com. [74.124.217.238])
by mx.google.com with ESMTPS id fb7si7786786pab.30.2014.10.20.05.33.30
for <asdasd@gmail.com>
(version=TLSv1 cipher=RC4-SHA bits=128/128);
Mon, 20 Oct 2014 05:33:30 -0700 (PDT)
Message-ID: <14FBD481E1074C79A706F0C071746F3D@acerDator>
From: =?US-ASCII?Q?Keith_Moore?= <moore@cs.utk.edu>
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <support@my.company>
CC: =?ISO-8859-1?Q?Andr=E9?= Pirard <PIRARD@vm1.ulg.ac.be>
References: <CAEMnOreG=99=qx-ONib=g+32uBdSav5WP303BA@mail.gmail.com>
Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
=?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
Date: Mon, 20 Oct 2014 14:33:24 +0200
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0018_01CFEC72.CE424470"
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Mailer: Microsoft Windows Live Mail 14.0.8117.416
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8117.416
X-Source:
X-Source-Args:
X-Source-Dir:

Det här är ett flerdelat meddelande i MIME-format.

------=_NextPart_000_0018_01CFEC72.CE424470
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This email will not be captured correctly by php-mime-mail-parser.

Mailparse is unable to handle poorly formed emails. For example ...

Det h=E4r =E4r ett flerdelat meddelande i MIME-format.

... is directly above this quoted-printable wrapper, thanks to the =
Swedish email client Microsoft Windows Live (circa 2009), adding UTF-8 =
chars where there should only be ascii. At least, that's what I think =
the problem is.

------=_NextPart_000_0018_01CFEC72.CE424470--

  2. Re: Encoded Subject Spacing   Reply   Report abuse  
Picture of Kieran Kieran - 2016-07-08 17:12:37 - In reply to message 1 from Kieran
Sorry.. seems to have stripped all spacing from my message.

Here's a link to the email: https://raw.githubusercontent.com/php-mime-mail-parser/php-mime-mail-parser/master/tests/mails/m0023

Also, for reference here's the decoded result using iconv_mime_decode: https://3v4l.org/NlGK0

  3. Re: Encoded Subject Spacing   Reply   Report abuse  
Picture of Kieran Kieran - 2016-07-18 13:28:09 - In reply to message 2 from Kieran
Some more information from the RFC: https://tools.ietf.org/html/rfc2047#section-2

An 'encoded-word' may not be more than 75 characters long, including
'charset', 'encoding', 'encoded-text', and delimiters. If it is
desirable to encode more text than will fit in an 'encoded-word' of
75 characters, multiple 'encoded-word's (separated by CRLF SPACE) may
be used.


  4. Re: Encoded Subject Spacing   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2016-07-23 03:57:06 - In reply to message 1 from Kieran
Sorry for the delay.

It seems the spaces should be removed between consecutive encoded words.

I have fixed that bug and uploaded the fixed version. Just let me know if you find any other issues. Thank you for reporting.

  5. Re: Encoded Subject Spacing   Reply   Report abuse  
Picture of Kieran Kieran - 2016-07-25 17:45:35 - In reply to message 4 from Manuel Lemos
Great thanks, appears to be working on my test suite!