Skip to content
English

Gromox CLI utilities

Where grommunio-admin manages the management layer (users, domains, configuration), the gromox-* utilities act directly on the storage layer — the per-user stores (exchange.sqlite3 plus the attachment/content files). They live under /usr/sbin and /usr/libexec/gromox/ and are the right tools for maintenance, repair and data-level migration.

gromox-mbop ("mailbox operations") is the workhorse for per-mailbox actions. It always selects a target mailbox first, then performs one or more actions:

Terminal window
gromox-mbop -u [email protected] <action> [args...]

See the gromox-mbop(8) manual page for every action and flag. The actions most relevant to administrators:

Action What it does
emptyfld Empty one or more folders. --soft mimics a client delete; -R recurses into subfolders; -t age limits to items older than age.
delmsg Delete specific messages from a folder (-f folder) by message ID.
purge-softdelete Hard-delete soft-deleted ("recoverable") items. -r recurses; -t timespec limits by age.
purge-datafiles Remove attachment/content files on disk no longer referenced by any message.
vacuum Compact the store's SQLite database (VACUUM).
recalc-sizes Recompute the store's reported size.
ping Open the mailbox on the server — a quick "is the store healthy?" check.
unload Drop the store from the server's in-memory cache.
set-locale Set the mailbox locale (drives the translated names of built-in folders).
get-photo / set-photo / clear-photo Read, set or remove the user's contact picture.
get-websettings / set-websettings Read or write the per-user grommunio Web settings (JSON).
sync-midb Rebuild the midb index used by the IMAP/POP front-ends.
clear-rwz Remove the cached Outlook rules organizer (IPM.RuleOrganizer) messages.
clear-profile Clear the cached PHP-MAPI profile for the store.
cgkreset Reset change numbers/keys on all objects — a recovery step for sync corruption.

Folders are addressed either by a symbolic name (resistant to language settings) or by path:

Terminal window
gromox-mbop -u [email protected] emptyfld --soft JUNK
gromox-mbop -u [email protected] emptyfld "/Top of Information Store/Archive/2022"

Recognized symbolic names include INBOX, SENT, DRAFT, OUTBOX, JUNK, DELETED (a.k.a. TRASH/WASTEBASKET), CALENDAR, CONTACTS, TASKS, NOTES, JOURNAL and IPM_SUBTREE. The slash is always a hierarchy separator (symbolic names work on private stores only).

Multiple actions can be chained for one mailbox by wrapping each in parentheses:

Terminal window
gromox-mbop -u [email protected] ( purge-softdelete -r / ) ( purge-datafiles )

The foreach.* pseudo-command repeats an action over many mailboxes — perfect for fleet-wide maintenance:

Terminal window
# Every mailbox hosted on this server
gromox-mbop foreach.mb.here purge-softdelete -r -t 30d /

Stores are normally provisioned for you by grommunio-admin user create. The underlying primitives are available directly when needed:

Tool Purpose
gromox-mkprivate(8) Create a blank private (per-user) store.
gromox-mkpublic(8) Create a blank public (per-domain) store.

Check a mailbox for structural inconsistencies and, with care, repair them.

Terminal window
gromox-mbck [email protected]

See gromox-mbck(8). Run on a quiesced mailbox and take a snapshot first.

Report a mailbox's size and what is consuming it — handy for quota investigations.

Terminal window
gromox-mbsize [email protected]

See gromox-mbsize(8).

User-database maintenance for the management database (schema upgrades and related operations). See gromox-dbop(8).

List the local delivery agent's queue — useful when mail appears stuck.

Terminal window
gromox-mailq

See gromox-mailq(8).

Create a space-efficient, point-in-time snapshot of the mailbox storage on a copy-on-write filesystem (e.g. Btrfs):

Terminal window
/usr/libexec/gromox/gromox-snapshot

Schedule it from a systemd timer for low-overhead, regular backups. See gromox-snapshot(8).

For migrations and data recovery, Gromox can move messages between mailboxes and on-disk formats. The conversion tools form a small pipeline — for example gromox-eml2mbox(8) and gromox-mbox2mt(8) bridge RFC 5322 / mbox data and the internal "mail transfer" format that loads into a store. The Mailbox transfer format page describes the format in detail; browse the full set on the Man Pages index.