Bug #66184 [Opn->Nab]: Executing of imap_fetchstructure() cause server connection crash

From: Date: Sun, 08 Apr 2018 18:40:48 +0000
Subject: Bug #66184 [Opn->Nab]: Executing of imap_fetchstructure() cause server connection crash
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214654@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66184&edit=1

 ID:                 66184
 Updated by:         cmb@php.net
 Reported by:        wniestolik at betasoft dot pl
 Summary:            Executing of imap_fetchstructure() cause server
                     connection crash
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            IMAP related
 Operating System:   Windows/Linux
 PHP Version:        5.4.22
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

This is an issue of the underlying libc-client (namely of
mail_fetchstructure_full()), so we can't do anything about it.


Previous Comments:
------------------------------------------------------------------------
[2013-11-27 15:19:11] 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.


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=66184&edit=1


Thread (2 messages)

« previous php.bugs (#214654) next »