php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66184 Executing of imap_fetchstructure() cause server connection crash
Submitted: 2013-11-27 15:19 UTC Modified: 2018-04-08 18:40 UTC
From: wniestolik at betasoft dot pl Assigned: cmb (profile)
Status: Not a bug Package: IMAP related
PHP Version: 5.4.22 OS: Windows/Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wniestolik at betasoft dot pl
New email:
PHP Version: OS:

 

 [2013-11-27 15:19 UTC] wniestolik at betasoft dot pl
Description:
------------
imap_fetchstructure method sends to server folowing query:

FETCH 375 (UID ENVELOPE BODY.PEEK[HEADER.FIELDS (Newsgroups Content-MD5 Content-Disposition Content-Language Content-Location Followup-To References)]  BODYSTRUCTURE INTERNALDATE RFC822.SIZE FLAGS)

Problem is, that the generated query has double space in 'References)]  BODYSTRUCTURE'. Many servers (eg. Exchange) after receive that query close connection immediately with message 'IMAP protocol error'.

It seems, that there's no possibility to prevent this other than update IMAP library. So, for servers with strict IMAP protocol parser, method imap_fetchstructure is completely useless. Please help!

---
From manual page: http://www.php.net/function.imap-fetchstructure
---


Test script:
---------------
Just execute imap_fetchstructure() on any email account and capture generated query.

Expected result:
----------------
Execution of imap_fetchstructure sends correct IMAP query without redundant white spaces.

Actual result:
--------------
Execution of imap_fetchstructure sends incorrect IMAP query with redundant white spaces.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-04-08 18:40 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2018-04-08 18:40 UTC] cmb@php.net
This is an issue of the underlying libc-client (namely of
mail_fetchstructure_full()), so we can't do anything about it.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC