JBoss is an JEE server. Read up on using JavaMail in JEE.
I also wanted to know how to create mail user accounts and how to store mails.
JEE mail support is for sending mail and receiving POP mail, not for mail storage.
There was a JBoss Mail Server product, now developed by an external company. Look for the Collab server forum for a link.