sync_server protocol & sync_try_imap option

ellie timoney ellie at fastmail.com
Mon Jan 30 17:16:02 EST 2017


Hi Thomas,



Your understanding of the imap / sync relationship is backwards: it's
not that sync_server now understands imap-style commands with tags, but
rather that imapd can now act as a sync destination.


Specifically, imapd now supports SYNCAPPLY, SYNCGET and SYNCRESTART
commands, which correspond respectively with the APPLY, GET and RESTART
commands supported by sync_server.  (You must be authenticated as an
admin for these commands to be available.)


When sync_client connects to the specified port, it doesn't know
whether the remote end is a sync_server or an imapd.  The sync_try_imap
setting is used to control whether it tries to use IMAP protocol or
not.  When set to "yes" (the default), it will send the C01 CAPABILITY
as you observed.


 *If the remote end is imapd, this will succeed, and replication will
 proceed using the IMAP style protocol.
* If the remote end is sync_server, it will return a protocol error (as
  you observed) since it doesn't support the IMAP protocol.  In this
  case, sync_client will then fall back to using the CSYNC protocol, and
  replication will proceed.


If sync_try_imap is set to "no", then sync_client will not try the IMAP
protocol at all -- it will just proceed directly to CSYNC.


The default setting will support replicating to either sync_server or
imapd.  If you don't intend to use imapd for replication, you can speed
up the initial connection by disabling sync_try_imap.


Cheers,



ellie



On Tue, Jan 31, 2017, at 02:07 AM, Thomas Cataldo via Cyrus-devel wrote:
> Hi,

> 

> I have some questions about sync_server protocol regarding the
> sync_try_imap option.
> 

> When trying a git build of cyrus 3, sync_client begins its dialog with
> the sync_server with a :
> 

> C01 CAPABILITY

> 

> 

> I understand what the answer should be to this capability
> request, I issue the same command to a cyrus 3 sync_server and
> here is what I get :
> 

> root at bm1604:~# telnet localhost 2500



> Trying ::1...



> Trying 127.0.0.1...



> Connected to localhost.



> Escape character is '^]'.



> * SASL PLAIN



> * STARTTLS



> * COMPRESS DEFLATE



> * OK bm1604 Cyrus sync server 3.0.0-rc1-70-gd12e571



> C01 CAPABILITY



> BAD IMAP_PROTOCOL_ERROR Unrecognized command



> 



> So my question is whether the master branch really supports an imap
> like variant of the replication protocol. If it does, I would like to
> know how to enable it.
> What I expect is that with tagged commands, the replication could
> multiplex some of its operations.
> eg. when 2 mailboxes are changed, it could issue :



> M01 APPLY MAILBOX %(...)



> M02 APPLY MAILBOX %(...)



> without waiting for the response to M01.



> 



> Regards,



> Thomas.



> 




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/cyrus-devel/attachments/20170131/40b21b0e/attachment.html>


More information about the Cyrus-devel mailing list