Skip to end of metadata
Go to start of metadata


BlueMind 3.5.10 makes it possible to install a CLI (Command Line Interface) which can be used to perform BlueMind administration tasks in command line without having to create scripts.

When coupled with the bm-tick monitoring system, it can be used, among others, to manage it.

This page provides installation and use information, including practical examples. A dedicated sub-page provides more details on bm-cli command references.


The bm-cli client is installed via a dedicated package on the server – available from BlueMind 3.5.10:

# aptitude install bm-cli

No restart is required, the tool is effective immediately.

On this page:


bm-cli Command References

Using the client


Commands are passed via a terminal straight onto the server, e.g. connected via ssh.

For example, a command can help you find out a user's address books:

root@mail:~# bm-cli contact list jdoe@bluemind.loc
{"owner":"05E25C2C-3643-4ED2-997C-4A4F39933D18","uid":"book:Contacts_05E25C2C-3643-4ED2-997C-4A4F39933D18","name":"My contacts"}
{"owner":"05E25C2C-3643-4ED2-997C-4A4F39933D18","uid":"book:CollectedContacts_05E25C2C-3643-4ED2-997C-4A4F39933D18","name":"Collected contacts"}

Getting help

Commands are improved with every version of BlueMind. You may have more or fewer commands depending on the version you have installed.

Make sure you check the "bm-cli help" client to find out which commands are available.


# bm-cli help
usage: bm-cli <command> [<args>]

The most commonly used bm-cli commands are:
    calendar      calendar task(s)
    contact       contact task(s)
    help          Display help information
    maintenance   maintenance task(s)
    tick          tick task(s)
    user          user task(s)

See 'bm-cli help <command>' for more information on a specific command.

This installation – version 3.5.11 – includes calendar, contacts and user commands which did not exist in earlier versions.

You can get help on a command, sub-command, how to use it and its options using "help" at any time.

E.g. "help maintenance" shows the maintenance command and the actions it allows:

# bm-cli help maintenance
        bm-cli maintenance - maintenance task(s)

        bm-cli maintenance
        bm-cli maintenance consolidateIndex [--workers <workers>]
        bm-cli maintenance list [--workers <workers>]
        bm-cli maintenance repair [--dry] [--workers <workers>]

        With no arguments, List directory entries

            List directory entries

For more details about a sub-command, type it to get help, e.g. about index consolidation:

# bm-cli help maintenance consolidateIndex
        bm-cli maintenance consolidateIndex - Consolidate a mailbox index

        bm-cli maintenance consolidateIndex [--workers <workers>] [--] <target>

        --workers <workers>
            run with X workers

Practical examples

Administration and Maintenance

Performing a domain-wide check&repair 

The following command is used to perform a check and repair on all domain users using 4 threads:

bm-cli maintenance repair --numworkers 4

Changing the admin0 password

For multiple reasons – technical or practical, e.g. in case of loss -- you may need to change the admin0 user's password without logging into BlueMind.

The following command allows you to do this without knowing the old password:

bm-cli user update admin0@global.virt --password "NewPassword"

Updating the tick configuration

When the Bm-Tick monitoring tool is installed, you can use it to perform administration tasks. E.g. you can roll out the configuration on all domain servers again using the following command:

# bm-cli tick reconfigure

--dry is added to test the command: the operation is merely simulated

# bm-cli tick reconfigure --dry

Operations on users

Deleting archived (suspended) domain users

version info

The "bm-cli user" command will be available from BlueMind 3.5.11.

Commands can be coupled to perform several operations at once.

E.g. the command below is used to look for the email addresses of suspended users:

bm-cli user get --archived --display "email"

You can then couple this command's return with a "delete" command to remove all the users returned:

bm-cli user get local.lan --display "email" | jq -r '.[].email' > /tmp/archived.txt
while read account; do bm-cli user delete --dry $account ;done < /tmp/archived.txt

Operations on calendars

Sharing all user calendars with one user

It may be useful for one user to have access privileges on all user calendars without being given an administrator role (e.g. a secretary might be able to view/create events for all other employees). To avoid having to go through each user's page to enable sharing, this can be done in command line.

This cannot be done with a single command, but you can create a loop which picks up all domain users and enables sharing for each of them:

bm-cli users get > /tmp/
while read account; do bm-cli calendar share $account « default » r;done < /tmp/

Operations on contacts

The procedure below can be used to clean a user's collected address book and transfer their contacts to their personal address book (and testing the import process beforehand):

root@mail:~# bm-cli contact list jdoe@bluemind.loc
{"owner":"05E25C2C-3643-4ED2-997C-4A4F39933D18","uid":"book:Contacts_05E25C2C-3643-4ED2-997C-4A4F39933D18","name":"My contacts"}
{"owner":"05E25C2C-3643-4ED2-997C-4A4F39933D18","uid":"book:CollectedContacts_05E25C2C-3643-4ED2-997C-4A4F39933D18","name":"Collected contacts"}
root@mail:~# bm-cli contact deduplicate jdoe@bluemind.loc --addressbook-uid book:CollectedContacts_05E25C2C-3643-4ED2-997C-4A4F39933D18
2 were removed out of 35
root@mail:~# bm-cli contact export jdoe@bluemind.loc --vcf-file-path /tmp/jdoe-collected.vcf --addressbook-uid book:CollectedContacts_05E25C2C-3643-4ED2-997C-4A4F39933D18
addressbook book:CollectedContacts_05E25C2C-3643-4ED2-997C-4A4F39933D18 of jdoe@bluemind.loc was exported
root@mail:~# bm-cli contact import jdoe@bluemind.loc --vcf-file-path /tmp/jdoe-collected.vcf --addressbook-uid 408C741B-3FDC-44B6-B1FD-19E79404BFCF --dry
DRY : AddressBook 408C741B-3FDC-44B6-B1FD-19E79404BFCF of jdoe@bluemind.loc was imported
root@mail:~# bm-cli contact import jdoe@bluemind.loc --vcf-file-path /tmp/jdoe-collected.vcf --addressbook-uid 408C741B-3FDC-44B6-B1FD-19E79404BFCF
AddressBook 408C741B-3FDC-44B6-B1FD-19E79404BFCF of jdoe@bluemind.loc was imported
root@mail:~# bm-cli contact reset jdoe@bluemind.loc --addressbook-uid book:CollectedContacts_05E25C2C-3643-4ED2-997C-4A4F39933D18
Addressbook book:CollectedContacts_05E25C2C-3643-4ED2-997C-4A4F39933D18 of jdoe@bluemind.loc was reset
  • No labels


  1. la commande share n'est pas documentée (paragraphe 3.3 c)

    L'exemple ne fonctionne pas en l'état:

    bm-cli users get

    la commande 'users' n'existe pas: il faut remplacer par 'user'

    cela renvoi tout l'objet user au format json. A mon avis pas ce qu'il faut passer en premier paramètre à la commande share: seulement l'email ?

    Mais en testant:

    bm-cli calendar share "" default "" r 

    j'ai une erreur: 

    ERROR - Required parameters are missing: email


    bm-cli help calendar share

    Unknown command calendar share

    Unknown command calendar

    1. Bonjour,

      L'exemple avait été écrit de façon anticipé par rapport à la spécification produit mais il s'avère que finalement cette commande n'a pas encore été implémentée.

      Nous l'avons remplacé par un exemple similaire (une boucle sur les utilisateurs avec une action sur leurs calendriers) mais utilisant une fonction existante (l'export).

      À noter aussi que les guillemets ne sont plus nécessaires pour entourer les adresses dans les paramètres.