Browse Source

*** allow deleting non-empty folders

*** this is is an *untested* rebase; originally submitted against 1.3.
*** wip/unchecked-remove contains an alternative approach.

patch by Florian Lombard <f.lombard@montmirail.com>

============

> i'll consider this.
> my biggest concern is that some transient error would falsify the
> mailbox list and thus cause the folders to be nuked. similary, a
> permanent change in the server configuration would have that effect.
> arguably, either wouldn't be so bad as such, as it would destroy only
> the replica. however, it would be important to verify that the replica
> does not contain any unpropagated mails (as opposed to any mails at all,
> as is done currently).

Well, when you are sure about your settings, this can be usefull, as my
users where renaming folders while I was working on the sync.
At start I was logging to the mailbox, deleted the folder, and syncing
again.
wip/exchange-workarounds-1.5
Oswald Buddenhagen 7 years ago
parent
commit
0af93316ff
  1. 2
      src/config.c
  2. 2
      src/sync.c
  3. 1
      src/sync.h

2
src/config.c

@ -265,6 +265,8 @@ getopt_helper( conffile_t *cfile, int *cops, channel_conf_t *conf )
conf->cut_lines = parse_bool( cfile ); conf->cut_lines = parse_bool( cfile );
} else if (!strcasecmp( "SkipBinaryContent", cfile->cmd )) { } else if (!strcasecmp( "SkipBinaryContent", cfile->cmd )) {
conf->skip_binary_content = parse_bool( cfile ); conf->skip_binary_content = parse_bool( cfile );
} else if (!strcasecmp( "DeleteNonEmpty", cfile->cmd )) {
conf->delete_nonempty = parse_bool( cfile );
} else if (!strcasecmp( "MaxMessages", cfile->cmd )) { } else if (!strcasecmp( "MaxMessages", cfile->cmd )) {
conf->max_messages = parse_int( cfile ); conf->max_messages = parse_int( cfile );
} else if (!strcasecmp( "ExpireSide", cfile->cmd )) { } else if (!strcasecmp( "ExpireSide", cfile->cmd )) {

2
src/sync.c

@ -436,7 +436,7 @@ box_confirmed2( sync_vars_t *svars, int t )
svars->chan->name, str_fn[t], svars->orig_name[t] ); svars->chan->name, str_fn[t], svars->orig_name[t] );
goto bail; goto bail;
} }
if (svars->drv[t^1]->confirm_box_empty( svars->ctx[t^1] ) != DRV_OK) { if (!global_conf.delete_nonempty && svars->drv[t^1]->confirm_box_empty( svars->ctx[t^1] ) != DRV_OK) {
warn( "Warning: channel %s: %s box %s cannot be opened and %s box %s is not empty.\n", warn( "Warning: channel %s: %s box %s cannot be opened and %s box %s is not empty.\n",
svars->chan->name, str_fn[t], svars->orig_name[t], str_fn[t^1], svars->orig_name[t^1] ); svars->chan->name, str_fn[t], svars->orig_name[t], str_fn[t^1], svars->orig_name[t^1] );
goto done; goto done;

1
src/sync.h

@ -63,6 +63,7 @@ typedef struct channel_conf {
uint max_line_len; uint max_line_len;
char cut_lines; char cut_lines;
char skip_binary_content; /* for master only */ char skip_binary_content; /* for master only */
char delete_nonempty;
} channel_conf_t; } channel_conf_t;
typedef struct group_conf { typedef struct group_conf {

Loading…
Cancel
Save