# Find any vhost with a name or alias matching the domain of the e-mail
# address.  We're queried with an entire e-mail address, but are only
# interested in checking whether the domain portion corresponds to a
# vhost; we'll simply deliver any mail for the vhost to its owner, regardless
# of the lefthand side of the address.  %d extracts only the domain.
# We don't match the scripts.mit.edu vhost here because we don't want
# to first resolve an arbitrary address to a scripts account, and then
# end up sending their mail to the owners of the scripts.mit.edu vhost.
# Once we've found the scriptsVhost object corresponding to the domain
# the e-mail is for, we recursively search the suffix for the vhost's
# scriptsVhostAccount, and take the uid from that object.  This uid is
# the name of the locker that owns the vhost.  Protocol version 3 is
# necessary to use ldapi.

server_host = ldapi://%2fvar%2frun%2fdirsrv%2fslapd-scripts.socket/
search_base = ou=VirtualHosts,dc=scripts,dc=mit,dc=edu
query_filter = (&(objectClass=scriptsVhost)(|(scriptsVhostName=%d)(scriptsVhostAlias=%d))(!(scriptsVhostName=scripts.mit.edu)))
result_attribute = uid
special_result_attribute = scriptsVhostAccount
bind = no
version = 3

