reconstruct changes

Bron Gondwana brong at
Wed May 20 19:28:42 EDT 2009

On Wed, May 20, 2009 at 10:48:42AM -0400, Brian Awood wrote:
> We'd like to make some changes to reconstruct, but would like to get 
> some feedback on them.  Attached is a diff of the changes. 
> First we'd like to make -k the default behavior if delayed expunge is 
> enabled.  Second, add a -w flag to warn about changes that would be 
> made to a mailbox, similar to ctl_mboxlist -w.  Third, add -e to 
> enable indexing un-indexed messages to a new cyrus.expunge rather 
> than putting them into the cyrus.index file.  -e can be useful when a 
> expunge file isn't verifiable or corrupted and you don't want a large 
> number of deleted messages to reappear in a users mailbox.  

I approve of all these ideas.

> +    while ((opt = getopt(argc, argv, "C:kp:rmfsxgGwe")) != EOF) {
> +    if( config_getenum(IMAPOPT_EXPUNGE_MODE) ==
> +	keepflag = 1;
> +    }

The only downside here is that there's no way to say "don't keep
expunged messages" short of using a different config file.  Maybe
add '-K' to mean "don't keep expunged"?  Messy, I know.

> +    if( !warn_only ) {

(in various places) - the only downside I see here is that later
check may assume earlier "create missing stuff" ran - so you'll
get errors looking at things inside a mailbox because you just
can't open it without a cyrus.header file, and you chose not to
create that.

I don't have an easy answer for you though!

I've added some patches (I think they're all upstream now) to
syslog if reconstruct finds anything to fix, and also syslog
when it gets run on any particular mailbox (to make tracking
down changes easier), and I suspect a few more syslog
statements in there wouldn't go astray either.  But your patch
looks good as-is.


More information about the Cyrus-devel mailing list