Hi,
Please find attached a small patch for isync 1.0.4. This fixes a problem
where an SSL connection is attempted and SSL authentication fails. 1.0.4
then tries to send "LOGOUT" to the server, which doesn't work as the
server is expecting the connection to use SSL, so 1.0.4 hangs awaiting a
response.
You can see this with the attached rc file and the command:
mbsync --config isync-1.0.4-imaps-error.rc c
The patch prevents the attempt to issue LOGOUT when the connection is
unusable, so instead of hanging the above command returns to the shell
prompt.
Steve
P.S. Apologies if this is fixed in a later version, but the CVS link on
http://isync.sourceforge.net/ didn't work for me.
diff --unified --recursive isync-1.0.4-orig/src/drv_imap.c isync-1.0.4/src/drv_imap.c
--- isync-1.0.4-orig/src/drv_imap.c 2007-09-22 09:44:12.000000000 +0100
+++ isync-1.0.4/src/drv_imap.c 2010-06-22 21:10:11.000000000 +0100
@@ -95,6 +95,7 @@
SSL *ssl;
unsigned int use_ssl:1;
#endif
+ int usable;
} Socket_t;
typedef struct {
@@ -1054,7 +1055,8 @@
imap_t *imap = ictx->imap;
if (imap->buf.sock.fd != -1) {
- imap_exec( ictx, 0, "LOGOUT" );
+ if (imap->buf.sock.usable)
+ imap_exec( ictx, 0, "LOGOUT" );
close( imap->buf.sock.fd );
}
#ifdef HAVE_LIBSSL
@@ -1213,6 +1215,7 @@
ctx->gen.conf = conf;
ctx->imap = imap = nfcalloc( sizeof(*imap) );
imap->buf.sock.fd = -1;
+ imap->buf.sock.usable = 0;
imap->in_progress_append = &imap->in_progress;
/* open connection to IMAP server */
@@ -1282,6 +1285,11 @@
}
#endif
+ /* We can now use the socket to talk to the server. (This isn't always true. For IMAPS we may connect
+ * but be unable to initiate SSL communication correctly.)
+ */
+ imap->buf.sock.usable = 1;
+
/* read the greeting string */
if (buffer_gets( &imap->buf, &rsp )) {
fprintf( stderr, "IMAP error: no greeting response\n" );
# Global configuration section
# Values here are used as defaults for any following Channel section that
# doesn't specify them.
Sync All
Expunge None
Create Both
IMAPStore riemann
Host 127.0.0.1
User steven
Pass irrelevant
RequireSSL no
UseSSLv2 no
UseSSLv3 no
UseTLSv1 no
# Trash Trash
IMAPStore abel
Host imap.gmail.com
User steven
Pass badpass
UseIMAPS yes
RequireSSL yes
Channel c
Master :abel:
Slave :riemann:
# Patterns *child* *web* mailing-lists*announce* mailing-lists.eh *skeptic*
*going-live* *randi* *bbc-micro* INBOX
# Patterns INBOX
Patterns * !local-only*
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel