[Tickets #12189] Re: Incorrectly parses RFC 822 headers that have whitespace

noreply at bugs.horde.org noreply at bugs.horde.org
Thu Apr 18 08:03:01 UTC 2013


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/12189
------------------------------------------------------------------------------
  Ticket             | 12189
  Updated By         | stuart.carnie at gmail.com
  Summary            | Incorrectly parses RFC 822 headers that have whitespace
  Queue              | Horde Framework Packages
  Version            | Git master
  Type               | Bug
  State              | Unconfirmed
  Priority           | 3. High
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


stuart.carnie at gmail.com (2013-04-18 08:03) wrote:

The solution is to update line, to only strip EOL characters:

$val = rtrim($val, "\r\n");

> Using rtrim to determine when to break is invalid per RFC 822, which  
> per section 3.1 (http://tools.ietf.org/html/rfc822#section-3.1)  
> states headers are separated from the body by a null line; nothing  
> preceding the CRLF.  rtrim incorrectly strips tabs, thus skipping  
> the remaining headers
> https://github.com/horde/horde/blob/master/framework/Mime/lib/Horde/Mime/Headers.php#L647
>
> Example:
>
> S*T*R*I*P*P*E*D
> Message-Id: <redmine.journal-1099.20120619084107 at contattadev.com>
> References: <redmine.issue-263.20120605215949 at contattadev.com>
> Subject: [Contatta Core Framework - Feature #263] Code - Attachments in Email
> 	<- H*E*R*E is a TAB and rest is skipped
> Mime-Version: 1.0
> Content-Type: multipart/alternative;
> 	boundary=mimepart_4fe09d9362378_71323fc3637fe1b07f1
> Auto-Submitted: auto-generated
> X-Redmine-Issue-Id: 263
> X-Redmine-Site: Redmine
> X-Redmine-Issue-Assignee: mario
> X-Mailer: Redmine
> X-Auto-Response-Suppress: OOF
> X-Redmine-Issue-Author: wkey
> X-Redmine-Host: officedev.contattadev.com/redmine
> X-Redmine-Project: contattazf





More information about the bugs mailing list