File: reconstruct.8

package info (click to toggle)
cyrus-imapd 2.5.10-3%2Bdeb9u2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 18,752 kB
  • sloc: ansic: 135,753; perl: 9,772; sh: 5,827; makefile: 1,572; yacc: 1,554; asm: 309; lex: 306; awk: 302
file content (229 lines) | stat: -rw-r--r-- 6,425 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
.\" -*- nroff -*-
.TH CYRRECONSTRUCT 8 "Project Cyrus" CMU
.\"
.\" Copyright (c) 1994-2008 Carnegie Mellon University.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\"
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in
.\"    the documentation and/or other materials provided with the
.\"    distribution.
.\"
.\" 3. The name "Carnegie Mellon University" must not be used to
.\"    endorse or promote products derived from this software without
.\"    prior written permission. For permission or any legal
.\"    details, please contact
.\"      Carnegie Mellon University
.\"      Center for Technology Transfer and Enterprise Creation
.\"      4615 Forbes Avenue
.\"      Suite 302
.\"      Pittsburgh, PA  15213
.\"      (412) 268-7393, fax: (412) 268-7395
.\"      innovation@andrew.cmu.edu
.\"
.\" 4. Redistributions of any form whatsoever must retain the following
.\"    acknowledgment:
.\"    "This product includes software developed by Computing Services
.\"     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
.\"
.\" CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
.\" THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
.\" AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
.\" FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
.\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.SH NAME
cyrreconstruct \- reconstruct mailboxes
.SH SYNOPSIS
.B cyrreconstruct
[
.B \-C
.I config-file
]
[
.B \-p
.I partition
]
[
.B \-x
]
[
.B \-r
]
[
.B \-f
]
.br
            [
.B \-k  
]
[
.B \-s
]
[
.B \-g
]
[
.B \-G
]
[
.B \-R
]
[
.B \-o
]
[
.B \-O
]
.IR mailbox ...
.br
.br
.B cyrreconstruct
[
.B \-C
.I config-file
]
.B \-m
.SH DESCRIPTION
.I cyrreconstruct
rebuilds one or more IMAP mailboxes.  When invoked with the
.B \-m
switch, it rebuilds the master
mailboxes file.  It can be used to recover from
almost any sort of data corruption.
.PP
If
.I cyrreconstruct
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 
.I reconstruct
attempts to preserve includes the flag names, flag state, and
internaldate.
.I cyrreconstruct
derives all other information from the message files.
.PP
.I cyrreconstruct
reads its configuration options out of the
.IR imapd.conf (5)
file unless specified otherwise by \fB-C\fR.  Any mailbox directory
underneath the path specified in the
.I partition-news
configuration option is assumed to be in news format.
.PP
.I cyrreconstruct
does not adjust the quota usage recorded in any quota
root files.  After running
.IR cyrreconstruct ,
it is advisable to run
.IR cyrquota (8)
with the
.I \-f
switch in order to fix the quota root files.
.SH OPTIONS
.TP
.BI \-C " config-file"
Read configuration options from \fIconfig-file\fR.
.TP
.BI \-p " 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)
.TP
.B \-x
When processing a mailbox which is not in the mailbox list (e.g. via
the -p or -f 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).
.TP
.B \-r
Recursively reconstruct all sub-mailboxes of the mailboxes or mailbox
prefixes given as arguments.
.TP
.B \-f
Examine the filesystem underneath mailbox, adding all directories with
a cyrus.header found there as new mailboxes.  Useful for
restoring mailboxes from backups.
.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 mistmatches).  "reconstruct -s" should be quite fast.
.TP
.B \-q
Emit less verbose information to syslog.
.TP
.B \-n
Don't make any changes.  This gives equivalent behaviour to
.I chk_cyrus
where problems are reported, but not fixed.
.TP
.B \-G
Force re-parsing of the underlying message (checks GUID correctness).
cyrreconstruct with -G should fix all possible individual message issues,
including corrupted data files.
.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.
.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.
.B WARNING
this deletes corrupt message files for ever - so make sure you've exhausted
other options first!
.TP
.B -o
Ignore odd files in your mailbox disk directories.  Probably useful if you
are using some tool which adds additional tracking files.
.TP
.B -O
Delete odd files.  This is the opposite of '-o'.
.TP
.BI \-V " version"
Change the cyrus.index minor version to a specific version. This can be
useful for upgrades or downgrades. Use a magical version of \fImax\fR to
upgrade to the latest available database format version.
.TP
.B -u
Instead of mailbox prefixes, give usernames on the command line
.TP
.B \-m
.B NOTE: CURRENTLY UNAVAILABLE
.br
Rebuild the
.I mailboxes
file.  Use whatever data in the existing
.I mailboxes
file it can scavenge, then scans all partitions listed in the
.IR imapd.conf (5)
file for additional mailboxes.
.SH EXAMPLES
You want to reconstruct the index files for a user, you have recovered a deleted mail file from backup
and given it a suitable name (eg user/ben-lacy/33.), but it is not visible since it is not indexed:

.nf
reconstruct -r user.ben-lacy
.fi
.PP
If you have the \fBunixhierarchysep:yes\fR option set in \fB/etc/imapd.conf\fR you would need
to run:

.nf
reconstruct -r user/ben.lacy
.fi

.SH FILES
.TP
.B /etc/imapd.conf