[Tickets #11086] SELECT without \r\n (complaint from imapproxy about imp)

bugs at horde.org bugs at horde.org
Sun Mar 18 22:25:59 UTC 2012


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/11086
------------------------------------------------------------------------------
  Ticket             | 11086
  Created By         | dpa-bugs at aegee.org
  Summary            | SELECT without \r\n (complaint from imapproxy about
                     | imp)
  Queue              | IMP
  Version            | 5.0.19
  Type               | Bug
  State              | Unconfirmed
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


dpa-bugs at aegee.org (2012-03-18 22:25) wrote:

Horde/Imap/Client/Socket.php contains
parseCommandArrayCallback
...
         $this->_sendLine($data, array(
             'literaldata' => true,
             'notag' => true
         ));
...
and function _sendLine does
...
         if (is_resource($data)) {
             rewind($data);
             stream_copy_to_stream($data, $this->_stream);
         } else {
             fwrite($this->_stream, $out); // Line 3820
             if (empty($options['literaldata'])) {
                 fwrite($this->_stream, "\r\n");
             }
         }

         if ($literalplus || !empty($options['literaldata'])) {
             return;
         }
...
which might lead to a situation, where fwrite does not concatenate  
\r\n at the end of the send command.  Or at least I see in the horde  
logs the message:

2012-03-18T23:12:10+01:00 NOTICE: HORDE [imp] PHP ERROR: fwrite() [<a  
href='function.fwrite'>function.fwrite</a>]: send of 8 bytes failed  
with errno=32 Broken pipe [pid 26632 on line 3820 of  
"/usr/lib64/php/Horde/Imap/Client/Socket.php"]
2012-03-18T23:12:10+01:00 DEBUG: HORDE  1. require()  
/mnt/new/home/htdocs/webmail/imp/index.php:19
  2. IMP_Imap->openMailbox() /mnt/new/home/htdocs/webmail/imp/mailbox.php:86
  3. IMP_Imap->__call() /mnt/new/home/htdocs/webmail/imp/mailbox.php:86
  4. call_user_func_array() /mnt/new/home/htdocs/webmail/imp/lib/Imap.php:343
  5. Horde_Imap_Client_Base->openMailbox()
  6. Horde_Imap_Client_Socket->_openMailbox()  
/usr/lib64/php/Horde/Imap/Client/Base.php:889
  7. Horde_Imap_Client_Socket->_sendLine()  
/usr/lib64/php/Horde/Imap/Client/Socket.php:876
  8. Horde_Imap_Client_Socket->_parseResponse()  
/usr/lib64/php/Horde/Imap/Client/Socket.php:3840
  9. Horde_Imap_Client_Socket->_getLine()  
/usr/lib64/php/Horde/Imap/Client/Socket.php:4185
10. Horde_Imap_Client_Socket->_readData()  
/usr/lib64/php/Horde/Imap/Client/Socket.php:3913
11. Horde_Imap_Client_Base->logout()  
/usr/lib64/php/Horde/Imap/Client/Socket.php:4078
12. Horde_Imap_Client_Socket->_logout()  
/usr/lib64/php/Horde/Imap/Client/Base.php:717
13. Horde_Imap_Client_Socket->_sendLine()  
/usr/lib64/php/Horde/Imap/Client/Sock\et.php:665
14. fwrite() /usr/lib64/php/Horde/Imap/Client/Socket.php:3820
15. Horde::errorHandler()

I use imapproxyd between IMP and cyrus imap, and in imapproxyd logs at  
the same time:

Mar 18 22:12:09 AEGEEserv in.imapproxyd[25119]: LOGIN: 'headoffice'  
(127.0.0.1:54496) on new sd [9]
Mar 18 22:12:10 AEGEEserv in.imapproxyd[25119]: LOGOUT: 'headoffice'  
from server sd [9]
Mar 18 22:12:10 AEGEEserv in.imapproxyd[25119]: LOGIN: 'headoffice'  
(127.0.0.1:54498) on existing sd [9]
Mar 18 22:12:10 AEGEEserv in.imapproxyd[25119]: Handle_Select_Command:  
Sanity check failed!  SELECT command from client sd [8] has no CRLF  
after it.
Mar 18 22:12:10 AEGEEserv in.imapproxyd[25119]: LOGOUT: 'headoffice'  
from server sd [9]
Mar 18 22:12:10 AEGEEserv in.imapproxyd[25119]: LOGIN: 'headoffice'  
(127.0.0.1:54500) on existing sd [9]
Mar 18 22:12:12 AEGEEserv in.imapproxyd[25119]: LOGOUT: 'headoffice'  
from server sd [9]
Mar 18 22:12:13 AEGEEserv in.imapproxyd[25119]: LOGIN: 'headoffice'  
(127.0.0.1:54501) on existing sd [9]
Mar 18 22:12:14 AEGEEserv in.imapproxyd[25119]: LOGOUT: 'headoffice'  
from server sd [9]

Do you think this error message "Handle_Select_Command: Sanity check  
failed!  SELECT command from client sd [8] has no CRLF after it." from  
imapproxyd is justified and imp sends wrong commands, or imapproxyd  
behaves incorrectly, and imp is right?





More information about the bugs mailing list