There are multiple ways to manage DBMail users. With dbmail-users being the appointed tool by the DBMail development team.
Whichever way you choose to use to manage users is you own. But using dbmail-users is the only tool supported by the developers directly, and if changes are made to dbmail's sourcecode you can expect it to be updated also.
A way to add user directly into the database can be found here
A user can be added to DBMail with the following command:
dbmail-users -a USERNAME -w PASSWORD
Change USERNAME and PASSWORD to suit your new user. This newly created user can now login with the imap or pop3 server. However he/she isn't able to receive any emails because the dbmail server doesn't know which email address the newly created user has.
Add a new email address (alias) to the user:
dbmail-users -c USERNAME -s USER@mydomain
DBMail now accepts email for USER@mydomain and inserts them into our users mailbox. If a user has multiple mailadresses you can simply add more with the above command, or separate them with a ”,”. Removing aliases can be done with ”-S”:
dbmail-users -c USERNAME -S USER@mydomain
For restricting maximum mailbox size of your users you can setup quota. If quota limit is reached DBMail refuses to receive mail for your users during the smtp or lmtp session. This way the mailserver can send a bounce to let the sender know his mail wasn't delivered.
Set up quota with:
dbmail-users -c USERNAME -m QUOTA
QUOTA can be specified in <bytes>B, <kbytes>KB,<mbytes>M. Default is in bytes.
To delete a user use the dbmail-users utility:
dbmail-users -d USERNAME
To add a forward also use dbmail-users. If you forward to an external email address there is no need to add a local user.
dbmail-users -x to@domain -t forward@domain2
to@domain will be forwarded to forward@domain2.
Keep in mind, that a user's mailbox isn't deleted until the next time dbmail-util is run. Aliases are deleted with the user directly.
Deleting a forward can be done using the dbmail-users utility:
dbmail-users -x to@domain -T forward@domain