Serge Knystautas wrote:
>
> ----- Original Message -----
> From: "Mathieu Marache" <[EMAIL PROTECTED]>
> > Sorry for not seing this mailet before... I'm very new to james. But in
> > fact yes it's tring to do the same thing but the mail address to forward
> > to is locate in a LDAP repository. No problem about this unless I want
> > to use the same LDAP Repository that uses james for its UserRepository.
>
> see below
>
> > I've got it running but I needed to implement the Object
> > getAttributes(String name) from UserLDAPReposiroty to send me back some
> > information (the forward address from a user called "name"). Then add a
> > method both to MailContext and James with same prototypes that calls
> > "users.getAttributes" so I could use it from a mailet...
> >
> > I believe this is not very good...
> >
> > Anyway what is the plans with this method getAttributes from
> > UserRepository ? It's not used anywhere ?
>
> The getAttributes method right now is only used to check a password I
> believe (although I haven't looked at the LDAP implementation in detail).
Correct.
>
> You're also asking for possibly some LDAP specific functionality that most
> UserRepository would not have. I think it's best to create a separate set
> of code to access your LDAP server from a mailet rather than trying to piggy
> back on the UserLDAPRepository. Charles Bennett wrote the
> UserLDAPRepository and he can probably help if you want to extend this
> functionality, but I think as a general rule for now, the UserRepository
> shouldn't be part of the mailet API. Maybe we should change that though.
At some point I want to revisit the getAttribute method in
UsersRepository, there are a number of attributes other than passwords
which could be stored.
For now, as Serge suggests, you could just call LDAP from the mailet.
I think you can get to the UsersRepository from an Avalon-aware mailet
by mailetcontext.getAttribute(Constants.AVALON_COMPONENT_MANAGER) then
getComponent(Constants.LOCAL_USERS) with appropriate casts.
Although that doesn't directly help you here.
Charles
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives: <http://www.mail-archive.com/james%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]