Skip to main content

Accounts

The User Management tool provides a command-line interface for managing user accounts in Stalwart Mail Server. This tool facilitates various operations, including account creation, update, and deletion, as well as email and group management.

General usage:

stalwart-cli --url <URL> account <COMMAND>
  • --url <URL>: Specifies the URL of Stalwart Mail Server.
  • <COMMAND>: The specific account management command to execute.
Note

Domain names need to be created first before e-mail addresses can be assigned to accounts.

Create an Account

Command:

stalwart-cli account create [OPTIONS] <NAME> <PASSWORD>
  • <NAME>: Login name of the new account.
  • <PASSWORD>: Password for the new account.

Options:

  • -d, --description <DESCRIPTION>: Account description.
  • -q, --quota <QUOTA>: Quota in bytes.
  • -i, --is-admin <IS_ADMIN>: Whether the account is an administrator. Possible values: true, false.
  • -a, --addresses <ADDRESSES>: E-mail addresses for the account.
  • -m, --member-of <MEMBER_OF>: Groups the account is a member of.

Example:

stalwart-cli account create -d "John Doe" -q 1000000 -i false -a "[email protected]" -m "admins" john.doe password123

Update an Account

Command:

stalwart-cli account update [OPTIONS] <NAME>
  • <NAME>: Account login to be updated.

Options:

  • -n, --new-name <NEW_NAME>: Rename account login.
  • -p, --password <PASSWORD>: Update password.
  • -d, --description <DESCRIPTION>: Update account description.
  • -q, --quota <QUOTA>: Update quota in bytes.
  • -i, --is-admin <IS_ADMIN>: Update admin status.
  • -a, --addresses <ADDRESSES>: Update e-mail addresses.
  • -m, --member-of <MEMBER_OF>: Update group memberships.

Example:

stalwart-cli account update -p newpassword -q 2000000 -i true john.doe

Add E-mail aliases to an Account

Command:

stalwart-cli account add-email <NAME> <ADDRESSES>...
  • <NAME>: Account login.
  • <ADDRESSES>: E-mail aliases to add.

Example:

stalwart-cli account add-email john.doe [email protected] [email protected]

Remove E-mail aliases from an Account

Command:

stalwart-cli account remove-email <NAME> <ADDRESSES>...
  • <NAME>: Account login.
  • <ADDRESSES>: E-mail aliases to remove.

Example:

stalwart-cli account remove-email john.doe [email protected]

Add an Account to Groups

Command:

stalwart-cli account add-to-group <NAME> <MEMBER_OF>...
  • <NAME>: Account login.
  • <MEMBER_OF>: Groups to add the account to.

Example:

stalwart-cli account add-to-group john.doe managers team-leads

Remove an Account from Groups

Command:

stalwart-cli account remove-from-group <NAME> <MEMBER_OF>...
  • <NAME>: Account login.
  • <MEMBER_OF>: Groups to remove the account from.

Example:

stalwart-cli account remove-from-group john.doe team-leads

Delete an Account

Command:

stalwart-cli account delete <NAME>
  • <NAME>: Account name to delete.

Example:

stalwart-cli account delete john.doe

Display Account details

Command:

stalwart-cli account display <NAME>
  • <NAME>: Account name to display.

Example:

stalwart-cli account display john.doe

List All User Accounts

Command:

stalwart-cli account list [FROM] [LIMIT]
  • [FROM]: Starting point for listing accounts.
  • [LIMIT]: Maximum number of accounts to list.

Example:

stalwart-cli account list 0 10