On Mon, Apr 09, 2001 at 09:15:55AM -0400, Marc Tardif wrote:
> True, speed of transformation could be an issue for some. On the other
> hand, using regexp would defeat the purpose of LDAP.
Note that I did not say anything about LDAP. I said that a generic mapping
layer might be useful. An LDAP-only solution you suggested might solve
your current problems, but not everybody is using (or wants to use) LDAP.
LDAP support would be _one_ backed for that layer; regexp matching would
be another backend and so on. What I would like to see is the possibility
to say "look at these regexps and if one matches, apply the associated
transformation; if none of them matched, try this LDAP lookup and use the
returned attribute value; if no entries found, look at this other LDAP
lookup or other regexp table" and so on. Look at the dict_* functions in
Postfix, I think they solved it quite nicely.
So I'd suggest something like this:
username_mailbox_trans: regex:/etc/cyrus/username_mapping, ldap:imap_ldap,
regex:/etc/cyrus/username_mapping2
imap_ldap is your example; /etc/cyrus/username_mapping could contain
.*@foo1.com [EMAIL PROTECTED]/_foo1_com/
.*@bar1.org s/@bar1_org/_bar1_org/
[EMAIL PROTECTED] would fall over the first map and generate an LDAP lookup
that you described; if that also fails, username_mapping2 could contain
some defaults etc.
Gabor
--
Gabor Gombas Eotvos Lorand University
E-mail: [EMAIL PROTECTED] Hungary