Yes the current web hosting does come with an SMTP server. The issue I would have using this and actually setting up email addresses is that this would require someone to manually create / delete accounts as and when required (which could become quite time consuming longer term). So by having the virtual email addresses, which are acting as a 'catch-all' for all mails where no mailbox is configured, then I can programatically/DB control adding/deleting new virtual email accounts, which all forward the emails on to a users personal email address (which can also be updated via a webapp).
Since JavaMail doesn't have any functions to add/delete email accounts to the email server, or change passwords, then this is not suitable as I want everything to be controlled via a web app.
Although after having a good think about alternative solutions, I believe something like this could work....
1) Forward all 'virtual' email accounts to a single real email address -
allemails@example.com
2) Use JavaMail to 'listen' to any new messages that come in
3) Use JavaMail to read the headers of the email, one of which being the original email address the message was supposed to be sent to (ie the virtual email address)
4) Check in DB for this info & forward email on
5) Delete the original email
Looking at the headers that are available in emails I believe this would work.
I will have a play with this, and will also get Apache James set up since this will be querying an email account.
Thanks
Michael