1RECONSTRUCT(8)                    Cyrus IMAP                    RECONSTRUCT(8)
2
3
4

NAME

6       reconstruct - Cyrus IMAP documentation
7
8       Reconstruct mailboxes
9

SYNOPSIS

11          reconstruct [ -C config-file ] [ -p partition ] [ -x ] [ -r ]
12              [ -f ] [ -U ] [ -s ] [ -q ] [ -G ] [ -R ] [ -o ]
13              [ -O ] [ -M ] mailbox...
14
15          reconstruct [ -C config-file ] [ -p partition ] [ -x ] [ -r ]
16              [ -f ] [ -U ] [ -s ] [ -q ] [ -G ] [ -R ] [ -o ]
17              [ -O ] [ -M ] -u user...
18
19          reconstruct [ -C config-file ] [ -p partition ] [ -r ]
20              [ -q ] -V version mailbox...
21
22          reconstruct [ -C config-file ] [ -p partition ] [ -r ]
23              [ -q ] -V version -u user...
24
25          reconstruct [ -C config-file ] -P cyrus-header-paths...
26

DESCRIPTION

28       reconstruct rebuilds one or more IMAP mailboxes.  It can be used to re‐
29       cover from almost any sort of data corruption.
30
31       If reconstruct can find existing header and index files, it attempts to
32       preserve  any data in them that is not derivable from the message files
33       themselves. The state reconstruct attempts  to  preserve  includes  the
34       flag names, flag state, and internaldate.
35
36       reconstruct derives all other information from the message files.
37
38       reconstruct  reads  its  configuration options out of the imapd.conf(5)
39       file unless specified otherwise by -C.  Any  mailbox  directory  under‐
40       neath  the path specified in the partition-news configuration option is
41       assumed to be in news format.
42
43       reconstruct does not adjust the quota usage recorded in any quota  root
44       files.  After running reconstruct, it is advisable to run quota(8) with
45       the -f switch in order to fix the quota root files.
46
47       When upgrading versions of Cyrus software, it may be necessary  to  run
48       reconstruct  with  the -V option, to rebuild indexes to a given version
49       (or max for the most recent).  Note that the -V option cannot  be  com‐
50       bined  with  most other reconstruct options.  If a mailbox needs recon‐
51       structing you should do that first, and then upgrade it  with  -V  once
52       it's good.
53

OPTIONS

55       -C config-file
56              Use the specified configuration file config-file rather than the
57              default imapd.conf(5).
58
59       -p partition, --partition=partition
60              Search for the listed (non-existant) mailboxes on the  indicated
61              partition.  Create  the mailboxes in the database in addition to
62              reconstructing them. (not compatible with the use of wildcards)
63
64       -x, --ignore-disk-metadata
65              When processing a mailbox which is not in the mailbox list (e.g.
66              via  the  -p or -f options), do not import the metadata from the
67              mailbox, instead create it anew (this  specifically  affects  at
68              least  the  mailbox's  seen state unique identifier, user flags,
69              and ACL).
70
71       -r, --recursive
72              Recursively reconstruct all sub-mailboxes of  the  mailboxes  or
73              mailbox prefixes given as arguments.
74
75       -f, --scan-filesystem
76              Examine  the  filesystem underneath mailbox, adding all directo‐
77              ries with a cyrus.header found there as new  mailboxes.   Useful
78              for restoring mailboxes from backups.
79
80       -s, --no-stat
81              Don't stat underlying files.  This makes reconstruct run faster,
82              at the expense of not noticing some issues (like zero byte files
83              or size mismatches).  "reconstruct -s" should be quite fast.
84
85       -q, --quiet
86              Emit less verbose information to syslog.
87
88       -n, --dry-run
89              Don't make any changes.  Problems are reported, but not fixed.
90
91       -G, --force-reparse
92              Force re-parsing of the underlying message (checks GUID correct‐
93              ness). Reconstruct with -G should fix  all  possible  individual
94              message issues, including corrupted data files.
95
96       -I, --update-uniqueids
97              If  two  mailboxes  exist with the same UNIQUEID and reconstruct
98              visits both of them, -I will cause the second mailbox to have  a
99              new  UNIQUEID created for it.  If you don't specify -I, you will
100              just get a syslog entry telling you of the clash.
101
102       -R, --guid-mismatch-keep
103              Perform a UID upgrade operation on  GUID  mismatch  files.   Use
104              this  option  if  you  think your index is corrupted rather than
105              your message files, or if all backup attempts  have  failed  and
106              you're happy to be served the missing files.
107
108       -U, --guid-mismatch-discard
109              Use  this option if you have corrupt message files in your spool
110              and have been unable to restore them  from  backup.   This  will
111              make the mailbox IOERROR free and fix replication.
112
113              WARNING:  this  deletes corrupt message files for ever - so make
114              sure you've exhausted other options first!
115
116       -o, --ignore-odd-files
117              Ignore odd files in your mailbox disk  directories,  instead  of
118              complaining  about  them.  Probably useful if you are using some
119              tool which adds additional tracking files.
120
121       -O, --delete-odd-files
122              Delete odd files.  This is the opposite of -o.
123
124       -M, --prefer-mboxlist
125              Prefer mailboxes.db over cyrus.header  -  will  rewrite  ACL  or
126              uniqueid  from the mailboxes.db into the header file rather than
127              the other way around.  This feature was  introduced  in  version
128              3.0.
129
130       -V version, --set-version=version
131              Change  the  cyrus.index  minor  version  to a specific version.
132              This can be useful for upgrades or  downgrades.  Use  a  magical
133              version  of max to upgrade to the latest available database for‐
134              mat version.
135
136       -u, --userids
137              Instead of mailbox prefixes, give userids on the command line
138
139       -P, --header-paths
140              Instead of mailbox prefixes, give paths to cyrus.header files on
141              the  command line.  The paths can be mailbox directories, or ex‐
142              plicit cyrus.header filenames.   This  will  ONLY  create/repair
143              mailboxes.db records using data in cyrus.header and cyrus.index.
144

EXAMPLES

146          reconstruct -r -f tech.support
147          Recursively  reconstruct all mailboxes within the tech.support hier‐
148          archy, restoring any directories containing cyrus.header files.
149
150          reconstruct -r -f tech.support.Archive.2%
151          Recursively reconstruct all mailboxes  within  the  tech.support.Ar‐
152          chive  hierarchy with names beginning with '2', restoring any direc‐
153          tories containing cyrus.header files.
154
155          reconstruct -r -f -u jsmith
156          Recursively reconstruct all mailboxes belonging to jsmith, restoring
157          any directories containing cyrus.header files.
158

HISTORY

160       The options -k (keep flags) and -g (clear GUID) have been deprecated in
161       Cyrus version 2.4.
162
163       The -u and -V options were added in Cyrus version 2.5.
164
165       The -M option was added in Cyrus version 3.0.
166

FILES

168       /etc/imapd.conf
169

SEE ALSO

171       imapd.conf(5)
172

AUTHOR

174       The Cyrus Team, Nic Bernstein (Onlight)
175
177       1993–2023, The Cyrus Team
178
179
180
181
1823.8.1                            Sep 11, 2023                   RECONSTRUCT(8)
Impressum