php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53182 imap_search not valid with RFC 3501 (still stuck with IMAPv2)
Submitted: 2010-10-27 12:45 UTC Modified: 2011-03-10 19:51 UTC
Votes:10
Avg. Score:4.5 ± 0.7
Reproduced:10 of 10 (100.0%)
Same Version:3 (30.0%)
Same OS:7 (70.0%)
From: william dot bessat at gmail dot com Assigned:
Status: Wont fix Package: IMAP related
PHP Version: 5.3.3 OS: All
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-10-27 12:45 UTC] william dot bessat at gmail dot com
Description:
------------
Hi,

The imap_search function is not compliant with the RFC 3501.
We can not search messages using their UID.

Example : imap_search("UID 200:*, $link);

The output goes in the error_log with this message :

[27-Oct-2010 12:34:35] PHP Notice:  Unknown: Unknown search criterion: UID (errflg=2) in Unknown on line 0

Imo, this functionnality should be implemented for building advanced webmails.

This is not a real *bug*, but more a lack of functionnality.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-27 12:49 UTC] william dot bessat at gmail dot com
-Summary: imap not valid with RFC 3501 +Summary: imap_search not valid with RFC 3501
 [2010-10-27 12:49 UTC] william dot bessat at gmail dot com
There's a typo in the imap_search(), the resource is, of course, before the search string :)
 [2010-10-27 21:50 UTC] william dot bessat at gmail dot com
-Summary: imap_search not valid with RFC 3501 +Summary: imap_search not valid with RFC 3501 (still stuck with IMAPv2)
 [2010-10-27 21:50 UTC] william dot bessat at gmail dot com
The search string I provided in the example is to fetch all messages where UID>=200.

The goal of this search is to keep up to date a webmail, without retriving the whole mailbox content each time you want to synchronize it, since you can't rely on the SEEN/RECENT flag (if the mailbox is opened with another software in the meantime). Using dates to achieve that is a dirty workaround...

imap_search() is stuck with the RFC 1176 (august 1990 !!111!!!)

PS: Sorry for the triple-post, this is my first bug report and I didn't know we can't edit things.
 [2010-10-29 12:44 UTC] aharvey@php.net
-Status: Open +Status: Wont fix
 [2010-10-29 12:44 UTC] aharvey@php.net
PHP's IMAP extension simply calls c-client, so it's entirely dependent on what that library supports in terms of search syntax. There's nothing we can really do on the PHP side to help.
 [2011-03-10 19:34 UTC] dkarp at zimbra dot com
The IMAP c-client certainly supports UID ranges.  This is a PHP issue.

   SEARCHSET *msgno;	a set of message sequence numbers
   SEARCHSET *uid;	a set of unique identifiers

http://skull.piratehaven.org/~bapper/imap/mail_search_funcs.html
 [2011-03-10 19:51 UTC] scottmac@php.net
PHP calls c-client with two functions, we don't have any control over the syntax.

pgm = mail_criteria(search_criteria);

mail_search_full(imap_le_struct->imap_stream, (argc == 4 ? charset : NIL), pgm, 
flags);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 09:01:28 2024 UTC