Bug 657962 - The mail_search_full function always returns false
Summary: The mail_search_full function always returns false
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: libc-client
Version: 4.8
Hardware: i386
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Joe Orton
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-28 22:44 UTC by hm2k
Modified: 2015-01-15 12:33 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-20 15:53:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description hm2k 2010-11-28 22:44:18 UTC
Description of problem:
The mail_search_full function always returns false. I'm using an implementation of the libc-client library in php-imap.

I have reported the bug at php.net, but have been advised that the bug lies in this library and should report it to the operating system.

Version-Release number of selected component (if applicable):
2002e

How reproducible:
<pre>
<?php

ini_set('display_errors','On');
error_reporting(E_ALL);

include 'settings.php';

//connect to mailbox
$stream=imap_open('{'.$host.'/imap/notls/norsh/novalidate-cert/readonly}INBOX',$user,$pass,OP_SILENT);
           
echo "imap_mailboxmsginfo->Nmsgs\n";
var_dump(imap_mailboxmsginfo($stream)->Nmsgs);
echo "\n";

$search='ALL';
echo "imap_search $search\n";
var_dump(imap_search($stream,$search)); //bool(false)
if (imap_last_error()) { echo 'Error: '.imap_last_error()."\n"; }
echo "\n";

echo "imap_alerts\n";
var_dump(imap_alerts());
echo "imap_errors\n";
var_dump(imap_errors());

  
Actual results:
imap_mailboxmsginfo->Nmsgs
int(981)

imap_search ALL
bool(false)

imap_alerts
bool(false)
imap_errors
bool(false)

Expected results:
imap_search should return an array of message numbers or UIDs.

If it failed, there should be an error in imap_last_error().

Comment 1 Piradeepan 2011-01-03 23:22:18 UTC
I have the same issue with my SugarCRM. Mailbox Nmsgs returns a positive integer and imap_search always returns false.

Comment 2 Piradeepan 2011-01-04 12:13:05 UTC
I updated my php version from 5.2.10 to 5.3. Now everything is going smoothly..

Comment 3 hm2k 2011-01-04 13:22:09 UTC
I was under the impression that the problem was in the library not PHP itself.

The version of PHP the stream is giving me is currently PHP 5.2.13, what method did you use to install 5.3?

Comment 4 Piradeepan 2011-01-04 16:53:16 UTC
You have to upgrade PHP 5.3.4 using YUM.

You can get as many third party repositories from internet. 

From the downloaded repository, make sure that you update PHP and Mysql alone, to avoid conflict.

Comment 5 hm2k 2011-01-04 17:15:09 UTC
Which repository did you find to work successfully for RHEL4?

I see it in the remi repository.

Comment 6 Piradeepan 2011-01-04 17:41:12 UTC
My OS version is CentOS 5.3.

In my case, remi repository worked out for me.

Give yourself a try, hope it will work.

As far as my research, which lasted for 2 weeks, imap_searh() will work from PHP 5.2.2 or above.

Comment 7 hm2k 2011-01-04 18:33:37 UTC
=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Updating:
 php                     i386       5.3.4-1.el4.remi  remi              1.3 M
 php-cli                 i386       5.3.4-1.el4.remi  remi              2.5 M
 php-common              i386       5.3.4-1.el4.remi  remi              957 k
 php-devel               i386       5.3.4-1.el4.remi  remi              612 k
 php-gd                  i386       5.3.4-1.el4.remi  remi              194 k
 php-imap                i386       5.3.4-1.el4.remi  remi               81 k
 php-ldap                i386       5.3.4-1.el4.remi  remi               51 k
 php-mbstring            i386       5.3.4-1.el4.remi  remi              2.3 M
 php-mcrypt              i386       5.3.4-1.el4.remi  remi               43 k
 php-mysql               i386       5.3.4-1.el4.remi  remi              144 k
 php-odbc                i386       5.3.4-1.el4.remi  remi               79 k
 php-pdo                 i386       5.3.4-1.el4.remi  remi              110 k
 php-pear                noarch     1:1.9.1-6.el4.remi  remi              432 k
 php-soap                i386       5.3.4-1.el4.remi  remi              277 k
 php-xml                 i386       5.3.4-1.el4.remi  remi              206 k
Installing for dependencies:
 libedit                 i386       2.11-1.20080712cvs.el4.remi  remi               69 k
 mysqlclient15           i386       5.0.67-1.el4.remi  remi              1.3 M
Updating for dependencies:
 mysql                   i386       5.1.54-1.el4.remi  remi              1.0 M
 mysql-libs              i386       5.1.54-1.el4.remi  remi              1.7 M
 mysql-server            i386       5.1.54-1.el4.remi  remi              9.8 M

...

It does indeed update php-imap, but not libc-client.

Here's the results:

PHP 5.3.4
imap_mailboxmsginfo->Nmsgs
int(10)

imap_search ALL
bool(false)

imap_alerts
bool(false)
imap_errors
bool(false)

...

There has been no change by upgrading to the latest version of PHP. I propose that the problem may still be in the libc-client library.

Comment 8 Piradeepan 2011-01-04 18:45:29 UTC
Did you restart the httpd service?

Comment 9 hm2k 2011-01-04 21:49:45 UTC
Yes.

It is displaying the version as 5.3.4 as per above.

I did not include the original version as I did not deem it relevant to the issue that I reported.

This is because the issue appears to be in the library, not PHP, or at least that would be my conclusion.

Any further feedback would be useful.

Comment 10 Jiri Pallich 2012-06-20 15:53:15 UTC
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life. 
Please See https://access.redhat.com/support/policy/updates/errata/

If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue.


Note You need to log in before you can comment on or make changes to this bug.