<?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>Sending mail to contact lists doesn&#039;t work</title> 
  <pubDate>Fri, 10 Apr 2026 07:55:27 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/6732</link> 
  <atom:link rel="self" type="application/rss+xml" title="Sending mail to contact lists doesn&#039;t work" href="https://bugs.horde.org/ticket/6732/rss" /> 
  <description>Sending mail to contact lists doesn&#039;t work</description> 
 
   
   
  <item> 
   <title>If I create a contact list in Turba and add the list as the </title> 
   <description>If I create a contact list in Turba and add the list as the recipient in IMP compose window, what ends up in the To: header is something like &quot;listname: address1@foo.tld, address2@bar.tld, address3@baz.tld;&quot; - if I add another list from address book, it goes to the end of the previous one, separated by a comma (so there&#039;ll be a semicolon and a comma in the middle). If I try to send the message, it fails - SMTP server complains about missing RCPT (5.0.0). I looked for the bug in Compose.php - apparently, the recipientList function receives the string as-is in $hdr[&#039;to&#039;], and the  $arr = array_filter(array_map(&#039;trim&#039;, MIME::rfc822Explode($hdr[$key], &#039;,&#039;))); ends up having as array items the &quot;listname: address1@foo.tld, address2@bar.tld, address3@baz.tld;&quot; parts (first item would be &quot;listname: address1@foo.tld, address2@bar.tld, address3@baz.tld;&quot;

and second item would be &quot;listname2: address4@foo.tld, address5@bar.tld, address6@baz.tld;&quot; if the original to header would&#039;ve been &quot;listname: address1@foo.tld, address2@bar.tld, address3@baz.tld;, &quot;listname2: address4@foo.tld, address5@bar.tld, address6@baz.tld;&quot;. These items then get fed to IMP::parseAddressList(), which results in an object with the empty string in $ob-&gt;mailbox and the default sender domain in $ob-&gt;host... So each contact list ends up as &quot;@&lt;default domain&gt;&quot;. I wonder which part in the control chain should parse the &quot;listname: address1@foo.tld, address2@bar.tld, address3@baz.tld;&quot; parts..</description> 
   <pubDate>Wed, 21 May 2008 09:35:32 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6732#t45425</link> 
  </item> 
   
  <item> 
   <title>Some more info... apparently, the Horde/pear/Mail/RFC822.php</title> 
   <description>Some more info... apparently, the Horde/pear/Mail/RFC822.php / parseAddressList method works slightly differently from what it used to, say, in Horde 3.1.5, at least it seems that it doesn&#039;t succeed in parsing the &quot;list: mm@a.tld, nn@b.tld;&quot; type address entries any more (with the same options, that is, $nest_groups,$validate,$limit all false).</description> 
   <pubDate>Wed, 21 May 2008 15:55:01 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6732#t45443</link> 
  </item> 
   
  <item> 
   <title>&gt; Some more info... apparently, the Horde/pear/Mail/RFC822.p</title> 
   <description>&gt; Some more info... apparently, the Horde/pear/Mail/RFC822.php / 

&gt; parseAddressList method works slightly differently from what it used 

&gt; to, say, in Horde 3.1.5, at least it seems that it doesn&#039;t succeed in 

&gt; parsing the &quot;list: mm@a.tld, nn@b.tld;&quot; type address entries any more 

&gt; (with the same options, that is, $nest_groups,$validate,$limit all 

&gt; false).



...wrong guess... apparently, either IMP::parseAddressList or Compose::recipientList should be able to handle two types of return array objects, namely, plain address objects (which have members &quot;mailbox&quot; and &quot;host&quot;) AND group objects (which have a member &quot;addresses&quot; which seem to have the &quot;mailbox&quot; and &quot;host&quot; members)...

</description> 
   <pubDate>Thu, 22 May 2008 10:35:31 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6732#t45457</link> 
  </item> 
   
  <item> 
   <title>&gt; ...wrong guess... apparently, either IMP::parseAddressList</title> 
   <description>&gt; ...wrong guess... apparently, either IMP::parseAddressList or 

&gt; Compose::recipientList should be able to handle two types of return 

&gt; array objects, namely, plain address objects (which have members 

&gt; &quot;mailbox&quot; and &quot;host&quot;) AND group objects (which have a member 

&gt; &quot;addresses&quot; which seem to have the &quot;mailbox&quot; and &quot;host&quot; members)...



...OK, the RFC822::parseAddressList() method works as before, but it was called with a null nest_groups argument when it should&#039;ve been false (in IMP::parseAddressList). Patch attached; everything seems to work, at least for me. Sorry for spamming you...

</description> 
   <pubDate>Thu, 22 May 2008 11:39:34 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6732#t45458</link> 
  </item> 
   
  <item> 
   <title>That doesn&#039;t look correct, because a comma shouldn&#039;t be adde</title> 
   <description>That doesn&#039;t look correct, because a comma shouldn&#039;t be added after the semicolon in the first place. How do you add the distributions lists, with auto-completion or with the address book popup?

I&#039;m pretty confident that we already fixed this at least in one place in the past.</description> 
   <pubDate>Thu, 22 May 2008 14:37:33 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6732#t45462</link> 
  </item> 
   
  <item> 
   <title>&gt; That doesn&#039;t look correct, because a comma shouldn&#039;t be ad</title> 
   <description>&gt; That doesn&#039;t look correct, because a comma shouldn&#039;t be added after 

&gt; the semicolon in the first place. How do you add the distributions 

&gt; lists, with auto-completion or with the address book popup?

&gt; I&#039;m pretty confident that we already fixed this at least in one place 

&gt; in the past.



Both. But I&#039;ve mostly tried with just one distribution list, which doesn&#039;t result in a comma anywhere, and it was broken the way I mentioned (before I changed the one line I mentioned in IMP.php). (Now that I&#039;ve changed that line, everything works, whether there is a comma after the semicolon or not - and it should work, too, because that&#039;d mean that there is only an empty address between the distribution list and the next address.)</description> 
   <pubDate>Thu, 22 May 2008 14:54:47 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6732#t45463</link> 
  </item> 
   
  <item> 
   <title>...to be more exact, the real problem appeared to be that in</title> 
   <description>...to be more exact, the real problem appeared to be that in Compose.php method recipientList it is assumed that the IMP::parseAddressList($email) in line 1149 (or thereabouts) would return the recipient addresses in flat format (that is, it would return an array of objects which would each have the properties mailbox and host, as assumed in line 1155 and later on). However, my apache error_log ended up with error messages such as &quot;PHP Notice:  Undefined property:  stdClass::$mailbox in /var/www/html/horde/imp/lib/Compose.php on line 1155&quot;. This would mean that for each contact list, we&#039;d end up with addresses with an empty mailbox part and the default domain as the host part. And the reason appeared to be that the IMP::parseAddressList would return contact list type addresses in the nested form, that is, the returned objects in the array would have properties such as groupname and addresses, the latter of which would contain an array of the kind of objects that the recipientList method was expecting. Looking at IMP.php line 435 in method parseAddressList, you can see that $parser-&gt;parseAddressList was called with null as the third argument. Now, the third argument should be a boolean telling whether we want the group (contact list) addresses in flat format or in the nested format. And null is not a false value in php. When I changed that null to false (as in the patch I submitted previously), parser-&gt;parseAddressList started giving contact list parses in the flat format, and everything started to work.</description> 
   <pubDate>Thu, 22 May 2008 16:27:38 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6732#t45465</link> 
  </item> 
   
  <item> 
   <title>I&#039;m almost with you, but null _is_ a false value in PHP, and</title> 
   <description>I&#039;m almost with you, but null _is_ a false value in PHP, and further, if you look at Mail/RFC822.php, $nest_groups is given a default value of null.</description> 
   <pubDate>Fri, 23 May 2008 19:29:16 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6732#t45510</link> 
  </item> 
   
  <item> 
   <title>oh, i see, if it&#039;s null, RFC822 uses the default class value</title> 
   <description>oh, i see, if it&#039;s null, RFC822 uses the default class value, which is true. But we check for groupname, which is only set if $nest_groups is true.</description> 
   <pubDate>Fri, 23 May 2008 19:34:08 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6732#t45511</link> 
  </item> 
   
  <item> 
   <title>This commit:

http://cvs.horde.org/diff.php?r1=1.297&amp;r2=1.29</title> 
   <description>This commit:

http://cvs.horde.org/diff.php?r1=1.297&amp;r2=1.298&amp;f=imp%2Flib%2FCompose.php



... broke it. IMP_Compose::recipientList() doesn&#039;t understand groups, and now it tries to rewrite the headers, thus, groups get broken. The foreach loop around line 1155 needs to be changed to handle groupname being set on $ob.</description> 
   <pubDate>Fri, 23 May 2008 19:48:34 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6732#t45512</link> 
  </item> 
   
  <item> 
   <title>I really don&#039;t want to release with this an issue, so I&#039;m go</title> 
   <description>I really don&#039;t want to release with this an issue, so I&#039;m going to take a shot at it.</description> 
   <pubDate>Sun, 25 May 2008 16:18:31 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6732#t45583</link> 
  </item> 
   
  <item> 
   <title>Please test this commit:

http://lists.horde.org/archives/cv</title> 
   <description>Please test this commit:

http://lists.horde.org/archives/cvs/Week-of-Mon-20080519/078884.html</description> 
   <pubDate>Sun, 25 May 2008 17:12:47 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6732#t45585</link> 
  </item> 
   
  <item> 
   <title>Fixed.</title> 
   <description>Fixed.</description> 
   <pubDate>Sun, 25 May 2008 18:16:42 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6732#t45587</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
