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
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     When processing a mailbox which is not in the mailbox list (e.g.
65              via  the  -p or -f options), do not import the metadata from the
66              mailbox, instead create it anew (this  specifically  affects  at
67              least  the  mailbox’s  seen state unique identifier, user flags,
68              and ACL).
69
70       -r     Recursively reconstruct all sub-mailboxes of  the  mailboxes  or
71              mailbox prefixes given as arguments.
72
73       -f     Examine  the  filesystem underneath mailbox, adding all directo‐
74              ries with a cyrus.header found there as new  mailboxes.   Useful
75              for restoring mailboxes from backups.
76
77       -s     Don’t stat underlying files.  This makes reconstruct run faster,
78              at the expense of not noticing some issues (like zero byte files
79              or size mismatches).  “reconstruct -s” should be quite fast.
80
81       -q     Emit less verbose information to syslog.
82
83       -n     Don’t make any changes.  Problems are reported, but not fixed.
84
85       -G     Force re-parsing of the underlying message (checks GUID correct‐
86              ness). Reconstruct with -G should fix  all  possible  individual
87              message issues, including corrupted data files.
88
89       -I     If  two  mailboxes  exist with the same UNIQUEID and reconstruct
90              visits both of them, -I will cause the second mailbox to have  a
91              new  UNIQUEID created for it.  If you don’t specify -I, you will
92              just get a syslog entry telling you of the clash.
93
94       -R     Perform a UID upgrade operation on  GUID  mismatch  files.   Use
95              this  option  if  you  think your index is corrupted rather than
96              your message files, or if all backup attempts  have  failed  and
97              you’re happy to be served the missing files.
98
99       -U     Use  this option if you have corrupt message files in your spool
100              and have been unable to restore them  from  backup.   This  will
101              make the mailbox IOERROR free and fix replication.
102
103              WARNING:  this  deletes corrupt message files for ever - so make
104              sure you’ve exhausted other options first!
105
106       -o     Ignore odd files in your  mailbox  disk  directories.   Probably
107              useful if you are using some tool which adds additional tracking
108              files.
109
110       -O     Delete odd files.  This is the opposite of -o.
111
112       -M     Prefer mailboxes.db over cyrus.header  -  will  rewrite  ACL  or
113              uniqueid  from the mailboxes.db into the header file rather than
114              the other way around.  This feature was  introduced  in  version
115              3.0.
116
117       -V version
118              Change  the  cyrus.index  minor  version  to a specific version.
119              This can be useful for upgrades or  downgrades.  Use  a  magical
120              version  of max to upgrade to the latest available database for‐
121              mat version.
122
123       -u     Instead of mailbox prefixes, give usernames on the command line
124
125       -P     Instead of mailbox prefixes, give paths to cyrus.header files on
126              the  command line.  The paths can be mailbox directories, or ex‐
127              plicit cyrus.header filenames.   This  will  ONLY  create/repair
128              mailboxes.db records using data in cyrus.header and cyrus.index.
129

EXAMPLES

131       reconstruct -r -f tech.support
132          Recursively  reconstruct all mailboxes within the tech.support hier‐
133          archy, restoring any directories containing cyrus.header files.
134
135       reconstruct -r -f tech.support.Archive.2%
136          Recursively reconstruct all mailboxes  within  the  tech.support.Ar‐
137          chive  hierarchy with names beginning with ‘2’, restoring any direc‐
138          tories containing cyrus.header files.
139
140       reconstruct -r -f -u jsmith
141          Recursively reconstruct all mailboxes belonging to jsmith, restoring
142          any directories containing cyrus.header files.
143

HISTORY

145       The options -k (keep flags) and -g (clear GUID) have been deprecated in
146       Cyrus version 2.4.
147
148       The -u and -V options were added in Cyrus version 2.5.
149
150       The -M option was added in Cyrus version 3.0.
151

FILES

153       /etc/imapd.conf
154

SEE ALSO

156       imapd.conf(5)
157

AUTHOR

159       The Cyrus Team, Nic Bernstein (Onlight)
160
162       1993–2022, The Cyrus Team
163
164
165
166
1673.6.0                          December 12, 2022                RECONSTRUCT(8)
Impressum