[imp] using hook to generate email address from uid in LDAP nis schema?

Alain Fauconnet alain at ait.ac.th
Thu Oct 20 18:46:33 PDT 2005


Kevin, Shane, thanks for your replies, more below:

On Thu, Oct 20, 2005 at 03:42:00PM -0400, Kevin M. Myer wrote:
> Quoting Shane Williams <broot at ischool.utexas.edu>:
> 
> > On Thu, 20 Oct 2005, Kevin M. Myer wrote:
> >
> >> Quoting Alain Fauconnet <alain at ait.ac.th>:
> >>
> >>
> >> > If I configure ./turba/sources.php with:
> >> >
> >> > $cfgSources['localldap'] = array(
> >> > ...
> >> >    'map' => array(
> >> >        '__key' => 'dn',
> >> >        '__uid' => 'uid',
> >> >        'name' => 'cn',
> >> >        'email' => 'uid',
> >>
> >> Typically, this would be mapped to something like:
> >>
> >>           'email' => 'mail',
> >>
> >> not uid (unless your uids are fully qualified email addresses).
> >
> > The problem is that there is no mail attribute in the NIS schema to
> > map to.  What's needed is a way to add the domain to the uid, which
> > would make it into a "real" email address.  Unfortunately, I'm in the
> > same boat as Alain, so I don't have an answer.
> 
> Well, one possibility is to extend your schema then, to include one 
> that does support a mail attribute.

Well, yes, that's one possibility I have considered of course, but for
the time being, I would rather stick to the default NIS schema (one
reason being that I'm making my first steps in LDAP and pretty much
everything I attempt breaks it :-).

>  You could "fix" it in Horde but 
> you're probably going to want real email addresses in your directory 
> for other apps at some point.

Hmm... yes, could be, up to the point that we have a single domain at
this time, so it's pretty much a constant and therefore "uid" would do
the job if I only I could automagically stick the contents of
'mail_domain' to it.

>  Are the "famous NIS transition scripts 
> and nis.schema" mentioned the PADL MigrationTools or something else?

They are.

> 
> Have a look at the IMP pref for 'mail_domain' as well - that might be 
> helpful, but it won't fix the underlying issue, which is that you don't 
> have a mail attribute in your object in LDAP.

I use this already. That's why when users copy entries from the LDAP
search to their private notebooks, although the e-mail address is
copied without the domain, when they later use this entry to send
e-mail, it works. The To: appears unqualified, but since 'mail_domain'
is set it gets attached to the address when sending. It's just
confusing. OTOH as I mentioned when people compose directly from the
LDAP search list, the To: comes out as "user@" and this is bad.

OK, well, thanks anyway. Re-reading hooks.php makes me think that
there might not be an appropriate hook for this, so I am faced with
the choice of altering my schema or patching Turba during my
"transition period" using this flat LDAP directory and the NIS schema.

Greets,
_Alain_


More information about the imp mailing list