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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
12 - 8 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Thu Apr 18 02:02:52 2024 UTC