I recently finished an implementation of sendmail/mimedefang/maildrop
with virtual users in LDAP all mapped to a single local user. In order
to accomplish this I added some functionality to maildrop which is
included in the patch attached to this email.
In short this patch allows users to be looked up in an LDAP server and
mapped to a single local virtual user with mail delivered into virtual
mailboxes in home directories. This enables the LDAP record to remain
untouched while delivering mail to locations other than the users home
directory.
The patch adds the following configuration options to
maildropldap.config so that it can be used:
# VIRTUAL HOSTING OPTIONS
#
# map_virtual_user - if set, maps all users to the default_uid/gid
below, ignori
ng
# their uid/gid number in the ldap entry. This enables all mailboxes to
be
# owned by a single local user.
#map_virtual_user 1
# homedirectory_prefix - if set, home directories are constructed by
appending
# the uid to this prefix instead of looking them up.
#homedirectory_prefix /var/mail/virtual
# homedirectory_create - create the home directory if it doesn't exist.
This is
# done in the ldap code since the rest of maildrop relies on being able
to acces
s
# the home directory.
#homedirectory_create 1
# maildir_prefix - location of the users maildir from their home
directory
# disable to lookup the maildir in the ldap server.
#maildir_prefix ./Maildir
The patch can be applied using a standard: 'patch -p0 <
ldap-ext-1.6.0-1.0.0.patch' against the root of the maildrop 1.6.0
sourcetree.