Skip to content

rmb CLI

Peter Mauritius edited this page Jul 3, 2018 · 15 revisions

rmb Command Line Interface

The plugin provides a command line tool which will be installed to %dovecot_home%/bin/rmb. The tool gives you access to the ceph mail storage.

List users mailboxes

rmb -N <username> ls mb [-o <rbox_cfg>]
Example: List mailboxes of user t
rmb -N t ls mb

List all user’s e-mails

rmb [-p <mail_storage>] -N <username> ls - sort uid|recv_date|save_date|phy_size [-o <rbox_cfg>]
Example: Print all e-mails to screen sorted asc by uid
rmb -N t ls - sort uid

Search for e-mails

rmb [-p <mail_storage>] -N <username> ls Metadata >|<|= value [-o <rbox_cfg>]
Example: Search e-mails received after 2017-11-22 13:40
rmb -N t ls R>"2017-11-22 13:40"

Download e-mails

It is possible to download user e-mails to disk, by replacing ls with get:

rmb [-p <mail_storage>] -N <username> get - -O <dir> [-o <rbox_cfg>]
Example: Download e-mail with UID 1 to ~/rmb
rmb -N t get U=1

Update e-mail metadata

rmb [-p <mail_storage>] -N <username> set <oid> <Metadata> <value> [-o <rbox_cfg>]
Example: Set UID of e-mail object 00109203d4d61f5a0c7600009c60bf7 to 1
rmb -N t set G 00109203d4d61f5a0c7600009c60bf7 U 1

Changing dovecot-ceph-plugin configuration

Create new default configuration

rmb cfg create [-o <rbox_cfg>]
Example: Create new default configuration with the default name rbox_cfg
rmb cfg create

Show current dovecot-ceph-plugin configuration

rmb cfg show [-o <rbox_cfg>]
Example: Print configuration
rmb cfg show

Update dovecot-ceph configuration

rmb cfg update <key>=<value> [-o <rbox_cfg>] --yes-i-really-really-mean-it
Example: Set the value of generated_namespaces to true
rmb cfg update generated_namespaces=true --yes-i-really-really-mean-it
⚠️
Changing values in the dovecot-ceph configuration should be done before storing e-mails in ceph. Otherwise there will be problems accessing old mails.

Delete e-mail object

rmb -N <username> delete <oid> --yes-i-really-really-mean-it
Example:
rmb -N t delete 00109203d4d61f5a0c7600009c60bf7 --yes-i-really-really-mean-it
⚠️
Deleting an e-mail object will not notify dovecot about the deletion, so if you delete an object make sure that dovecot does not have a reference to it. Otherwise you have a corrupt mailbox.

Rename a user

Renaming a user is only available if the config option generated-namespace is set to true.

rmb -N <username> rename <username> --yes-i-really-really-mean-it

Example: Rename the user t to t2. Effectively it renames the namespace configuration object from user t to t2. rmb -N t rename t2 --yes-i-really-really-mean-it

Save log revertion

The save_log will be recorded by the rbox storage if request by configuration. It contains information RADOS object creation and manipulation. The save_log has three command types: save, copy and move.

During save_log replay the recorded operations will be reverted as much as possible:

save

Objects will be deleted

copy

Objects will be deleted

move

The rbox plugin does not change the mail object when it is moved between the user’s mailboxes. It only creates a new index entry and removes the old. The doveadm save_log command will restore the original index entry for the moved mail.

Delete mail objects with rmb tool and save_log without re-creation of moved index entries:
rmb -r /path/to/save_log --yes-i-really-really-mean-it
Delete mail objects with doveadm rmb and save_log with re-creation of moved index entries:
doveadm rmb revert /path/to/save_log

Getting help

Accessing the man page

man rmb

Print usage information

rmb --help