php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66284 search does not work when using reopen
Submitted: 2013-12-13 13:32 UTC Modified: 2013-12-23 14:41 UTC
From: wdehoog at exalondelft dot nl Assigned:
Status: Closed Package: IMAP related
PHP Version: Irrelevant OS: linux
Private report: No CVE-ID: None
 [2013-12-13 13:32 UTC] wdehoog at exalondelft dot nl
Description:
------------
My php script walks a collection mailboxes to perform an imap_search. When I open each mailbox using imap_open the results are always correct. imap_open however is very slow so I started to use imap_reopen. 

Unfortunately imap_search now often does not find anything anymore. Sometimes it finds them all, sometimes only in some of the mailboxes but most of the time it finds nothing.

Restarting apache or dovecot (imap server) does not make any difference.

Doing an imap_open after 5 times imap_reopen make the script show more results but still not all of them.

Test script:
---------------
$reopened = imap_reopen($stream, $current_mailbox['mailserver'].$val['name'], OP_READONLY);
if($reopened) {
  $emails = imap_search($stream, $imap_pattern, SE_UID);
  ...
}

Expected result:
----------------
bot after imap_open as well as after imap_reopen the imap_search function should be able to find the mails.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-12-23 14:41 UTC] wdehoog at exalondelft dot nl
-Status: Open +Status: Closed
 [2013-12-23 14:41 UTC] wdehoog at exalondelft dot nl
It appeared to be a problem with the dovecot search backend (fts-squat). Sorry for the noise.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 05:01:30 2024 UTC