Alias file LDAP URL alias values

An alias value (that is, the right hand side of an alias definition) may be specified either as an address directly, e.g.,     ,  or indirectly referencing  an LDAP URL---specifically, an LDAP search URL---that returns one or  more addresses. The format is alias: &#x3c;ldap-url Note that this is just a special case of use of an LDAP URL for a mailing list definition, as mentioned in  Alias file mailing list aliases:  the LDAP query  URL may be such as to return only one address rather than multiple  addresses, and all of the optional mailing list parameters are omitted. Also note that if desiring to look up all incoming local channel addresses in an LDAP directory using some consistent addressing and URL  format, it is generally simpler to configure such lookups globally  using the    options. However, the special case of looking up just a few individual local channel addresses in an LDAP directory via their own  individual LDAP query URLs is of sufficient interest to warrant further  discussion.

Standard LDAP URLs are used, typically with the host and port omitted; the host and part are instead typically specified with the    and    MTA options. (As of Messaging Server 7.0u4, the LDAP server host and port may instead be specified in the LDAP URL itself.) That is, the LDAP URL would typically be specified as ldap:///dn&#x5b;?attributes&#x5b;?scope?filter&#x5d;&#x5d; where the square bracket characters   and   shown above indicate optional portions of the  URL. The   is required and is a distinguished name specifying the search base. The optional  ,  , and    portions of the URL further refine what  information to return. For an alias, the desired   to specify returning would typically  be the   attribute (or some similar attribute). The   may be any of   (the  default), , or. And the desired   might be to request the return of any  object that has the "objectclass=person" and "cn=John  Smith" attribute-value pairs.

For instance, at a site domain.com with an LDAP server running on port 389 of the system ldap.domain.com, the MTA option file might have the  lines LDAP_HOST=ldap.domain.com LDAP_PORT=389 set, and an alias file line might appear as: John.Smith@domain.com: &#x3c;ldap:///o=domain.com?mail?sub?(&(objectClass=person)(cn=John%20Smith)) The Unified Configuration equivalent would be: msconfig&#x3e; show ldap_host role.mta.ldap_host = ldap.domain.com msconfig&#x3e; show ldap_port role.mta.ldap_port = 389 msconfig&#x3e; set alias:John\.Smith@domain\.com.alias_entry &#x27;&#x3c;ldap:///o=domain.com?mail?sub?(&(objectClass=person)(cn=John%20Smith)&#x27; msconfig&#x3e; show alias:John\.Smith@domain\.com role.alias:John\.Smith@domain\.com.alias_entry = &#x3c;ldap:///o=domain.com?mail?sub?(&(objectClass=person)(cn=John%20Smith)) Note that certain characters, such as for instance space characters, should be encoded in URLs according to the URL character encoding rules  of RFC 1738.

See also:
 * Alias file mailing list aliases
 * alias_url0 MTA Option
 * ldap_host MTA Option
 * ldap_port MTA Option
 * Defining membership of large lists
 * Alias file format