<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>SELECT without \r\n (complaint from imapproxy about imp)</title> 
  <pubDate>Fri, 10 Apr 2026 13:09:13 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/11086</link> 
  <atom:link rel="self" type="application/rss+xml" title="SELECT without \r\n (complaint from imapproxy about imp)" href="https://bugs.horde.org/ticket/11086/rss" /> 
  <description>SELECT without \r\n (complaint from imapproxy about imp)</description> 
 
   
   
  <item> 
   <title>Horde/Imap/Client/Socket.php contains
parseCommandArrayCall</title> 
   <description>Horde/Imap/Client/Socket.php contains
parseCommandArrayCallback 
...
        $this-&gt;_sendLine($data, array(
            &#039;literaldata&#039; =&gt; true,
            &#039;notag&#039; =&gt; true
        ));
...
and function _sendLine does
...
        if (is_resource($data)) {
            rewind($data);
            stream_copy_to_stream($data, $this-&gt;_stream);
        } else {
            fwrite($this-&gt;_stream, $out); // Line 3820
            if (empty($options[&#039;literaldata&#039;])) {
                fwrite($this-&gt;_stream, &quot;\r\n&quot;);
            }
        }

        if ($literalplus || !empty($options[&#039;literaldata&#039;])) {
            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() [&lt;a href=&#039;function.fwrite&#039;&gt;function.fwrite&lt;/a&gt;]: send of 8 bytes failed with errno=32 Broken pipe [pid 26632 on line 3820 of &quot;/usr/lib64/php/Horde/Imap/Client/Socket.php&quot;]
2012-03-18T23:12:10+01:00 DEBUG: HORDE  1. require() /mnt/new/home/htdocs/webmail/imp/index.php:19
 2. IMP_Imap-&gt;openMailbox() /mnt/new/home/htdocs/webmail/imp/mailbox.php:86
 3. IMP_Imap-&gt;__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-&gt;openMailbox()
 6. Horde_Imap_Client_Socket-&gt;_openMailbox() /usr/lib64/php/Horde/Imap/Client/Base.php:889
 7. Horde_Imap_Client_Socket-&gt;_sendLine() /usr/lib64/php/Horde/Imap/Client/Socket.php:876
 8. Horde_Imap_Client_Socket-&gt;_parseResponse() /usr/lib64/php/Horde/Imap/Client/Socket.php:3840
 9. Horde_Imap_Client_Socket-&gt;_getLine() /usr/lib64/php/Horde/Imap/Client/Socket.php:4185
10. Horde_Imap_Client_Socket-&gt;_readData() /usr/lib64/php/Horde/Imap/Client/Socket.php:3913
11. Horde_Imap_Client_Base-&gt;logout() /usr/lib64/php/Horde/Imap/Client/Socket.php:4078
12. Horde_Imap_Client_Socket-&gt;_logout() /usr/lib64/php/Horde/Imap/Client/Base.php:717
13. Horde_Imap_Client_Socket-&gt;_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: &#039;headoffice&#039; (127.0.0.1:54496) on new sd [9]
Mar 18 22:12:10 AEGEEserv in.imapproxyd[25119]: LOGOUT: &#039;headoffice&#039; from server sd [9]
Mar 18 22:12:10 AEGEEserv in.imapproxyd[25119]: LOGIN: &#039;headoffice&#039; (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: &#039;headoffice&#039; from server sd [9]
Mar 18 22:12:10 AEGEEserv in.imapproxyd[25119]: LOGIN: &#039;headoffice&#039; (127.0.0.1:54500) on existing sd [9]
Mar 18 22:12:12 AEGEEserv in.imapproxyd[25119]: LOGOUT: &#039;headoffice&#039; from server sd [9]
Mar 18 22:12:13 AEGEEserv in.imapproxyd[25119]: LOGIN: &#039;headoffice&#039; (127.0.0.1:54501) on existing sd [9]
Mar 18 22:12:14 AEGEEserv in.imapproxyd[25119]: LOGOUT: &#039;headoffice&#039; from server sd [9]

Do you think this error message &quot;Handle_Select_Command: Sanity check failed!  SELECT command from client sd [8] has no CRLF after it.&quot; from imapproxyd is justified and imp sends wrong commands, or imapproxyd behaves incorrectly, and imp is right?</description> 
   <pubDate>Sun, 18 Mar 2012 22:25:58 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11086#t70745</link> 
  </item> 
   
  <item> 
   <title>To further debug this issue, we need details of the IMP -&gt; I</title> 
   <description>To further debug this issue, we need details of the IMP -&gt; IMAP/POP communication.

To enable debugging, see instructions contained in imp/config/backends.php (the &#039;debug&#039; 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).</description> 
   <pubDate>Mon, 19 Mar 2012 21:13:23 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11086#t70765</link> 
  </item> 
   
  <item> 
   <title>Thanks for the hint with the debug information.

The probl</title> 
   <description>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.</description> 
   <pubDate>Thu, 22 Mar 2012 16:05:49 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/11086#t70828</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
