[Tickets #14097] Re: PHP WARNING in Horde_Imap_Client_Socket::listMailbox
noreply at bugs.horde.org
noreply at bugs.horde.org
Tue Sep 1 18:54:26 UTC 2015
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: https://bugs.horde.org/ticket/14097
------------------------------------------------------------------------------
Ticket | 14097
Updated By | nicolas.vanheu at gmail.com
Summary | PHP WARNING in Horde_Imap_Client_Socket::listMailbox
Queue | Horde Framework Packages
Type | Bug
State | Unconfirmed
Priority | 2. Medium
Milestone |
Patch |
Owners |
------------------------------------------------------------------------------
nicolas.vanheu at gmail.com (2015-09-01 18:54) wrote:
Stacktrace :
HP 7. Horde_Imap_Client_Base->listMailboxes()
/srv/kronos/crm/modules/Mail/Tool/DeliverMail.inc.php:368
PHP 8. Horde_Imap_Client_Socket->_listMailboxes()
/srv/kronos/crm/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php:1404
PHP 9. Horde_Imap_Client_Socket->_getMailboxList()
/srv/kronos/crm/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php:1375
PHP 10. Horde_Imap_Client_Socket->_prepareStatusResponse()
/srv/kronos/crm/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php:1542))
msg 17/17 (718 bytes), delivery error (command tool 16042 error (1,
ERROR Error during HTTP deliver mail : PHP Warning: Invalid argument
supplied for foreach() in
/srv/kronos/crm/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php on line
1793
> Calling Horde_Imap_Client_Socket::listMailboxes($dest_mailbox,
> Horde_Imap_Client::MBOX_ALL, ['status' =>
> Horde_Imap_Client::STATUS_MESSAGES |
> Horde_Imap_Client::STATUS_UNSEEN |
> Horde_Imap_Client::STATUS_UIDNEXT]); when the imap server does not
> have the capability LIST-STATUS ($this->_capability('LIST-STATUS')
> returns false) raise a php warning.
>
> Simple fix would be to initialize $status_opts = array(); before the if.
>
> Revelant piece of code :
> /* LIST-STATUS does NOT depend on LIST-EXTENDED. */
> if (!empty($options['status']) &&
> $this->_capability('LIST-STATUS')) {
> $available_status = array(
> Horde_Imap_Client::STATUS_MESSAGES,
> Horde_Imap_Client::STATUS_RECENT,
> Horde_Imap_Client::STATUS_UIDNEXT,
> Horde_Imap_Client::STATUS_UIDVALIDITY,
> Horde_Imap_Client::STATUS_UNSEEN,
> Horde_Imap_Client::STATUS_HIGHESTMODSEQ
> );
>
> $status_opts = array();
> foreach (array_intersect($this->_statusFields,
> $available_status) as $key => $val) {
> if ($options['status'] & $val) {
> $status_opts[] = $key;
> }
> }
>
> if (count($status_opts)) {
> $return_opts->add(array(
> 'STATUS',
> new Horde_Imap_Client_Data_Format_List(
> array_map('Horde_String::upper', $status_opts)
> )
> ));
> }
> }
>
> Tested with courier-imap.
More information about the bugs
mailing list