Stefano Bagnara wrote: > > > I need more information. > > As far as I know aliasing and forwarding is available only > when the user > is a JamesUser. > > The "UsersRepositoryAliasingForwarding" mailet is a mailet > that compose > the "old" LocalDelivery mailet. I introduced it during a > refactoring a > few months ago. > > 1) We should add a check: if the user is not a JamesUser we > simply skip > the aliasing/forwarding block, so we avoid the ClassCast. > > But the problem is not so easy, and is not really there. The > problem is > probably in a refactoring I did 2 months ago to avoid the use of > deprecated methods. > > Before my refactoring, when adding users using RemoteManager the > remoteManager called the MailServer.addUser method if you were on the > localusers, otherwise it create new DefaultUser. the > James.addUser was > instead creating a DefaultJamesUser by default. > > In fact this is not so correct: the best way would be to invoke the > usersRepository.addUser method directly without using the DefaultUser > object from RemoteManager. > > This is easy but is not a solution again. > > The UsersFileRepository.addUser(username, password) method, creates > DefaultUsers and not DefaultJamesUsers by default. > > One of the refactoring I planned for 2.4 was the > UsersRepository/Authentication one, so this will be fixed for 2.4 > anyway, but we should also decide what to do for 2.3. > > I would do at least: > a. Add a check to UsersRepositoryAliasingForwarding to skip non > JamesUsers (easy bugfix) > b. Change the remotemanager to user the > usersRepository.addUser(username, password) instead of creating a > DefaultUser and use the usersRepository.addUser(user).
Yes. > Then we have further options: > c1. do nothing else: we work differently from james 2.2 because newly > created users for FileUsersRepository will not support > aliasing/forwarding. > c2. we can change the FileUsersRepository.addUser method to create > DefaultJamesUsers by default > c3. we can add a FileJamesUsersRepository identical to the > FileUsersRepository but creating DefaultJamesUsers by default and put > either put it as default in the config.xml or as an option. > > My preference is for c2 or for c3 (adding it as the default). As FileUsersRepository has no purpose without the c2 changes, I would go for c2. c3 is more symmetric in its naming but makes FileUsersRepository redundant and forces yet another configuration change. > > I can do this tonight or tomorrow but I don't know if we > should stop the > a3 release or do it anyway letting users know it has critical > bugs with > file based users repository. > > My preference is to release the a3 anyway: if we never release we'll > always find similar bugs the day we vote for the following release :-( Personally, I'ld say this is a rather critical bug as aliasing/forwarding is one of the core usages of James. I don't think we should ever knowingly do a release that reduces our core functionality. Cheers -- Steve --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]