gromox-mbop

Name

gromox-mbop — Mailbox operations utility

Synopsis

gromox-mbop {-d mbox|-u [recipient]@domain.example} command [command-args...]

Global options

-d /var/lib/gromox/user/1/2

Lookup the mailbox parameters from the associated filesystem location.

-u [user]@example.com

Lookup the mailbox parameters by the associated username. (To access a public store of a domain, leave out the local part, i.e. use @example.com.)

Commands

  • clear-photo: delete user picture

  • clear-profile: delete user's PHP-MAPI profile

  • clear-rwz: delete IPM.RuleOrganizer FAI messages from the inbox

  • delmsg: issue "delete_message" RPCs for a mailbox

  • emptyfld: remove objects from folders

  • purge-datafiles: remove orphaned attachments/content files from disk

  • purge-softdelete: remove soft-deleted items from a folder

  • recalc-sizes: recalculate store size

  • unload: issue the "unload_store" RPC for a mailbox

  • vacuum: issue the "vacuum" RPC for a mailbox

Further documentation

clear-photo

The clear-photo command will delete the user picture. Note that, when there is no mailbox-level profile picture set, Gromox server processes may serve an image from another source, e.g. LDAP.

clear-profile

Similar to MSMAPI, PHP-MAPI keeps a MAPI profile which contains a store list and also the settings for grommunio-web. The clear-profile command will delete the copy of this data stored in exmdb. Note that zcore(8) may still hold a copy of the MAPI profile in memory and could write that back to exmdb, nullifying the effect of the clear-profile command. Also, if the store list is absent, a new one will implicitly be created when PHP-MAPI/zcore is used.

clear-rwz

Deletes IPM.RuleOrganizer FAI messages from the inbox.

delmsg

Synopsis

delmsg -f folder_spec [msgid...]

Description

This command hard-deletes messages from a store, including issuing proper PR_CHANGE_KEY metadata updates for the sake of Cached Mode clients.

The folder and message IDs taken as arguments on the command-line should be of the GC-value form, i.e. as they appear in the the SQLite database.

Subcommand options

-f folder_spec

The folder from which to delete the messages. See below for details. (If a msgid is specified which is not located in the particular folder, that message will not be deleted.)

--soft

Perform a soft deletion.

emptyfld

Synopsis

emptyfld [-MRa] [-t age] [--soft] folder_spec...

Description

This command deletes objects from one or more folders. (This was originally implemented with just the "empty_folder" RPC, but more options for selective deletion were added later. Thus, emptyfld may not completely empty a folder.)

Subcommand options

-M

Exempt normal messages from deletion.

-R

Recurse into subfolders.

-a

Select associated messages (FAI) for deletion.

-t timespec

Select only messages which have a last modification timestamp older than timespec. (See further below near purge-softdelete for a short explanation of timespec.)

--nuke-folders

Rather than recursing into subfolders (to delete messages that match criteria like -a,-M,-t), delete subfolders outright.

--soft

Perform soft deletion. More specifically, this sets the soft-delete flag (also called "hidden" in Exchange) on messages and/or folders. Softdeleted objects can be restored/unhidden by the user. The final deletion is possible also at the hands of the user, or by using mbop's purge-softdelete subcommand.

Examples

  • Take out the trash ("Deleted Items") for a lazy user: gromox-mbop -u abc@example.com emptyfld -Rt 1week --soft DELETED

purge-datafiles

The "purge-datafiles" RPC makes exmdb_provider remove attachment and content files from disk that are no longer referenced by any message.

purge-softdelete

Synopsis

purge-softdelete [-r] [-t timespec] folder_spec...

Description

This command hard-deletes all messages from a folder which are marked as soft-deleted. (The entire mailbox can be processed by specifying the root folder plus the -r option.)

Subcommand options

-r

Recurse into subfolders.

-t timespec
Specifies the minimum time to the last modification that soft-deleted messages must have before they are hard-deleted. See gromox(7), section "Duration specification" for timespec's syntax.
Default: 0 (immediate deletion)

Examples

  • To process an entire mailbox and wipe everything older than a few days: gromox-mbop -u abc@example.com purge-softdelete -r / -t 10d

recalc-sizes

Recalculates the store size.

unload

Normally, exmdb_provider(4gx) keeps stores open for up to exmdb_provider.cfg:cache_interval. The "unload_store" RPC to exmdb_provider(4gx) causes the sqlite database (in /var/lib/gromox/.../exmdb/exchange.sqlite3) to be closed. Any subsequent RPC may reopen it, though. The unload RPC is useful after a mailbox was deleted and/or reinitialized with grommunio-admin-api or tools like gromox-mkprivate(8)/gromox-mkpublic(8). [zcore also has store state in memory. This would also need to be purged — but there is no RPC for such action at this time.] unload will fail to succeed if there is still a client connected to the mailbox via a notification channel.

vacuum

Issue the SQLite ".vacuum" command on the user's exchange.sqlite3 file in an attempt to reclaim unused disk space and shrink it. This operation can potentially run for quite some time, during which the mailbox is inaccessible.

Folder specification

folder_spec can either be a numeric identifier, or a path-like specification into the folder hierarchy. If the name starts with the slash character '/', it is interpreted as starting from the root; otherwise, the first component must be a special fixed name (untranslated) (CALENDAR, COMMON_VIEWS, CONFLICTS, CONTACTS, DEFERRED_ACTION, DELETED (TRASH, WASTEBASKET), DRAFT, FINDER, INBOX, IPM_SUBTREE, JOURNAL, JUNK, LOCAL_FAILURES, NOTES, OUTBOX, SENT, SERVER_FAILURES, SHORTCUTS, SYNC_ISSUES, TASKS, VIEWS). These special names can be used with private stores only; there are no names defined for public folder contents at this time. There is also no parsing support for slashes in folder names currently in mbop; the slash character is always treated as a hierarchy separator. Examples:

  • /Top of Information Store/Sent Items/2022

  • IPM_SUBTREE/Sent Items/2022

  • SENT/2022

See also

gromox(7)