<?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>store multiple email addresses as separate &#039;mail&#039; attributes in LDAP</title> 
  <pubDate>Fri, 10 Apr 2026 08:50:58 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/9554</link> 
  <atom:link rel="self" type="application/rss+xml" title="store multiple email addresses as separate &#039;mail&#039; attributes in LDAP" href="https://bugs.horde.org/ticket/9554/rss" /> 
  <description>store multiple email addresses as separate &#039;mail&#039; attributes in LDAP</description> 
 
   
   
  <item> 
   <title>My Turba uses an LDAP backend, and I wondered how people cou</title> 
   <description>My Turba uses an LDAP backend, and I wondered how people could have more than one email address. Obviously, LDAP supports multiple &#039;mail&#039; attributes per inetOrgPerson and when setting

  &#039;allow_multi&#039; =&gt; true

in turba/config/attributes.php, they are also treated as separate email addresses and each &#039;mail&#039; entry results in a separate mailto-link in Turba.

However, when editing the email field, there is a comma-separated list of addresses which is written back into LDAP *as is*. This causes problems, because, for example, it&#039;s not possible any more to do an LDAP query with &quot;(mail=address1@host.com)&quot;. Instead, the LDAP backend - just as it converts multiple &#039;mail&#039; attribute values to a PHP array - should act the same when saving, i.e. converting the PHP array (or the comma-separated string) into multiple LDAP attributes.</description> 
   <pubDate>Sun, 30 Jan 2011 15:29:54 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9554#t61684</link> 
  </item> 
   
  <item> 
   <title>Try using the &#039;emails&#039; instead of &#039;email&#039; attribute.</title> 
   <description>Try using the &#039;emails&#039; instead of &#039;email&#039; attribute.</description> 
   <pubDate>Sun, 30 Jan 2011 17:11:57 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9554#t61685</link> 
  </item> 
   
  <item> 
   <title>The behavior of using &#039;emails&#039; is identical to using &#039;email&#039;</title> 
   <description>The behavior of using &#039;emails&#039; is identical to using &#039;email&#039; with &#039;allow_multi&#039;=true for me, i.e. multiple addresses get stored as a comma-separated string in the &#039;mail&#039; attribute in LDAP.</description> 
   <pubDate>Sun, 30 Jan 2011 17:20:56 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9554#t61687</link> 
  </item> 
   
  <item> 
   <title>The problem is that:
1) The email form field always returns</title> 
   <description>The problem is that:
1) The email form field always returns a single value, though we could of course split this up again, or add an option to return an array instead.
2) But more important, there isn&#039;t any way in Turba to store one field into several attributes. We do have composite fields, but these store in a *fixed* number of *different* attributes, not in a *variable* number of the *same* attribute. There is no infrastructure for that at all, so this is a larger undertaking.</description> 
   <pubDate>Fri, 01 Jul 2011 17:24:30 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9554#t66079</link> 
  </item> 
   
  <item> 
   <title>Seeing the first alpha releases of the horde apps, I was won</title> 
   <description>Seeing the first alpha releases of the horde apps, I was wondering if this is gonna be addressed in the next version or not. Multiple emails is a must for many many people I guess. Currently, it is the biggest limitation I have to live with when using horde....</description> 
   <pubDate>Sat, 07 Jul 2012 10:58:50 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9554#t71731</link> 
  </item> 
   
  <item> 
   <title>&gt; 1) The email form field always returns a single value, tho</title> 
   <description>&gt; 1) The email form field always returns a single value, though we 
&gt; could of course split this up again, or add an option to return an 
&gt; array instead.
&gt; 2) But more important, there isn&#039;t any way in Turba to store one 
&gt; field into several attributes. We do have composite fields, but these 
&gt; store in a *fixed* number of *different* attributes, not in a 
&gt; *variable* number of the *same* attribute. There is no infrastructure 
&gt; for that at all, so this is a larger undertaking.

Is this necessary at all? 
As far as I can say, the emails (multi_value) field works fine with IMP and ActiveSync.

It works with ActiveSync in the expected way, the first three email addresses from emails are provided as email1, email2 and email3 to an activesync device and read this way from the device. (three email address are the limit of activesync) 

this happens ins turba/lib/Driver.php at line 2690:
            case &#039;emails&#039;:
                $address = 1;
                foreach (explode(&#039;,&#039;, $value) as $email) {
                    while ($address &lt;= 3 &amp;&amp;
                           $message-&gt;{&#039;email&#039; . $address . &#039;address&#039;}) {
                        $address++;
                    }
                    if ($address &gt; 3) {
                        break;
                    }
                    $message-&gt;{&#039;email&#039; . $address . &#039;address&#039;} = $email;
                    $address++;
                }
                break;

A smiliar code snippet is there for vcards. 

For LDAP I find the &quot;array_merge&quot; inside the _read function off Ldap.php. In funtion _write, there is nothing. 

My suggestions: 

1) generic version
at line 304:
if source is comma seperated array and target mutli value 
for i in array ...
this one might be dangerous with other fields als children/child

2)
Or a hardcoded version just for &quot;emails&quot;
somehow ugly but works and no side effects

3)
in backends.local.php the opportunity/example for 2) 

My php skills are just not good enough at the moment :( </description> 
   <pubDate>Wed, 02 Nov 2016 21:42:40 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9554#t91212</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
