Filtering Active Directory LDAP users based on email domain


This article applies to:

  • Trustwave MailMarshal (SEG)

Question:

  • How do I import email addresses from LDAP for only one domain?

Procedure:

By default a MailMarshal SMTP LDAP connector imports all email addresses in the Mail and proxyAddresses attributes of records. 

You can create a customized LDAP connector that imports only addresses in a certain domain. The instructions below assume that the desired domain is not the primary email address entry for the user records.      

  1. Create a new LDAP connector.
  2. Edit the connector and navigate to the "User Attributes" tab (in some versions, this is found under LDAP Server | Advanced).
  3. In the Email address attributes section, delete the entry mail
  4. Edit the proxyAddresses entry:
    • Match: smtp:(.*)@domain-wanted.com
    • Value: $1@domain-wanted.com
    • (substitute the desired domain name for "domain-wanted.com")
  5. Apply the changes.

Any groups imported through this connector will only include entries which have a secondary ("proxy") SMTP address in the specified domain.

Notes:

  • If you need to include users' primary addresses, you can perform similar filtering on the mail attribute.
  • You can use more than one LDAP connector.

Last Modified 3/1/2020.
https://support.trustwave.com/kb/KnowledgebaseArticle14093.aspx