print STDERR "Synchronize the given MAILBOXes between two QRESYNC-capable IMAP4rev1 servers.\n"
."Options:\n"
." --config=FILE Specify an alternate configuration file\n"
- ." -1, --oneshot Exit as soon as all mailboxes are synchronized\n"
." --repair List the database anomalies and try to repair them\n"
." -q, --quiet Try to be quiet\n"
." --debug Turn on debug mode\n"
}
exit $rv;
}
-usage(1) unless GetOptions(\%CONFIG, qw/config=s quiet|q oneshot|1 repair debug help|h/);
+usage(1) unless GetOptions(\%CONFIG, qw/config=s quiet|q repair debug help|h/);
usage(0) if $CONFIG{help};
#my $mailboxes = $client->list((uc $config{'subscribed-only'} eq 'TRUE' ? '(SUBSCRIBED)' : '' )
# .$config{mailboxes}, 'SUBSCRIBED');
# $client->notify('SELECTED', 'MAILBOXES ('.join(' ', keys %$mailboxes).')');
- $client->notify(qw/SELECTED SUBSCRIBED/) unless $CONFIG{oneshot};
+ # XXX NOTIFY doesn't work as expected for INBOX
+ # http://dovecot.org/pipermail/dovecot/2015-July/101514.html
+ #$client->notify(qw/SELECTED SUBSCRIBED/) if $CONFIG{watch};
# XXX We shouldn't need to ask for STATUS responses here, and use
# NOTIFY's STATUS indicator instead. However Dovecot violates RFC
# 5464: http://dovecot.org/pipermail/dovecot/2015-July/101474.html
}
}
# clean state!
- exit 0 if $CONFIG{oneshot};
+ exit 0 unless $CONFIG{watch};
wait_notifications(900);
}
.SH DESCRIPTION
.PP
.B imapsync\fR performs stateful synchronization between two IMAP4rev1
-servers, then (unless the flag \fB\-\-oneshot\fR is set) keeps both
-connection open and wait for new changes to arrive.
+servers.
Such synchronization is made possible by the QRESYNC extension from
[RFC7162]; for convenience reasons support for LIST\-EXTENDED [RFC5258],
LIST\-STATUS [RFC5819] and UIDPLUS [RFC4315] is also required.
providing extra arguments limits the synchronization to the given
\fIMAILBOX\fRes only.
-.PP
-In its default mode (unless the flag \fB\-\-oneshot\fR or
-\fB\-\-repair\fR is set), \fBimapsync\fR does not exit once all
-mailboxes have been synchronized. Instead, it keeps both connection
-open and uses the NOTIFY command from [RFC5465] to be notified of new
-changes (on any mailbox) as soon as they arrive. If no update is sent
-in 15 minutes, a NOOP command is issued in order not to trigger the
-servers' inactivity timeout and be logged out.
-
.PP
If the synchronization was interrupted during a previous run while some
messages were being replicated (but before the UIDNEXT or HIGHESTMODSEQ
\fI$XDG_CONFIG_HOME\fR, or \fI~/.config\fR if the XDG_CONFIG_HOME
environment variable is unset.
-.TP
-.B \-1\fR, \fB\-\-oneshot\fR
-Exit as soon as all mailboxes are synchronized, instead of passively
-waiting for updates from the open connections.
-Using \fB\-\-oneshot\fR removes the requirement that IMAP servers must
-advertise support the NOTIFY extension [RFC5465].
-
.TP
.B \-\-repair
List the database anomalies and try to repair them.