Groups
Overview
Groups represent units within an organization and can have as members user accounts or other groups. Each group is identified with an e-mail address which is able to receive messages from the outside. E-mail folders and messages owned by a group are accessible by all members of the group.
Group management is done using the CLI command group
which, if executed without parameters,
returns the available subcommands:
$ stalwart-cli -u https://jmap.example.org group
Manage groups
USAGE:
stalwart-cli --url <URL> group <SUBCOMMAND>
OPTIONS:
-h, --help Print help information
SUBCOMMANDS:
add-members Add members to a group
create Create a group
display Display an existing group
help Print this message or the help of the given subcommand(s)
list List all groups
remove-members Remove members from a group
update Update an existing group
Create
Group creation is done using the group create
subcommand. It accepts the following arguments:
Create a group
USAGE:
stalwart-cli group create [OPTIONS] <EMAIL> <NAME>
ARGS:
<EMAIL> Group email address
<NAME> Name
OPTIONS:
-d, --description <DESCRIPTION> Description
-h, --help Print help information
For example, to create a Sales Team with e-mail address [email protected]
:
$ stalwart-cli -u https://jmap.example.org group create sales[email protected] "Sales Team"
Group '[email protected]' successfully created.
Display
Group details are obtained using the group display
subcommand. For example:
$ stalwart-cli -u https://jmap.example.org group display [email protected]
+-------------+-------------------+
| E-mail | [email protected] |
+-------------+-------------------+
| Name | Sales Team |
+-------------+-------------------+
| Description | |
+-------------+-------------------+
| Members | |
+-------------+-------------------+
List
Groups are listed using the group list
subcommand. It accepts an optional parameter
to filter the group list by a keyword. For example:
$ stalwart-cli -u https://jmap.example.org group list
+---------------------+--------------+-------------+
| E-mail | Name | Description |
+---------------------+--------------+-------------+
| [email protected] | Sales Team | |
+---------------------+--------------+-------------+
| [email protected] | Support Team | |
+---------------------+--------------+-------------+
2 records found.
Or using the filter:
$ stalwart-cli -u https://jmap.example.org group list sales
+---------------------+--------------+-------------+
| E-mail | Name | Description |
+---------------------+--------------+-------------+
| [email protected] | Sales Team | |
+---------------------+--------------+-------------+
1 record found.
Update
Group updates are done using the group update
subcommand. It accepts the following arguments:
Update an existing group
USAGE:
stalwart-cli group update [OPTIONS] <EMAIL>
ARGS:
<EMAIL> Group email address
OPTIONS:
-d, --description <DESCRIPTION> Description
-h, --help Print help information
-n, --name <NAME> Name
For example, to change a group’s name:
$ stalwart-cli -u https://jmap.example.org group update [email protected] -n "Global Sales Team"
Group '[email protected]' successfully updated.
Members
Group members are managed using the subcommands group add-members
and
group remove-members
. Both subcommands expect a list of user or group e-mail addresses to add or remove.
For example, to add multiple members to a group:
$ stalwart-cli -u https://jmap.example.org group add-members [email protected] \
[email protected] [email protected]
Group '[email protected]' successfully updated.
And, to remove a member from a group:
$ stalwart-cli -u https://jmap.example.org group remove-members [email protected] \
[email protected]
Group '[email protected]' successfully updated.
Delete
Groups are removed using the group delete
subcommand. For example:
$ stalwart-cli -u https://jmap.example.org group delete [email protected]
Group '[email protected]' successfully deleted.