Browse Source

make it possible to specify CopyArrivalDate and MaxMessages globally

sneaky change on the side: the wording of the man page is changed from
"outside any section" to "before any section" to get global options.
this is not entirely true ... the previously existing options behave as
before, while the two newcomers actually affect subsequent channels.
wip/maildir-uid-dupes-test
Oswald Buddenhagen 11 years ago
parent
commit
f586c0bee5
  1. 10
      src/config.c
  2. 12
      src/mbsync.1

10
src/config.c

@ -229,6 +229,10 @@ getopt_helper( conffile_t *cfile, int *cops, channel_conf_t *conf )
conf->ops[M] |= XOP_HAVE_CREATE; conf->ops[M] |= XOP_HAVE_CREATE;
} else if (!strcasecmp( "SyncState", cfile->cmd )) } else if (!strcasecmp( "SyncState", cfile->cmd ))
conf->sync_state = expand_strdup( cfile->val ); conf->sync_state = expand_strdup( cfile->val );
else if (!strcasecmp( "CopyArrivalDate", cfile->cmd ))
conf->use_internal_date = parse_bool( cfile );
else if (!strcasecmp( "MaxMessages", cfile->cmd ))
conf->max_messages = parse_int( cfile );
else else
return 0; return 0;
return 1; return 1;
@ -364,15 +368,13 @@ load_config( const char *where, int pseudo )
{ {
channel = nfcalloc( sizeof(*channel) ); channel = nfcalloc( sizeof(*channel) );
channel->name = nfstrdup( cfile.val ); channel->name = nfstrdup( cfile.val );
channel->max_messages = global_conf.max_messages;
channel->use_internal_date = global_conf.use_internal_date;
cops = 0; cops = 0;
max_size = -1; max_size = -1;
while (getcline( &cfile ) && cfile.cmd) { while (getcline( &cfile ) && cfile.cmd) {
if (!strcasecmp( "MaxSize", cfile.cmd )) if (!strcasecmp( "MaxSize", cfile.cmd ))
max_size = parse_size( &cfile ); max_size = parse_size( &cfile );
else if (!strcasecmp( "MaxMessages", cfile.cmd ))
channel->max_messages = parse_int( &cfile );
else if (!strcasecmp( "CopyArrivalDate", cfile.cmd ))
channel->use_internal_date = parse_bool( &cfile );
else if (!strcasecmp( "Pattern", cfile.cmd ) || else if (!strcasecmp( "Pattern", cfile.cmd ) ||
!strcasecmp( "Patterns", cfile.cmd )) !strcasecmp( "Patterns", cfile.cmd ))
{ {

12
src/mbsync.1

@ -472,11 +472,6 @@ does not exist.
Permanently remove all messages [on the Master/Slave] marked for deletion. Permanently remove all messages [on the Master/Slave] marked for deletion.
(Global default: \fINone\fR) (Global default: \fINone\fR)
.. ..
.P
\fBSync\fR, \fBCreate\fR and \fBExpunge\fR can be used outside any section for
a global effect. The global settings are overridden by Channel-specific options,
which in turn are overridden by command line switches.
..
.TP .TP
\fBCopyArrivalDate\fR {\fIyes\fR|\fIno\fR} \fBCopyArrivalDate\fR {\fIyes\fR|\fIno\fR}
Selects whether their arrival time should be propagated together with Selects whether their arrival time should be propagated together with
@ -487,6 +482,13 @@ Note that IMAP does not guarantee that the time stamp (termed \fBinternal
date\fR) is actually the arrival time, but it is usually close enough. date\fR) is actually the arrival time, but it is usually close enough.
(Default: \fIno\fR) (Default: \fIno\fR)
.. ..
.P
\fBSync\fR, \fBCreate\fR, \fBExpunge\fR,
\fBMaxMessages\fR, and \fBCopyArrivalDate\fR
can be used before any section for a global effect.
The global settings are overridden by Channel-specific options,
which in turn are overridden by command line switches.
..
.TP .TP
\fBSyncState\fR {\fB*\fR|\fIpath\fR} \fBSyncState\fR {\fB*\fR|\fIpath\fR}
Set the location of this Channel's synchronization state files. \fB*\fR means Set the location of this Channel's synchronization state files. \fB*\fR means

Loading…
Cancel
Save