<?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>Horde/IMP handling of literal strings</title> 
  <pubDate>Fri, 10 Apr 2026 13:09:34 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/292</link> 
  <atom:link rel="self" type="application/rss+xml" title="Horde/IMP handling of literal strings" href="https://bugs.horde.org/ticket/292/rss" /> 
  <description>Horde/IMP handling of literal strings</description> 
 
   
   
  <item> 
   <title>imp 3.2.4, horde 2.2.5, PHP 4.3.6



The messages feed to se</title> 
   <description>imp 3.2.4, horde 2.2.5, PHP 4.3.6



The messages feed to sendmail are:

    From test@mavetju.org  Sun Jun 13 04:45:13 2004

    Return-Path: test@mavetju.org

    To: no quotes &lt;edwin@barnet.com.au&gt;

    Subject: BarNet test - no quotes

    From: no quotes &lt;test@mavetju.org&gt;

    Message-Id: &lt;E1BZDRc-0005l5-75@mavetju.org&gt;

    Date: Sat, 12 Jun 2004 14:41:32 -0400

    

and

    From test@mavetju.org  Sun Jun 13 04:45:13 2004  

    Return-Path: test@mavetju.org

    To: &quot;with quotes&quot; &lt;edwin@barnet.com.au&gt;

    Subject: BarNet test - quotes

    From: &quot;with quotes&quot; &lt;test@mavetju.org&gt;

    Message-Id: &lt;E1BZDRc-0005l5-75@mavetju.org&gt;

    Date: Sat, 12 Jun 2004 14:41:32 -0400

    

The messages are happily stored in on dbmail mail server. Using

horde/imp to access it, I see this in the message overview

    18 04:41:32 no quotes       BarNet test - no quotes 1kb

    19 04:41:32 &quot;with quotes&quot;   BarNet test - quotes    1kb

    

The messages themselves shows up as:

    Date:       Sat, 12 Jun 2004 14:41:32 -0400

    From:       no quotes &lt;test@mavetju.org&gt;

    To:         no quotes &lt;edwin@barnet.com.au&gt;

    Subject:    BarNet test - no quotes

    

And 

    Date:       Sat, 12 Jun 2004 14:41:32 -0400

    From:       &quot;\&quot;with quotes\&quot;&quot; &lt;test@mavetju.org&gt;

    To:         &quot;\&quot;with quotes\&quot;&quot; &lt;edwin@barnet.com.au&gt;

    Subject:    BarNet test - quotes

    

And now the funny thing... this is how the second one shows up with POP3:

    Date:       Sat, 12 Jun 2004 14:41:32 -0400

    From:       with quotes &lt;test@mavetju.org&gt;

    To:         with quotes &lt;edwin@barnet.com.au&gt;

    Subject:    BarNet test - quotes

    

Fetching the messages manually (issuing the commands that IMP sends),

I get this for the first message:

    a0005 FETCH 18:18 (UID ENVELOPE)

    * 18 FETCH (UID 3388805 ENVELOPE (&quot;Sat, 12 Jun 2004 14:41:32 -0400&quot; &quot;BarNet

test - no quotes&quot; ((&quot;no quotes&quot; NIL &quot;test&quot; &quot;mavetju.org&quot;)) ((&quot;no quotes&quot; NIL

&quot;test&quot; &quot;mavetju.org&quot;)) ((&quot;no quotes&quot; NIL &quot;test&quot; &quot;mavetju.org&quot;)) ((&quot;no quotes&quot;

NIL &quot;edwin&quot; &quot;barnet.com.au&quot;)) NIL NIL NIL &quot;&lt;E1BZDRc-0005l5-75@mavetju.org&gt;&quot;))

    a0005 OK FETCH completed



And this for the second message:

    a0005 FETCH 19:19 (UID ENVELOPE)

    * 19 FETCH (UID 3388806 ENVELOPE (&quot;Sat, 12 Jun 2004 14:41:32 -0400&quot; &quot;BarNet test - quotes&quot; (({13}

    &quot;with quotes&quot; NIL &quot;test&quot; &quot;mavetju.org&quot;)) (({13}

    &quot;with quotes&quot; NIL &quot;test&quot; &quot;mavetju.org&quot;)) (({13}

    &quot;with quotes&quot; NIL &quot;test&quot; &quot;mavetju.org&quot;)) (({13}

    &quot;with quotes&quot; NIL &quot;edwin&quot; &quot;barnet.com.au&quot;)) NIL NIL NIL&quot;&lt;E1BZDRc-0005l5-75@mavetju.org&gt;&quot;))

    a0005 OK FETCH completed



Other mail readers (mutt / mozilla) don&#039;t choke on this.



If you need more information on how to debug this problem, feel

free to contact me via email.

</description> 
   <pubDate>Sun, 13 Jun 2004 06:16:16 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/292#t1178</link> 
  </item> 
   
  <item> 
   <title>This is not IMP but your c-client choking on this. Try a dif</title> 
   <description>This is not IMP but your c-client choking on this. Try a different c-client compiled with PHP.</description> 
   <pubDate>Sun, 13 Jun 2004 11:25:20 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/292#t1179</link> 
  </item> 
   
  <item> 
   <title>Thanks for your reply. Although I don&#039;t agree with you yet, </title> 
   <description>Thanks for your reply. Although I don&#039;t agree with you yet, I am willing to try a different c-client. At this moment I&#039;m using cclient-2004, the one from UW. Before that I was using the 2002 version.



For what it is worth, can I point you to the difference in what the first and the second message returns: The first one (without the quotes) returns it as a quoted string (and that goes fine in IMP), the second one returns it as a literal string. It all goes fine and it looks good in the message overview, but the moment it is displayed in the message itself it is shown.



Edwin

</description> 
   <pubDate>Sun, 13 Jun 2004 14:13:46 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/292#t1180</link> 
  </item> 
   
  <item> 
   <title>Sorry for the bad english in the previous comment. Let me tr</title> 
   <description>Sorry for the bad english in the previous comment. Let me try it again.



For what it is worth, can I point you to the difference in what the first and the second message returns: The first one (without the quotes) returns it as a quoted string (and that goes fine in IMP), the second one returns it as a literal string.



It is displayed fine in the message overview, but it is displayed escaped in the message itself.



An other IMAP based mailreader (squirrelmail) doesn&#039;t display this behaviour, which makes me believe it is an IMP issue and not an c-client issue.

</description> 
   <pubDate>Sun, 13 Jun 2004 14:26:45 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/292#t1181</link> 
  </item> 
   
  <item> 
   <title>Squirrelmail doesn&#039;t use PHP&#039;s imap functions (thus c-client</title> 
   <description>Squirrelmail doesn&#039;t use PHP&#039;s imap functions (thus c-client) so that doesn&#039;t say anything.</description> 
   <pubDate>Sun, 13 Jun 2004 17:10:55 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/292#t1182</link> 
  </item> 
   
  <item> 
   <title>But then, please explain why it is displayed fine in the mes</title> 
   <description>But then, please explain why it is displayed fine in the message overview, but it is displayed escaped in the message itself.</description> 
   <pubDate>Mon, 14 Jun 2004 12:53:46 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/292#t1183</link> 
  </item> 
   
  <item> 
   <title>Because it&#039;s different c-client functions involved. But I&#039;m </title> 
   <description>Because it&#039;s different c-client functions involved. But I&#039;m done with this; you asked us for help and have been arguing with our answers ever since without actually trying them. This &quot;bug&quot; stays bogus.</description> 
   <pubDate>Mon, 14 Jun 2004 13:24:42 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/292#t1184</link> 
  </item> 
   
  <item> 
   <title>In imp-3.2.4/message.php, line 527 and around that line:



</title> 
   <description>In imp-3.2.4/message.php, line 527 and around that line:



/* Don&#039;t show addressbook icon on print screen. */

$showIcon = !$printer_friendly;

        

if (isset($h-&gt;date))     $dat = htmlspecialchars(MIME::decode($h-&gt;date));

if (isset($h-&gt;to))       $to  = buildAddressLinks($h-&gt;to, $showIcon);

if (isset($h-&gt;from))     $frm = buildAddressLinks($h-&gt;from, $showIcon);



$h is filled with information from imap_header().

$h-&gt;to is:

    [0] =&gt; stdClass Object

        (

            [personal] =&gt; &quot;with quotes&quot;

            [mailbox] =&gt; edwin

            [host] =&gt; barnet.com.au

        )



Are these double quotes around the value of the &#039;personal&#039; key wrong? Should this be without the double quotes? Does IMP expect it without the double quotes around it?



After the assignment, $to contains the string &#039;&amp;quot;\&amp;quot;with quotes\&amp;quot;&amp;quot; &amp;lt;edwin@barnet.com.au&amp;gt;&#039;. So buildAddressLinks somehow escapes the double quotes in the $h-&gt;to field.



Please note that I&#039;m not angry with any of you guys. I&#039;m just trying to make me see if the values returned by imap_header() are wrong.



Edwin

</description> 
   <pubDate>Mon, 14 Jun 2004 13:42:35 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/292#t1185</link> 
  </item> 
   
  <item> 
   <title>This fixes it in a beautiful way.



imp-3.2.4/lib/IMP.php.
</title> 
   <description>This fixes it in a beautiful way.



imp-3.2.4/lib/IMP.php.



     * @return string  The correctly quoted and escaped string.

     *

     * @since IMP 3.2.2

     */

    function _rfc822Encode($str, $filter = &#039;&#039;)

    {

+        // strip double quotes if they are around the string already.

+        if (substr($str,0,1)==&quot;\&quot;&quot; &amp;&amp; substr($str,-1)==&quot;\&quot;&quot;)

+            $str=substr($str,1,-1);



        $filter .= &quot;()&lt;&gt;@,;:\\\&quot;[]\1\2\3\4\5\6\7\10\11\12\13\14\15\16\17\20\21\2

2\23\24\25\26\27\30\31\32\33\34\35\36\37\177&quot;;

 

        if (strcspn($str, $filter) != strlen($str)) {





Please add this fix. People who use c-clients (like the imap-uw library) which talk to imap servers which do return double quotes around addresses if they were in the original email (like dbmail) would be happy to be able to use Horde without problems.



Edwin

http://www.mavetju.org/

</description> 
   <pubDate>Mon, 14 Jun 2004 14:10:10 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/292#t1186</link> 
  </item> 
   
  <item> 
   <title>Removed the state &quot;bogus&quot;.



The submitted patch seems corr</title> 
   <description>Removed the state &quot;bogus&quot;.



The submitted patch seems correct. Chuck, what do you think about it?</description> 
   <pubDate>Sat, 17 Jul 2004 08:46:17 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/292#t1187</link> 
  </item> 
   
  <item> 
   <title></title> 
   <description></description> 
   <pubDate>Sat, 17 Jul 2004 08:47:30 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/292#t1188</link> 
  </item> 
   
  <item> 
   <title>Fine. Go ahead and take care of it, but don&#039;t touch anything</title> 
   <description>Fine. Go ahead and take care of it, but don&#039;t touch anything in HEAD.</description> 
   <pubDate>Sun, 18 Jul 2004 01:03:44 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/292#t1189</link> 
  </item> 
   
  <item> 
   <title>Thank you!</title> 
   <description>Thank you!</description> 
   <pubDate>Sat, 24 Jul 2004 21:15:26 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/292#t1191</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
