.\" Man page generated from reStructuredText.
.
.TH "RECONSTRUCT" "8" "February 13, 2023" "3.6.1" "Cyrus IMAP"
.SH NAME
reconstruct \- Cyrus IMAP documentation
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.sp
Reconstruct mailboxes
.SH SYNOPSIS
.sp
.nf
\fBreconstruct\fP [ \fB\-C\fP \fIconfig\-file\fP ] [ \fB\-p\fP \fIpartition\fP ] [ \fB\-x\fP ] [ \fB\-r\fP ]
    [ \fB\-f\fP ] [ \fB\-U\fP ] [ \fB\-s\fP ] [ \fB\-q\fP ] [ \fB\-G\fP ] [ \fB\-R\fP ] [ \fB\-o\fP ]
    [ \fB\-O\fP ] [ \fB\-M\fP ] \fImailbox\fP\&...

\fBreconstruct\fP [ \fB\-C\fP \fIconfig\-file\fP ] [ \fB\-p\fP \fIpartition\fP ] [ \fB\-x\fP ] [ \fB\-r\fP ]
    [ \fB\-f\fP ] [ \fB\-U\fP ] [ \fB\-s\fP ] [ \fB\-q\fP ] [ \fB\-G\fP ] [ \fB\-R\fP ] [ \fB\-o\fP ]
    [ \fB\-O\fP ] [ \fB\-M\fP ] \fB\-u\fP \fIuser\fP\&...

\fBreconstruct\fP [ \fB\-C\fP \fIconfig\-file\fP ] [ \fB\-p\fP \fIpartition\fP ] [ \fB\-r\fP ]
    [ \fB\-q\fP ] \fB\-V\fP \fIversion\fP \fImailbox\fP\&...

\fBreconstruct\fP [ \fB\-C\fP \fIconfig\-file\fP ] [ \fB\-p\fP \fIpartition\fP ] [ \fB\-r\fP ]
    [ \fB\-q\fP ] \fB\-V\fP \fIversion\fP \fB\-u\fP \fIuser\fP\&...

\fBreconstruct\fP [ \fB\-C\fP \fIconfig\-file\fP ] \fB\-P\fP \fIcyrus\-header\-paths\fP\&...
.fi
.SH DESCRIPTION
.sp
\fBreconstruct\fP rebuilds one or more IMAP mailboxes.  It can be
used to recover from almost any sort of data corruption.
.sp
If \fBreconstruct\fP 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 \fBreconstruct\fP attempts to
preserve includes the flag names, flag state, and internaldate.
.sp
\fBreconstruct\fP derives all other information from the message files.
.sp
\fBreconstruct\fP reads its configuration options out of the imapd.conf(5) file unless specified otherwise by \fB\-C\fP\&.  Any mailbox directory underneath
the path specified in the \fBpartition\-news\fP configuration option is
assumed to be in news format.
.sp
\fBreconstruct\fP does not adjust the quota usage recorded in any quota
root files.  After running \fBreconstruct\fP, it is advisable to run
\fBquota(8)\fP with the \fB\-f\fP switch in order to fix the quota
root files.
.sp
When upgrading versions of Cyrus software, it may be necessary to run
\fBreconstruct\fP with the \fB\-V\fP option, to rebuild indexes to a
given version (or \fImax\fP for the most recent).  Note that the \fB\-V\fP
option cannot be combined with most other reconstruct options.  If
a mailbox needs reconstructing you should do that first, and then
upgrade it with \fB\-V\fP once it’s good.
.SH OPTIONS
.INDENT 0.0
.TP
.B \-C  config\-file
Use the specified configuration file \fIconfig\-file\fP rather than the default imapd.conf(5)\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-p  partition
Search for the listed (non\-existant) mailboxes on the indicated
\fIpartition\fP\&. Create the mailboxes in the database in addition to
reconstructing them. (not compatible with the use of wildcards)
.UNINDENT
.INDENT 0.0
.TP
.B \-x
When processing a mailbox which is not in the mailbox list (e.g.
via the \fB\-p\fP or \fB\-f\fP options), 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).
.UNINDENT
.INDENT 0.0
.TP
.B \-r
Recursively reconstruct all sub\-mailboxes of the mailboxes or
mailbox prefixes given as arguments.
.UNINDENT
.INDENT 0.0
.TP
.B \-f
Examine the filesystem underneath mailbox, adding all directories
with a \fBcyrus.header\fP found there as new mailboxes.  Useful for
restoring mailboxes from backups.
.UNINDENT
.INDENT 0.0
.TP
.B \-s
Don’t stat underlying files.  This makes reconstruct run faster, at
the expense of not noticing some issues (like zero byte files or
size mismatches).  “\fBreconstruct \-s\fP” should be quite fast.
.UNINDENT
.INDENT 0.0
.TP
.B \-q
Emit less verbose information to syslog.
.UNINDENT
.INDENT 0.0
.TP
.B \-n
Don’t make any changes.  Problems are reported, but not fixed.
.UNINDENT
.INDENT 0.0
.TP
.B \-G
Force re\-parsing of the underlying message (checks GUID
correctness). Reconstruct with \-G should fix all possible
individual message issues, including corrupted data files.
.UNINDENT
.INDENT 0.0
.TP
.B \-I
If two mailboxes exist with the same UNIQUEID and reconstruct visits
both of them, \-I will cause the second mailbox to have a new UNIQUEID
created for it.  If you don’t specify \-I, you will just get a syslog
entry telling you of the clash.
.UNINDENT
.INDENT 0.0
.TP
.B \-R
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.
.UNINDENT
.INDENT 0.0
.TP
.B \-U
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
mailbox IOERROR free and fix replication.
.sp
WARNING:
this deletes corrupt message files for ever \- so make sure you’ve
exhausted other options first!
.UNINDENT
.INDENT 0.0
.TP
.B \-o
Ignore odd files in your mailbox disk directories.  Probably useful
if you are using some tool which adds additional tracking files.
.UNINDENT
.INDENT 0.0
.TP
.B \-O
Delete odd files.  This is the opposite of \fB\-o\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-M
Prefer mailboxes.db over cyrus.header \- will rewrite ACL or
uniqueid from the mailboxes.db into the header file rather than the
other way around.  This feature was introduced in version 3.0.
.UNINDENT
.INDENT 0.0
.TP
.B \-V version
Change the \fBcyrus.index\fP minor version to a specific \fIversion\fP\&.
This can be useful for upgrades or downgrades. Use a magical
version of \fImax\fP to upgrade to the latest available database format
version.
.UNINDENT
.INDENT 0.0
.TP
.B \-u
Instead of mailbox prefixes, give usernames on the command line
.UNINDENT
.INDENT 0.0
.TP
.B \-P
Instead of mailbox prefixes, give paths to cyrus.header files on
the command line.  The paths can be mailbox directories, or
explicit cyrus.header filenames.
This will ONLY create/repair mailboxes.db records using data in
cyrus.header and cyrus.index.
.UNINDENT
.SH EXAMPLES
.sp
.nf
\fBreconstruct \-r \-f\fP \fItech.support\fP
.fi
.INDENT 0.0
.INDENT 3.5
Recursively reconstruct all mailboxes within the \fItech.support\fP
hierarchy, restoring any directories containing \fBcyrus.header\fP
files.
.UNINDENT
.UNINDENT
.sp
.nf
\fBreconstruct \-r \-f\fP \fItech.support.Archive.2%\fP
.fi
.INDENT 0.0
.INDENT 3.5
Recursively reconstruct all mailboxes within the
\fItech.support.Archive\fP hierarchy with names beginning with ‘2’,
restoring any directories containing \fBcyrus.header\fP
files.
.UNINDENT
.UNINDENT
.sp
.nf
\fBreconstruct \-r \-f \-u\fP \fIjsmith\fP
.fi
.INDENT 0.0
.INDENT 3.5
Recursively reconstruct all mailboxes belonging to \fIjsmith\fP,
restoring any directories containing \fBcyrus.header\fP files.
.UNINDENT
.UNINDENT
.SH HISTORY
.sp
The options \fB\-k\fP (keep flags) and \fB\-g\fP (clear GUID) have been
deprecated in Cyrus version 2.4.
.sp
The \fB\-u\fP and \fB\-V\fP options were added in Cyrus version 2.5.
.sp
The \fB\-M\fP option was added in Cyrus version 3.0.
.SH FILES
.sp
/etc/imapd.conf
.SH SEE ALSO
.sp
imapd.conf(5)
.SH AUTHOR
The Cyrus Team, Nic Bernstein (Onlight)
.SH COPYRIGHT
1993–2023, The Cyrus Team
.\" Generated by docutils manpage writer.
.