title: LDAP search for user with repeating attribute
body: <p>I'm relatively new to LDAP and I am trying to figure out how I can search for a user who has multiple of the same attribute.</p>
  
  <p>For example I have two users configured like this:</p>
  
  <pre><code>dn: uid=test1,ou=users,dc=domain,dc=com
  mail: test1@domain.com
  mail: test-manager@domain.com
  
  dn: uid=test2,ou=users,dc=domain,dc=com
  mail: test2@domain.com
  </code></pre>
  
  <p>Is there a way that I can identify that test1 has more than one mail attributes and return just that user? So essentially, what should the query be in the ldapsearch command below?</p>
  
  <pre><code>ldapsearch -x -H ldap://ldap.domain.com -L -b 'dc=domain,dc=com' '&lt;query to identify users with more than one mail&gt;'
  </code></pre>
  
  <p>By the way I did find this question <a href="https://stackoverflow.com/questions/19818208/ldap-filter-to-search-for-multiple-values-for-an-attribute">ldap filter to search for multiple values for an attribute</a>, but I don't think it was answered satisfactorily.</p>