RECONSTRUCT(8)
π RECONSTRUCT(8) π
okay bestie, welcome to reconstruct from the Cyrus IMAP docs β this is the man page for reconstructing mailboxes, and honestly? it's giving emergency-room energy for your mail server. let's get into it π©Ίβ¨
πΈ NAME πΈ
reconstruct β Cyrus IMAP documentation
Reconstruct mailboxes π
β¨ SYNOPSIS β¨
reconstruct [ -C config-file ] [ -p partition ] [ -x ] [ -r ]
[ -f ] [ -U ] [ -s ] [ -q ] [ -G ] [ -R ] [ -o ]
[ -O ] [ -M ] mailbox...
reconstruct [ -C config-file ] [ -p partition ] [ -x ] [ -r ]
[ -f ] [ -U ] [ -s ] [ -q ] [ -G ] [ -R ] [ -o ]
[ -O ] [ -M ] -u user...
reconstruct [ -C config-file ] [ -p partition ] [ -r ]
[ -q ] -V version mailbox...
reconstruct [ -C config-file ] [ -p partition ] [ -r ]
[ -q ] -V version -u user...
reconstruct [ -C config-file ] -P cyrus-header-paths...
π¦ DESCRIPTION π¦
reconstruct rebuilds one or more IMAP mailboxes. It can be used to recover from almost any sort of data corruption. no cap, it's the glow-up your broken mailboxes have been waiting for ππ
If reconstruct can find existing header and index files, it attempts to preserve any data in them that is not derivable from the message files themselves. The state reconstruct attempts to preserve includes the flag names, flag state, and internaldate. π
reconstruct derives all other information from the message files.
reconstruct reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C. Any mailbox directory underneath the path specified in the partition-news configuration option is assumed to be in news format. π°
β οΈ heads up bestie:reconstructdoes not adjust the quota usage recorded in any quota root files. After runningreconstruct, it is advisable to runquota(8)with the-fswitch in order to fix the quota root files. don't skip this step, i'm literally begging π
When upgrading versions of Cyrus software, it may be necessary to run reconstruct with the -V option, to rebuild indexes to a given version (or max for the most recent). Note that the -V option cannot be combined with most other reconstruct options. If a mailbox needs reconstructing you should do that first, and then upgrade it with -V once it's good. order matters, queen π
π OPTIONS π
-Cconfig-file β Use the specified configuration file config-file rather than the defaultimapd.conf(5).-ppartition,--partition=partition β Search for the listed (non-existant) mailboxes on the indicated partition. Create the mailboxes in the database in addition to reconstructing them. (not compatible with the use of wildcards)-x,--ignore-disk-metadataβ When processing a mailbox which is not in the mailbox list (e.g. via the-por-foptions), do not import the metadata from the mailbox, instead create it anew (this specifically affects at least the mailbox's seen state unique identifier, user flags, and ACL).-r,--recursiveβ Recursively reconstruct all sub-mailboxes of the mailboxes or mailbox prefixes given as arguments. π-f,--scan-filesystemβ Examine the filesystem underneath mailbox, adding all directories with acyrus.headerfound there as new mailboxes. Useful for restoring mailboxes from backups. πΎβ¨-s,--no-statβ Don'tstatunderlying files. This makesreconstructrun faster, at the expense of not noticing some issues (like zero byte files or size mismatches)."reconstruct -s"should be quite fast. ποΈ-q,--quietβ Emit less verbose information to syslog. π€«-n,--dry-runβ Don't make any changes. Problems are reported, but not fixed. π-G,--force-reparseβ Force re-parsing of the underlying message (checks GUID correctness). Reconstruct with-Gshould fix all possible individual message issues, including corrupted data files. π₯-I,--update-uniqueidsβ If two mailboxes exist with the sameUNIQUEIDandreconstructvisits both of them,-Iwill cause the second mailbox to have a newUNIQUEIDcreated for it. If you don't specify-I, you will just get a syslog entry telling you of the clash.-R,--guid-mismatch-keepβ Perform a UID upgrade operation on GUID mismatch files. Use this option if you think your index is corrupted rather than your message files, or if all backup attempts have failed and you're happy to be served the missing files. π«Ά-U,--guid-mismatch-discardβ Use this option if you have corrupt message files in your spool and have been unable to restore them from backup. This will make the mailboxIOERRORfree and fix replication.
π WARNING: this deletes corrupt message files for ever β so make sure you've exhausted other options first! for real, this one is not a vibe check you want to fail π
-o,--ignore-odd-filesβ Ignore odd files in your mailbox disk directories, instead of complaining about them. Probably useful if you are using some tool which adds additional tracking files. π-O,--delete-odd-filesβ Delete odd files. This is the opposite of-o. πͺ-M,--prefer-mboxlistβ Prefermailboxes.dbovercyrus.headerβ will rewriteACLoruniqueidfrom themailboxes.dbinto the header file rather than the other way around. This feature was introduced in version 3.0.-Vversion,--set-version=version β Change thecyrus.indexminor version to a specific version. This can be useful for upgrades or downgrades. Use a magical version ofmaxto upgrade to the latest available database format version. πͺ-u,--useridsβ Instead of mailbox prefixes, give userids on the command line.-P,--header-pathsβ Instead of mailbox prefixes, give paths tocyrus.headerfiles on the command line. The paths can be mailbox directories, or explicitcyrus.headerfilenames. This will ONLY create/repairmailboxes.dbrecords using data incyrus.headerandcyrus.index.
π EXAMPLES π
reconstruct -r -f tech.support
Recursively reconstruct all mailboxes within the tech.support hierarchy, restoring any directories containing cyrus.header files. π³
reconstruct -r -f tech.support.Archive.2%
Recursively reconstruct all mailboxes within the tech.support.Archive hierarchy with names beginning with '2', restoring any directories containing cyrus.header files. π
reconstruct -r -f -u jsmith
Recursively reconstruct all mailboxes belonging to jsmith, restoring any directories containing cyrus.header files. π
π HISTORY π
The options -k (keep flags) and -g (clear GUID) have been deprecated in Cyrus version 2.4.
The -u and -V options were added in Cyrus version 2.5.
The -M option was added in Cyrus version 3.0.
π FILES π
/etc/imapd.conf
π SEE ALSO π
π AUTHOR π
The Cyrus Team, Nic Bernstein (Onlight) π«‘
Β©οΈ COPYRIGHT Β©οΈ
1993β2026, The Cyrus Team
okay that's the whole thing, bestie, you ate that ππ
this was Cyrus IMAP 3.12.4, dated Sep 09, 2026 β go forth and reconstruct, and remember: back up first, or the -U warning will find you ππ¦
π¦ where this page comes from
- fedora 44: cyrus-imapd 3.12.4-1.fc44 Β· BSD-Attribution-HPND-disclaimer
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms