1 Date: Thu, 6 Aug 1998 16:51:07 -0700
2 From: Stuart Lynne <sl@poste.com>
4 And of course it is possible to do a very interesting solution to
5 this [virtual domains] using LDAP.
7 Selected portions of my configuration using LDAP:
11 # ensure we don't attempt delivery unless MX points to this host
17 # punt to director if MX points to this host
25 # lookup virtual users in directory IFF MX matches "virtual..fireplug.net"
26 virtual_fireplug_net_aliasfile_ldap:
27 condition = "${if match{$self_hostname}{virtual..fireplug.net}{$domain}}"
31 errors_to = sl@whiskey.poste.com
32 queries = "ldap:://wilt.fireplug.net/?mailforwardingaddress?sub?(&(mail=$local_part@$domain)(ou=accounts)):\
33 ldap:://wilt.fireplug.net/?mailforwardingaddress?sub?(&(mail=\\\\2a@$domain)(ou=accounts))"
35 # specify vacation processing IFF prefix of address is "vacation-"
37 condition = "${if match{$local_part}{.*%.*}{$domain}}"
40 transport = vacation_delivery
41 new_address = "${if match{$local_part}{(.*)%.*}{$1}{$domain}}@${if match{$local_part}{.*%(.*)}{$1}{$domain}}"
43 # specify delivery to pop mailbox IFF prefix of address is "pop-"
45 condition = "${if match{$local_part}{.*%.*}{$domain}}"
48 transport = pop_delivery
49 new_address = "${if match{$local_part}{(.*)%.*}{$1}{$domain}}@${if match{$local_part}{.*%(.*)}{$1}{$domain}}"
51 # specify delivery to imap mailbox IFF prefix of address is "imap-"
53 condition = "${if match{$local_part}{.*%.*}{$domain}}"
56 transport = imap_delivery
57 new_address = "${if match{$local_part}{(.*)%.*}{$1}{$domain}}@${if match{$local_part}{.*%(.*)}{$1}{$domain}}"
62 # perform delivery to pop mailbox
67 file = /var/mail/${domain}/${lc:$local_part}
71 # perform delivery to imap mailbox
79 directory = "/var/imap/${domain}/${length_2:${lc:$local_part}}/${lc:$local_part}/INBOX"
83 # perform vacation processing
86 file = /etc/exim/vacation-msg.txt
91 subject = "Autoreply: Vacation message for ${local_part}@${domain}"
92 headers = "Mime-Version: 1.0\nContent-Type: multipart/mixed; boundary=\"m1Stw9KgbdL9/HM9\""
93 text = "--m1Stw9KgbdL9/HM9\nContent-Type: text/plain; charset=us-ascii\n\
94 Content-Disposition: attachment; filename=\"${local_part}@${domain} vacation message\"\n\
95 \n\n${expand:${lookup ldap\
96 {ldap://src.fireplug.net/?mailAutoReplyText?sub?(&(mail=${local_part}@${domain})(ou=accounts))}{$value}{}}}\n\
97 \n--\n${local_part}@${domain}\n\n"
98 log = "/var/mail/${domain}/${local_part}_vlog"
99 once = "/var/mail/${domain}/${local_part}_vdb"
102 To use this we have LDAP entries for each user that look something like:
106 objectclass: mailRecipient
107 objectclass: fireMessagingUser
109 objectclass: organizationalPerson
110 objectclass: inetorgPerson
111 objectclass: fireNewsAccess
112 uid: richard@big-cats.com
113 mail: richard@big-cats.com
114 mailforwardingaddress: richard@poste.com
115 mailforwardingaddress: vacation-richard%fireplug.net@popserver.fireplug.net
116 mailforwardingaddress: richard%fireplug.net@popserver.fireplug.net
117 userpassword: abcedfg
120 mailautoreplytext: I'm on vacation
122 The exim ldap lookup simply finds the entry based on the mail attribute
123 and returns the mailforwardingaddress attribute value.
125 This can take several forms and is multi-valued. For example:
128 deliver somewhere else, in this case to another
129 address on another server
131 pop-richard%big-cats.com@popserver.fireplug.net
132 deliver into pop mailbox in virtual host directory
133 for big-cats.com on server popserver.fireplug.net
135 vacation-richard%big-cats.com@popserver.fireplug.net
136 perform vacation processing for user
138 This setup has the interesting property that we can setup multiple
139 mailbox servers with identical configuration files that will all
140 deliver mail to mailboxes they are told to deliver to or will forward
141 to the correct server for the mailbox. All of the interesting
142 information about where to deliver mail for a user is in the LDAP
145 In other words, not only can a single host act as a server for
146 multiple virtual domains, but all of the virtual domains can have
147 mailboxes spread across a number of physical servers.