[dev] IMAP problem on IMP

Michael M Slusarz slusarz at horde.org
Mon Dec 3 17:55:25 UTC 2007


Quoting Alfonso Marí­n Marí­n <almarin at um.es>:

> Chuck Hagenbuch escribió:
>> Quoting Alfonso Marí­n Marí­n <almarin at um.es>:
>>
>>
>>> I've got a problem trying to connect my IMP installation with a IMAP
>>> server. After digg a bit on the code, i found the reason. A imap_open
>>> call gave me this error:
>>> *  Warning*: Wrong parameter count for imap_open() in
>>> */var/www/consigna/correo/lib/IMAP.php* on line *138
>>>
>>> *My PHP version is 5.2.1, and in that line exists a exception:
>>>
>>>         if (version_compare(PHP_VERSION, '5.2.1') != -1) {
>>>             $ret = imap_open(IMP::serverString($mbox), $this->_user,
>>> $this->_pass, $imap_flags, $_SESSION['imp']['login_tries']);
>>>         } else {
>>>           ...
>>>
>>> If I remove the last $_SESSION parameter everithing work fine. ¿Why do
>>> you use that parameter in PHP 5.2.1?
>>>
>>
>> We *don't* use the parameter in 5.2.1.
>>
> Sorry, but i think you do. My PHP_VERSION is 5.2.1, and version_compare
> return 0, so the routine enters on the first use of imap_open, where you
> use $_SESSION[...] as last paramether.

We do use the parameter in 5.2.1.  However, your version of PHP  
appears to be broken since, directly from the PHP documentation  
(http://us2.php.net/imap_open), $n_retries (the fifth parameter) was  
added in *5.2.0*.

 From PHP CVS logs:
Revision 1.208.2.7.2.8 - (view) (download) (as text) (annotate) -  
[select for diffs]
Sun Nov 5 18:31:41 2006 UTC (12 months, 3 weeks ago) by iliaa
Branch: PHP_5_2
Changes since 1.208.2.7.2.7: +22 -10 lines
Diff to previous 1.208.2.7.2.7 , to branch point 1.208.2.7

Fixed bug #39362 (Added an option to imap_open/imap_reopen to control the
number of connection retries).

michael


-- 
___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the dev mailing list