Skip to content
Jan Radon edited this page Dec 1, 2017 · 14 revisions

Welcome to the dovecot-ceph-plugin wiki!

Dovecot-Ceph-Plugin Configuration

The plugin configuration is split up into dovecot and ceph configuration. The dovecot configuration can be changed in 90-plugin.conf. There are defaults for all settings.

Dovecot 90-plugin.conf

rbox_cluster_name = ceph
rbox_pool_name = mail_storage
rbox_update_imutable = false
rbox_mutable_metadata =
rbox_immutable_metadata = B
rbox_config_obj_name=rbox_cfg

Ceph configuration

rbox_generate_namespace = false
rbox_namespac_cfg_ns = rbox_ns_cfg
rbox_ns_suffix = _namespace

RMB command line tool

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

Example:

List mailboxes of user t
rmb -N t ls mb

List all user’s mail:

rmb [-p <mail_storage>] -N <username> ls - sort uid|recv_date|save_date|phy_size

Example:

print all mails to screen sorted asc by uid
rmb -N t ls - sort uid

Search for mails:

rmb [-p <mail_storage>] -N <username> ls Metadata >|<|= value

Example:

search mails receveid after 2017-11-22 13:40
rmb [-p mail_storage] -N ls R>"2017-11-22 13:40"

By replacing ls with get, it is possible to download e-mails to disk:

rmb [-p <mail_storage>] -N <username> get - -O <dir>

Example:

Download mail with UID 1 to ~/rmb
rmb -N t get U=1

Update mail metadata:

rmb [-p <mail_storage>] -N <username> set <oid> <Metadata> <value>

Example:

set UID of mail object 00109203d4d61f5a0c7600009c60bf7 to 1
rmb -N t set 00109203d4d61f5a0c7600009c60bf7 U 1

Changing dovecot-ceph configuration:

Create new default configuration:

rmb -cfg -C [-obj <rbox_cfg>]

Example:

create new default configuration with the default name rbox_cfg
rmb -cfg -C

Show current dovecot-ceph configuration:

rmb -cfg ls - [-obj <rbox_cfg>]

Example:

print configuration
rmb -cfg ls -

Update dovecot-ceph configuration:

rmb -cfg [-obj <rbox_cfg>] <key>=<value> --yes-i-really-really-mean-it

Example:

Set the value of generated_namespaces to true
rmb -cfg generated_namespaces=true --yes-i-really-really-mean-it
Warning
changing values in the dovecot-ceph configuration should be done, before storing emails in ceph. If it is done afterwards there will be problems accessing old mails.

Restore Index

To restore an rbox index, dovecot tool doveadm force-resync -u user <MAILBOX_NAME> can be used. The tool first makes a backup of the current index file if it exists. Afterwards, it tries to read the Mailbox GUID from the index file to determine the mailbox unique identifier. If GUID cannot be found, the mailbox name given in doveadm command line argument will be used.

The restore process works in the following way.

  • The tool searches for all Rados objects matching xattr M = Mailbox guid in user namespace (in case no GUID is available, it uses B = Mailbox name)

  • Found mail objects are added to the newly created index file.

  • The tool tries to find a matching mail record in cache or backup index file (seq, uid), to complete the newly created index entry.

  • The resulting index will only include mails which have a corresponding rados mail object.

Clone this wiki locally