6.0.0-beta1
7/19/25

[#11086] SELECT without \r\n (complaint from imapproxy about imp)
Summary SELECT without \r\n (complaint from imapproxy about imp)
Queue IMP
Queue Version 5.0.19
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester dpa-bugs (at) aegee (dot) org
Created 03/18/2012 (4871 days ago)
Due
Updated 03/22/2012 (4867 days ago)
Assigned 03/19/2012 (4870 days ago)
Resolved 03/22/2012 (4867 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
03/22/2012 04:23:30 PM Jan Schneider State ⇒ Not A Bug
 
03/22/2012 04:05:49 PM dpa-bugs (at) aegee (dot) org Comment #3 Reply to this comment
Thanks for the hint with the debug information.

The problem was the configured timeout in backends.locals.php and the 
fact, that the user had soo many messages in Inbox, that it took long 
time to transfer the list of the messages to Imp, which led to timeout.

Please close the ticket.
03/19/2012 09:13:23 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
To further debug this issue, we need details of the IMP -> IMAP/POP 
communication.

To enable debugging, see instructions contained in 
imp/config/backends.php (the 'debug' config parameter).

Debugging should not be enabled on a production server,   Attach/post 
only the portion of the log that directly deals with the problem 
reported (it may be simplest to clear the log file and then perform 
the event that causes the error).
03/18/2012 10:25:58 PM dpa-bugs (at) aegee (dot) org Comment #1
Priority ⇒ 1. Low
Patch ⇒ No
Milestone ⇒
Queue ⇒ IMP
Summary ⇒ SELECT without \r\n (complaint from imapproxy about imp)
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
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?

Saved Queries