8 messages in org.apache.james.server-userR: Using the API to Dynamically Add U...
FromSent OnAttachments
Don KimApr 12, 2005 9:30 am 
Alan GerhardApr 13, 2005 4:26 pm 
Daniel PerryApr 14, 2005 2:26 am 
Davide Dalla RosaApr 14, 2005 2:41 am 
Daniel PerryApr 14, 2005 2:43 am 
Jason WebbApr 14, 2005 3:38 am 
Steve ShortApr 14, 2005 9:52 am 
John G. NormanApr 16, 2005 4:45 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:R: Using the API to Dynamically Add UsersActions...
From:Davide Dalla Rosa (d.da@pollisrl.it)
Date:Apr 14, 2005 2:41:06 am
List:org.apache.james.server-user

I think a simple solution could be... write a simple appl that performs a socket connection w/ the remote manager, gets the input stream, feeds the latter with the siutable command ("adduser username password") get the output stream, reads from it the answer then close the connection. I suppose this should work whatever the persistence mechanics is... and you can do it whatever your programming language is. Am I that wrong? cheers d.

-----Messaggio originale----- Da: Daniel Perry [mailto:d.pe@netcase.co.uk] Inviato: giovedì 14 aprile 2005 11.27 A: James Users List Oggetto: RE: Using the API to Dynamically Add Users

Are you planning on doing this inside of james? (ie in a mailet) or outside of james (eg webapp)?

From a mailet you can work directly with user repositories. See

commandlistservmanager for an example - it adds users in subscribe-confirm command.

From outside of james, if you use a database, you can add entries directly

(ie using jdbc / any database connectivity provided by other languages).

Not sure how easy it is to work with file repositories from outside of james.

Daniel.

-----Original Message----- From: Don Kim [mailto:dk@compsych.com] Sent: 12 April 2005 17:31 To: serv@james.apache.org Subject: Using the API to Dynamically Add Users

Hi all,

I was looking for some help with user creation in James. I have read the documention that explains how to manage users via the James admin, however, we would like to be able to add users programmatically. Looking at the API, I'm going to assume that I should primarily be concerned with the org.apache.james.userrepository package, but I have a few questions:

1) Does anyone know of a "starting point?"

Right now, I am struggling with basics, such as how do I initiate a connection to the server to even start trying to make modifictions? I guess a parallel to this would be that if I were trying to connect to a DB, I'd be setting up all of the JDBC info. Would I be doing this in the configure() method of one of the user repositories? Or should I be looking elsewhere?

2) Does it matter if I'm using the file system or DB storage methods?

I contacted someone from a James mailing list to ask some basic question (that person had originally been asking if anyone knew of any additional doc/training info/examples). Anyway, this person stated that if I wanted to add users programmatically, that I should go with DB storage. Can anyone comment on this? I see that in the UsersFileRepository class, there is an addUser() method, so I'd assume it didn't matter.

Any help or pointers would be greatly appreciated.

Thanks, Don Kim