[commit] branch 'wip/uidval-recovery' created

2016-11-06 Thread Oswald Buddenhagen
The branch 'wip/uidval-recovery' has been created at 9cd378d.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] master: Merge branch 'isync_1_2_branch'

2016-11-05 Thread Oswald Buddenhagen
Skipped 3 existing revision(s) on branch 'master'.

commit b2f6ef391bba6c0c77002f73fe259b424fce1169
Merge: 46e792c 41308e4
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sat Nov 5 13:16:32 2016 +0100

Merge branch 'isync_1_2_branch'

 src/socket.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)


= Full diff against 1st parent =

diff --git a/src/socket.c b/src/socket.c
index 8b19396..6ab3ce4 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -39,8 +39,11 @@
 #ifdef HAVE_LIBSSL
 # include 
 # include 
-# include 
 # include 
+# if OPENSSL_VERSION_NUMBER < 0x1010L
+#  define X509_OBJECT_get0_X509(o) ((o)->data.x509)
+#  define X509_STORE_get0_objects(o) ((o)->objs)
+# endif
 #endif
 
 enum {
@@ -172,13 +175,13 @@ verify_cert_host( const server_conf_t *conf, conn_t *sock 
)
 
trusted = (STACK_OF(X509_OBJECT) *)sock->conf->trusted_certs;
for (i = 0; i < sk_X509_OBJECT_num( trusted ); i++) {
-   if (!X509_cmp( cert, sk_X509_OBJECT_value( trusted, i 
)->data.x509 ))
+   if (!X509_cmp( cert, X509_OBJECT_get0_X509( 
sk_X509_OBJECT_value( trusted, i ) ) ))
return 0;
}
 
err = SSL_get_verify_result( sock->ssl );
if (err != X509_V_OK) {
-   error( "SSL error connecting %s: %s\n", sock->name, 
ERR_error_string( err, NULL ) );
+   error( "SSL error connecting %s: %s\n", sock->name, 
X509_verify_cert_error_string( err ) );
return -1;
}
 
@@ -223,7 +226,7 @@ init_ssl_ctx( const server_conf_t *conf )
   conf->cert_file, ERR_error_string( ERR_get_error(), 0 ) 
);
return 0;
}
-   mconf->trusted_certs = (_STACK *)sk_X509_OBJECT_dup( 
SSL_CTX_get_cert_store( mconf->SSLContext )->objs );
+   mconf->trusted_certs = (_STACK *)sk_X509_OBJECT_dup( 
X509_STORE_get0_objects( SSL_CTX_get_cert_store( mconf->SSLContext ) ) );
if (mconf->system_certs && !SSL_CTX_set_default_verify_paths( 
mconf->SSLContext ))
warn( "Warning: Unable to load default certificate files: %s\n",
  ERR_error_string( ERR_get_error(), 0 ) );

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch 'wip/ssl-fprint' created

2016-11-05 Thread Oswald Buddenhagen
The branch 'wip/ssl-fprint' has been created at 3d9c2ff.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch 'wip/socket-debug' created

2016-11-05 Thread Oswald Buddenhagen
The branch 'wip/socket-debug' has been created at 7595196.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch 'wip/inboxStrictness' created

2016-11-05 Thread Oswald Buddenhagen
The branch 'wip/inboxStrictness' has been created at 257f351.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch 'ssl-fprint' deleted

2016-11-05 Thread Oswald Buddenhagen
The branch 'ssl-fprint', previously at 3d9c2ff, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch 'wip/ignoreInboxCase' created

2016-11-05 Thread Oswald Buddenhagen
The branch 'wip/ignoreInboxCase' has been created at 6cc72b4.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'isync_1_0_5' deleted

2016-11-05 Thread Oswald Buddenhagen
The tag 'isync_1_0_5', previously at 9f1320f, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'isync_1_0_4' deleted

2016-11-05 Thread Oswald Buddenhagen
The tag 'isync_1_0_4', previously at 5e43508, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'isync_0_7' deleted

2016-11-05 Thread Oswald Buddenhagen
The tag 'isync_0_7', previously at 2c648da, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'isync_1_0_2' deleted

2016-11-05 Thread Oswald Buddenhagen
The tag 'isync_1_0_2', previously at d7b8621, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'isync_0_8' deleted

2016-11-05 Thread Oswald Buddenhagen
The tag 'isync_0_8', previously at 6267139, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'isync_1_1_2' deleted

2016-11-05 Thread Oswald Buddenhagen
The tag 'isync_1_1_2', previously at 2fa75cf, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'isync_1_1_3' deleted

2016-11-05 Thread Oswald Buddenhagen
The tag 'isync_1_1_3', previously at 960e10e, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'isync_1_0_1' deleted

2016-11-05 Thread Oswald Buddenhagen
The tag 'isync_1_0_1', previously at 1a77d2e, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'isync_1_1_0' deleted

2016-11-05 Thread Oswald Buddenhagen
The tag 'isync_1_1_0', previously at f9386d0, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.4), (v1.0.5), (v1.0.6): avoid crash in case of a rather weird (==misconfigured?) sync state

2016-11-05 Thread Oswald Buddenhagen
commit 0d27c5f4cbb3fee83121ad9c0c12e25efcc8a0af
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Wed Apr 4 17:55:13 2007 +

avoid crash in case of a rather weird (==misconfigured?) sync state
location.

 src/sync.c |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/sync.c b/src/sync.c
index 347dfef..b9bfdb3 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -711,10 +711,11 @@ sync_boxes( store_t *mctx, const char *mname,
goto bail;
}
 
-   s = strrchr( dname, '/' );
-   *s = 0;
-   mkdir( dname, 0700 );
-   *s = '/';
+   if ((s = strrchr( dname, '/' ))) {
+   *s = 0;
+   mkdir( dname, 0700 );
+   *s = '/';
+   }
if (lfd < 0) {
if ((lfd = open( lname, O_WRONLY|O_CREAT, 0666 )) < 0)
goto lferr;

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.4), (v1.0.5), (v1.0.6): accept empty SEARCH IMAP responses - reasonable servers omit them

2016-11-05 Thread Oswald Buddenhagen
commit 0eb399c672ab755151ee35edf3bc38fd9e8631d3
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Wed Apr 4 13:27:24 2007 +

accept empty SEARCH IMAP responses - reasonable servers omit them
alltogether, but this is allowed, too. patch by
CCMAIL: Alexander Gerasiov <g...@cs.msu.su>
fixes debian bug #413336

fixed in HEAD a year ago - accidentally ...

 src/drv_imap.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index 21e6018..1e976f2 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -865,7 +865,9 @@ parse_search( imap_t *imap, char *cmd )
int uid;
 
arg = next_arg(  );
-   if (!arg || !(uid = atoi( arg ))) {
+   if (!arg)
+   return;
+   if (!(uid = atoi( arg ))) {
fprintf( stderr, "IMAP error: malformed SEARCH response\n" );
return;
}

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v1.1.3' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v1.1.3' has been created at 960e10e.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.3), (v1.0.4), (v1.0.5), (v1.0.6): make config parsing more robust against bogus input and report errors

2016-11-05 Thread Oswald Buddenhagen
commit 927feae988b29c0161c63dd47d755ef664ddfda8
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sun Mar 19 10:46:33 2006 +

make config parsing more robust against bogus input and report errors
more clearly.

 src/drv_imap.c |   66 +++
 1 files changed, 38 insertions(+), 28 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index f930764..2f215d8 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -254,11 +254,9 @@ init_ssl_ctx( imap_store_t *ctx )
if (!srvc->cert_file) {
fprintf( stderr, "Error, CertificateFile not defined\n" );
return -1;
-   } else if (access( srvc->cert_file, R_OK ))
-   warn( "*** Warning: can't read CertificateFile, so can't verify 
server certificates\n" );
-   else if (!SSL_CTX_load_verify_locations( imap->SSLContext, 
srvc->cert_file, NULL )) {
-   fprintf( stderr, "Error, SSL_CTX_load_verify_locations: %s\n",
-ERR_error_string( ERR_get_error(), 0 ) );
+   } else if (!SSL_CTX_load_verify_locations( imap->SSLContext, 
srvc->cert_file, NULL )) {
+   fprintf( stderr, "Error while loading certificate file '%s': 
%s\n",
+srvc->cert_file, ERR_error_string( ERR_get_error(), 0 
) );
return -1;
}
 
@@ -1695,6 +1693,7 @@ imap_parse_store( conffile_t *cfg, store_conf_t **storep, 
int *err )
 {
imap_store_conf_t *store;
imap_server_conf_t *server, *srv, sserver;
+   int acc_opt = 0;
 
if (!strcasecmp( "IMAPAccount", cfg->cmd )) {
server = nfcalloc( sizeof(*server) );
@@ -1707,6 +1706,7 @@ imap_parse_store( conffile_t *cfg, store_conf_t **storep, 
int *err )
store->gen.driver = _driver;
store->gen.name = nfstrdup( cfg->val );
store->use_namespace = 1;
+   *storep = >gen;
memset( , 0, sizeof(sserver) );
server = 
} else
@@ -1721,17 +1721,7 @@ imap_parse_store( conffile_t *cfg, store_conf_t 
**storep, int *err )
 #endif
 
while (getcline( cfg ) && cfg->cmd) {
-   if (!strcasecmp( "Account", cfg->cmd )) {
-   for (srv = servers; srv; srv = srv->next)
-   if (srv->name && !strcmp( srv->name, cfg->val ))
-   goto gotsrv;
-   fprintf( stderr, "%s:%d: unknown IMAP account '%s'\n",
-cfg->file, cfg->line, cfg->val );
-   *err = 1;
-   continue;
- gotsrv:
-   store->server = srv;
-   } else if (!strcasecmp( "Host", cfg->cmd )) {
+   if (!strcasecmp( "Host", cfg->cmd )) {
 #if HAVE_LIBSSL
if (!memcmp( "imaps:", cfg->val, 6 )) {
cfg->val += 6;
@@ -1759,9 +1749,14 @@ imap_parse_store( conffile_t *cfg, store_conf_t 
**storep, int *err )
else if (!strcasecmp( "Port", cfg->cmd ))
server->port = parse_int( cfg );
 #if HAVE_LIBSSL
-   else if (!strcasecmp( "CertificateFile", cfg->cmd ))
+   else if (!strcasecmp( "CertificateFile", cfg->cmd )) {
server->cert_file = expand_strdup( cfg->val );
-   else if (!strcasecmp( "RequireSSL", cfg->cmd ))
+   if (access( server->cert_file, R_OK )) {
+   fprintf( stderr, "%s:%d: CertificateFile '%s': 
%s\n",
+cfg->file, cfg->line, 
server->cert_file, strerror( errno ) );
+   *err = 1;
+   }
+   } else if (!strcasecmp( "RequireSSL", cfg->cmd ))
server->require_ssl = parse_bool( cfg );
else if (!strcasecmp( "UseSSLv2", cfg->cmd ))
server->use_sslv2 = parse_bool( cfg );
@@ -1775,34 +1770,49 @@ imap_parse_store( conffile_t *cfg, store_conf_t 
**storep, int *err )
else if (!strcasecmp( "Tunnel", cfg->cmd ))
server->tunnel = nfstrdup( cfg->val );
else if (store) {
-   if (!strcasecmp( "UseNamespace", cfg->cmd ))
+   if (!strcasecmp( "Account", cfg->cmd )) {
+   for (srv = servers; srv; srv = srv->next)
+   if (srv->name && !strcmp( srv->name, 
cfg->val ))
+ 

[commit] (v1.0.5), (v1.0.6): fix UIDNEXT handling

2016-11-05 Thread Oswald Buddenhagen
commit 1af2cfde4f573a91e6633974976cbcd1446c68dc
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sun Oct 3 14:25:59 2010 +0200

fix UIDNEXT handling

UIDNEXT *can* be legally zero, so deal with it.


 src/drv_imap.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index 53db79d..b8a4e5b 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -836,7 +836,7 @@ parse_response_code( imap_store_t *ctx, struct imap_cmd_cb 
*cb, char *s )
return RESP_BAD;
}
} else if (!strcmp( "UIDNEXT", arg )) {
-   if (!(arg = next_arg(  )) || !(imap->uidnext = atoi( arg ))) {
+   if (!(arg = next_arg(  )) || (imap->uidnext = strtol( arg, 
, 10 ), *p)) {
fprintf( stderr, "IMAP error: malformed NEXTUID 
status\n" );
return RESP_BAD;
}
@@ -1437,6 +1437,8 @@ imap_select( store_t *gctx, int minuid, int maxuid, int 
*excs, int nexcs )
prefix = ctx->prefix;
}
 
+   imap->uidnext = -1;
+
memset( , 0, sizeof(cb) );
cb.create = (gctx->opts & OPEN_CREATE) != 0;
cb.trycreate = 1;
@@ -1462,7 +1464,7 @@ imap_select( store_t *gctx, int minuid, int maxuid, int 
*excs, int nexcs )
goto bail;
}
if (maxuid == INT_MAX)
-   maxuid = imap->uidnext ? imap->uidnext - 1 : 10;
+   maxuid = imap->uidnext >= 0 ? imap->uidnext - 1 : 
10;
if (maxuid >= minuid &&
(ret = imap_exec_b( ctx, 0, "UID FETCH %d:%d (UID%s%s)", 
minuid, maxuid,
(gctx->opts & OPEN_FLAGS) ? " FLAGS" : 
"",

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.6): avoid preprocessor warnings on missing features: #if => #ifdef

2016-11-05 Thread Oswald Buddenhagen
commit f8a913ac80a967d0385b5c9577765791a08a055d
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sun Mar 27 12:06:41 2011 +0200

avoid preprocessor warnings on missing features: #if => #ifdef

(cherry picked from commit 4afd31a45755d8321f4e913b8092076d01c16335)

Conflicts:
src/drv_imap.c

 src/compat/main.c |6 +++---
 src/drv_imap.c|   42 +-
 src/main.c|2 +-
 3 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/src/compat/main.c b/src/compat/main.c
index 6183a91..4689d8e 100644
--- a/src/compat/main.c
+++ b/src/compat/main.c
@@ -34,7 +34,7 @@
 #include 
 #include 
 
-#if HAVE_GETOPT_LONG
+#ifdef HAVE_GETOPT_LONG
 # define _GNU_SOURCE
 # include 
 struct option Opts[] = {
@@ -185,7 +185,7 @@ main( int argc, char **argv )
 #define FLAGS "wW:alCLRc:defhp:qu:r:F:M:1I:s:vVD"
 
mod = all = list = ops = writeout = Quiet = Verbose = Debug = 0;
-#if HAVE_GETOPT_LONG
+#ifdef HAVE_GETOPT_LONG
while ((i = getopt_long( argc, argv, FLAGS, Opts, NULL )) != -1)
 #else
while ((i = getopt( argc, argv, FLAGS )) != -1)
@@ -250,7 +250,7 @@ main( int argc, char **argv )
mod = 1;
break;
case 's':
-#if HAVE_LIBSSL
+#ifdef HAVE_LIBSSL
if (!strncasecmp( "imaps:", optarg, 6 )) {
global.use_imaps = 1;
global.port = 993;
diff --git a/src/drv_imap.c b/src/drv_imap.c
index afe6df0..573f601 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -44,7 +44,7 @@
 #include 
 #include 
 #include 
-#if HAVE_LIBSSL
+#ifdef HAVE_LIBSSL
 # include 
 # include 
 # include 
@@ -59,7 +59,7 @@ typedef struct imap_server_conf {
int port;
char *user;
char *pass;
-#if HAVE_LIBSSL
+#ifdef HAVE_LIBSSL
char *cert_file;
unsigned use_imaps:1;
unsigned require_ssl:1;
@@ -92,7 +92,7 @@ typedef struct _list {
 
 typedef struct {
int fd;
-#if HAVE_LIBSSL
+#ifdef HAVE_LIBSSL
SSL *ssl;
unsigned int use_ssl:1;
 #endif
@@ -117,7 +117,7 @@ typedef struct imap {
/* command queue */
int nexttag, num_in_progress, literal_pending;
struct imap_cmd *in_progress, **in_progress_append;
-#if HAVE_LIBSSL
+#ifdef HAVE_LIBSSL
SSL_CTX *SSLContext;
 #endif
buffer_t buf; /* this is BIG, so put it last */
@@ -154,7 +154,7 @@ enum CAPABILITY {
UIDPLUS,
LITERALPLUS,
NAMESPACE,
-#if HAVE_LIBSSL
+#ifdef HAVE_LIBSSL
CRAM,
STARTTLS,
 #endif
@@ -165,7 +165,7 @@ static const char *cap_list[] = {
"UIDPLUS",
"LITERAL+",
"NAMESPACE",
-#if HAVE_LIBSSL
+#ifdef HAVE_LIBSSL
"AUTH=CRAM-MD5",
"STARTTLS",
 #endif
@@ -186,7 +186,7 @@ static const char *Flags[] = {
"Deleted",
 };
 
-#if HAVE_LIBSSL
+#ifdef HAVE_LIBSSL
 
 static int
 host_matches( const char *host, const char *pattern )
@@ -339,7 +339,7 @@ init_ssl_ctx( imap_store_t *ctx )
 static void
 socket_perror( const char *func, Socket_t *sock, int ret )
 {
-#if HAVE_LIBSSL
+#ifdef HAVE_LIBSSL
int err;
 
if (sock->use_ssl) {
@@ -373,7 +373,7 @@ static int
 socket_read( Socket_t *sock, char *buf, int len )
 {
int n =
-#if HAVE_LIBSSL
+#ifdef HAVE_LIBSSL
sock->use_ssl ? SSL_read( sock->ssl, buf, len ) :
 #endif
read( sock->fd, buf, len );
@@ -389,7 +389,7 @@ static int
 socket_write( Socket_t *sock, char *buf, int len )
 {
int n =
-#if HAVE_LIBSSL
+#ifdef HAVE_LIBSSL
sock->use_ssl ? SSL_write( sock->ssl, buf, len ) :
 #endif
write( sock->fd, buf, len );
@@ -410,7 +410,7 @@ socket_pending( Socket_t *sock )
return -1;
if (num > 0)
return num;
-#if HAVE_LIBSSL
+#ifdef HAVE_LIBSSL
if (sock->use_ssl)
return SSL_pending( sock->ssl );
 #endif
@@ -1260,7 +1260,7 @@ imap_open_store( store_conf_t *conf, store_t *oldctx )
struct hostent *he;
struct sockaddr_in addr;
int s, a[2], preauth;
-#if HAVE_LIBSSL
+#ifdef HAVE_LIBSSL
int use_ssl;
 #endif
 
@@ -1280,7 +1280,7 @@ imap_open_store( store_conf_t *conf, store_t *oldctx )
imap->in_progress_append = >in_progress;
 
/* open connection to IMAP server */
-#if HAVE_LIBSSL
+#ifdef HAVE_LIBSSL
use_ssl = 0;
 #endif
 
@@ -1338,7 +1338,7 @@ imap_open_store( store_conf_t *conf, store_t *oldctx )
imap->buf.sock.fd = s;
}
 
-#if HAVE_LIBSSL
+#ifdef HAVE_LIBSSL
if (srvc->use_imaps) {
if (start_tls( ctx ))
goto ssl_bail;
@@ -1368,7 +1368,7 @@ imap_open_store( store_conf_t *conf, store_t *oldctx )
goto bail;
 
if (!p

[commit] (v1.0.6): fix a bunch of warnings

2016-11-05 Thread Oswald Buddenhagen
commit 4dc7e17f3e06604a4082335c60e1f1101b4d9c7a
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sat Jul 7 17:19:17 2012 +0200

fix a bunch of warnings

(cherry picked from commit 61d98c5a1defdcce45dde75053c3a5bd3494383e)

Conflicts:
src/drv_imap.c
src/sync.c

 src/compat/convert.c |4 ++--
 src/drv_imap.c   |2 +-
 src/drv_maildir.c|2 +-
 src/sync.c   |2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/compat/convert.c b/src/compat/convert.c
index 0ed1ba2..e70d2f8 100644
--- a/src/compat/convert.c
+++ b/src/compat/convert.c
@@ -73,7 +73,7 @@ convert( config_t *box )
FILE *fp;
msg_t *msgs;
DB *db;
-   int i, ret, fd, uidval, maxuid, bl, uid, rmsgs, nmsgs, uv[2];
+   int i, ret, fd, uidval, maxuid, uid, rmsgs, nmsgs, uv[2];
unsigned u;
struct stat sb;
char buf[_POSIX_PATH_MAX], diumname[_POSIX_PATH_MAX],
@@ -160,7 +160,7 @@ convert( config_t *box )
rmsgs = 0;
nmsgs = 0;
for (i = 0; i < 2; i++) {
-   bl = nfsnprintf( buf, sizeof(buf), "%s/%s/", mboxdir, 
subdirs[i] );
+   nfsnprintf( buf, sizeof(buf), "%s/%s/", mboxdir, subdirs[i] );
if (!(d = opendir( buf ))) {
perror( "opendir" );
  err4:
diff --git a/src/drv_imap.c b/src/drv_imap.c
index 573f601..4c27bcf 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -303,7 +303,7 @@ init_ssl_ctx( imap_store_t *ctx )
imap_t *imap = ctx->imap;
imap_store_conf_t *conf = (imap_store_conf_t *)ctx->gen.conf;
imap_server_conf_t *srvc = conf->server;
-   SSL_METHOD *method;
+   const SSL_METHOD *method;
int options = 0;
 
if (srvc->use_tlsv1 && !srvc->use_sslv2 && !srvc->use_sslv3)
diff --git a/src/drv_maildir.c b/src/drv_maildir.c
index e6cf08d..4383ec2 100644
--- a/src/drv_maildir.c
+++ b/src/drv_maildir.c
@@ -641,7 +641,7 @@ maildir_scan( maildir_store_t *ctx, msglist_t *msglist )
else
u = ru = strchr( entry->base, ':' );
fnl = (u ?
-   nfsnprintf( buf + bl, sizeof(buf) - bl, 
"%s/%.*s,U=%d%s", subdirs[entry->recent], u - entry->base, entry->base, uid, ru 
) :
+   nfsnprintf( buf + bl, sizeof(buf) - bl, 
"%s/%.*s,U=%d%s", subdirs[entry->recent], (int)(u - entry->base), entry->base, 
uid, ru ) :
nfsnprintf( buf + bl, sizeof(buf) - bl, 
"%s/%s,U=%d", subdirs[entry->recent], entry->base, uid ))
+ 1 - 4;
memcpy( nbuf, buf, bl + 4 );
diff --git a/src/sync.c b/src/sync.c
index 5a5d247..a2fe95e 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -119,7 +119,7 @@ dump_box( store_t *ctx )
if (Debug)
for (msg = ctx->msgs; msg; msg = msg->next) {
make_flags( msg->flags, fbuf );
-   printf( "  message %d, %s, %d\n", msg->uid, fbuf, 
msg->size );
+   printf( "  message %d, %s, %lu\n", msg->uid, fbuf, 
msg->size );
}
 }
 

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.3), (v1.0.4), (v1.0.5), (v1.0.6): regen

2016-11-05 Thread Oswald Buddenhagen
commit 3f1009a8398d11bb4c230acfa6e0a4586add3d20
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Tue Jan 31 16:17:18 2006 +

regen

 ChangeLog |  122 +---
 1 files changed, 96 insertions(+), 26 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 73be2e2..2cf05f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,99 @@
+2006-01-31 16:45  Oswald Buddenhagen <o...@users.sf.net>
+
+   * configure.in:
+
+   bump version
+
+2006-01-31 16:21  Oswald Buddenhagen <o...@users.sf.net>
+
+   * Makefile.am:
+
+   backport: deal with branches in "make log"
+
+2006-01-31 16:17  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/compat/main.c:
+
+   backport: fix 'isync -w' writing .mbsyncrc to a wrong directory
+
+2006-01-31 16:16  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/sync.c:
+
+   backport: less confusing uid ranges in debug
+
+2006-01-31 16:15  Oswald Buddenhagen <o...@users.sf.net>
+
+   * configure.in, src/drv_imap.c:
+
+   backport: compile fixes
+
+2006-01-31 16:12  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/sync.c:
+
+   backport:
+   - sanitize flag handling of expired messages
+   - don't record we synced flags if we didn't
+   - remove now superfluous temporary rflags
+
+2006-01-31 15:25  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/util.c:
+
+   backport: flush debug output
+
+2005-12-22 15:59  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/sync.c:
+
+   fix sync entries not being purged due to c error.
+
+2005-12-21 14:04  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/drv_maildir.c:
+
+   less confusing error message on invalid mailbox.
+
+2005-12-18 15:10  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/config.c:
+
+   it's beyond me what this memset was supposed to do ...
+
+2005-12-18 14:41  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/: config.c, main.c:
+
+   trailing whitespace
+
+2005-12-17 14:47  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/drv_imap.c:
+
+   revert 1.8 - what was i smoking?! the CREATE argument is already quoted;
+   we just extracted it from the previous command.
+
+2005-09-29 23:07  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/drv_maildir.c:
+
+   make flag changes unset "new" status - unless a ghost is acting in the
+   background, a flag change indicates that the message was at least
+   noticed.
+
+2005-09-29 23:05  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/sync.c:
+
+   don't call the driver's set_flags() if the flags did not change at all.
+
+2005-09-21 18:14  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/drv_imap.c:
+
+   64-bit cleanness
+
 2005-03-28 12:43  Oswald Buddenhagen <o...@users.sf.net>
 
* src/drv_imap.c:
@@ -213,18 +309,6 @@
excessively secure temp file creation.
more user friendliness.
 
-2004-03-23 16:52  Oswald Buddenhagen <o...@users.sf.net>
-
-   * src/sync.c:
-
-   be cygwin-compliant: don't use link()
-
-2004-03-22 17:51  Oswald Buddenhagen <o...@users.sf.net>
-
-   * src/sync.c:
-
-   unscrew file naming scheme
-
 2004-02-07 16:36  Oswald Buddenhagen <o...@users.sf.net>
 
* src/dotlock.c:
@@ -1066,12 +1150,6 @@
 
added -a (--all) flag to synchronize all mailboxes defined in ~/.isyncrc
 
-2001-06-12 02:32  Michael Elkins <m...@sigpipe.org>
-
-   * AUTHORS, README, COPYING, Makefile.am, configure.in, src/main.c:
-
-   initial import
-
 2001-02-28 02:02  Michael Elkins <m...@sigpipe.org>
 
* src/: config.c, imap.c:
@@ -1435,11 +1513,3 @@
 
Initial revision
 
-2000-12-20 22:41  Michael Elkins <m...@sigpipe.org>
-
-   * AUTHORS, Makefile.am, README, configure.in, src/isync.h,
- src/main.c, src/imap.c, src/maildir.c, src/sync.c, isync.1,
- isyncrc.sample:
-
-   initial import
-

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.3), (v1.0.4), (v1.0.5), (v1.0.6): re-gen

2016-11-05 Thread Oswald Buddenhagen
commit f7ba199d356f390024634bf80f478927c9c7d2c3
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Fri Nov 3 13:06:01 2006 +

re-gen

 ChangeLog |   59 +
 1 files changed, 59 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2cf05f2..dd3c10e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,62 @@
+2006-11-03 14:05  Oswald Buddenhagen <o...@users.sf.net>
+
+   * Makefile.am:
+
+   add target for creating signed package
+
+2006-11-01 08:19  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/: drv_imap.c, mbsync.1:
+
+   backport:
+   - un-document "Host imaps:[...]" syntax and introduce new option 
UseIMAPS
+ instead
+   - apply ted's patch to support UseIMAPS in conjunction with Tunnel
+   - document that SSLv2 is No Good (TM)
+
+2006-11-01 08:14  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/drv_imap.c:
+
+   backport: move assigning default port to the place of use
+
+2006-11-01 07:33  Oswald Buddenhagen <o...@users.sf.net>
+
+   * configure.in:
+
+   bump version
+
+2006-11-01 07:20  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/compat/config.c:
+
+   backport: put INBOX in Maildir
+
+2006-10-24 19:39  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/drv_maildir.c:
+
+   backport: don't crash on truncating db
+
+2006-07-31 07:31  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/drv_maildir.c:
+
+   another attempt at working around glibc breakage.
+
+2006-07-29 13:52  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/: drv_maildir.c, mdconvert.c:
+
+   work around glibc bug: printf("%.*s", INT_MAX, s) tries to allocate 2G.
+
+2006-03-19 11:44  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/drv_imap.c:
+
+   make config parsing more robust against bogus input and report errors
+   more clearly.
+
 2006-01-31 16:45  Oswald Buddenhagen <o...@users.sf.net>
 
* configure.in:

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.6): fix CVE-2013-0289: add SSL subject verification

2016-11-05 Thread Oswald Buddenhagen
commit c4824c8f3828f1993d27cbc13a053eade991b875
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sun Feb 3 16:05:55 2013 +0100

fix CVE-2013-0289: add SSL subject verification

we did not check a valid certificate's subject at all so far.
this is no problem if the certificate file contains only exactly the
wanted host's certificate - before revision 04fdf7d1 (dec 2000, < v0.4),
this was even enforced (more or less - if the peer cert had been
signed directly by a root cert, it would be accepted as well).
however, when the file contains root certificates (like the system-wide
certificate file typically does), any host with a valid certificate
could pretend to be the wanted host.

 src/drv_imap.c |   75 +++
 1 files changed, 68 insertions(+), 7 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index 2a84f3d..afe6df0 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -48,6 +48,7 @@
 # include 
 # include 
 # include 
+# include 
 #endif
 
 typedef struct imap_server_conf {
@@ -187,9 +188,65 @@ static const char *Flags[] = {
 
 #if HAVE_LIBSSL
 
+static int
+host_matches( const char *host, const char *pattern )
+{
+   if (pattern[0] == '*' && pattern[1] == '.') {
+   pattern += 2;
+   if (!(host = strchr( host, '.' )))
+   return 0;
+   host++;
+   }
+
+   return *host && *pattern && !strcasecmp( host, pattern );
+}
+
+static int
+verify_hostname( X509 *cert, const char *hostname )
+{
+   int i, len, found;
+   X509_NAME *subj;
+   STACK_OF(GENERAL_NAME) *subj_alt_names;
+   char cname[1000];
+
+   /* try the DNS subjectAltNames */
+   found = 0;
+   if ((subj_alt_names = X509_get_ext_d2i( cert, NID_subject_alt_name, 
NULL, NULL ))) {
+   int num_subj_alt_names = sk_GENERAL_NAME_num( subj_alt_names );
+   for (i = 0; i < num_subj_alt_names; i++) {
+   GENERAL_NAME *subj_alt_name = sk_GENERAL_NAME_value( 
subj_alt_names, i );
+   if (subj_alt_name->type == GEN_DNS &&
+   strlen( (const char *)subj_alt_name->d.ia5->data ) 
== (size_t)subj_alt_name->d.ia5->length &&
+   host_matches( hostname, (const char 
*)(subj_alt_name->d.ia5->data) ))
+   {
+   found = 1;
+   break;
+   }
+   }
+   sk_GENERAL_NAME_pop_free( subj_alt_names, GENERAL_NAME_free );
+   }
+   if (found)
+   return 0;
+
+   /* try the common name */
+   if (!(subj = X509_get_subject_name( cert ))) {
+   fprintf( stderr, "Error, cannot get certificate subject\n" );
+   return -1;
+   }
+   if ((len = X509_NAME_get_text_by_NID( subj, NID_commonName, cname, 
sizeof(cname) )) < 0) {
+   fprintf( stderr, "Error, cannot get certificate common name\n" 
);
+   return -1;
+   }
+   if (strlen( cname ) == (size_t)len && host_matches( hostname, cname ))
+   return 0;
+
+   fprintf( stderr, "Error, certificate owner does not match hostname 
%s\n", hostname );
+   return -1;
+}
+
 /* this gets called when a certificate is to be verified */
 static int
-verify_cert( SSL *ssl )
+verify_cert( SSL *ssl, const char *hostname )
 {
X509 *cert;
int err;
@@ -204,12 +261,16 @@ verify_cert( SSL *ssl )
}
 
err = SSL_get_verify_result( ssl );
-   if (err == X509_V_OK)
-   return 0;
-
-   fprintf( stderr, "Error, can't verify certificate: %s (%d)\n",
-X509_verify_cert_error_string(err), err );
+   if (err != X509_V_OK) {
+   fprintf( stderr, "Error, can't verify certificate: %s (%d)\n",
+X509_verify_cert_error_string(err), err );
+   goto intcheck;
+   }
+   if (hostname && verify_hostname( cert, hostname ) < 0)
+   goto intcheck;
+   return 0;
 
+  intcheck:
X509_NAME_oneline( X509_get_subject_name( cert ), buf, sizeof(buf) );
info( "\nSubject: %s\n", buf );
X509_NAME_oneline( X509_get_issuer_name( cert ), buf, sizeof(buf) );
@@ -1103,7 +1164,7 @@ start_tls( imap_store_t *ctx )
}
 
/* verify the server certificate */
-   if (verify_cert( imap->buf.sock.ssl ))
+   if (verify_cert( imap->buf.sock.ssl, ((imap_store_conf_t 
*)ctx->gen.conf)->server->host ))
return 1;
 
imap->buf.sock.use_ssl = 1;

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel 

[commit] (v1.0.3), (v1.0.4), (v1.0.5), (v1.0.6): add target for creating signed package

2016-11-05 Thread Oswald Buddenhagen
commit a54459af1c495510cd22fb72ef384482695eef6e
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Fri Nov 3 13:05:34 2006 +

add target for creating signed package

 Makefile.am |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2257614..d5a900c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,6 +20,9 @@ distdir distclean: deb-clean
 dist-hook:
find $(distdir)/debian \( -name CVS -o -name .cvsignore -o -name .#\*# 
-o -type l \) -print0 | xargs -0r rm -rf
 
+dist-sign: dist
+   gpg -b -a $(PACKAGE)-$(VERSION).tar.gz
+
 rpm:
make dist
cp $(PACKAGE)-$(VERSION).tar.gz /usr/src/rpm/SOURCES

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.4), (v1.0.5), (v1.0.6): backport: put pointers to bdb open() into parentheses, so they won't be

2016-11-05 Thread Oswald Buddenhagen
commit 1b9b5f8bfd4fb3f524e962679a4e8f5a92887d0d
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sat Feb 23 09:03:22 2008 +

backport: put pointers to bdb open() into parentheses, so they won't be
macro-expanded as libc open.

 src/compat/convert.c |2 +-
 src/drv_maildir.c|4 ++--
 src/mdconvert.c  |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/compat/convert.c b/src/compat/convert.c
index b8f584c..0ed1ba2 100644
--- a/src/compat/convert.c
+++ b/src/compat/convert.c
@@ -145,7 +145,7 @@ convert( config_t *box )
fputs( "dbcreate failed\n", stderr );
goto err2;
}
-   if (db->open( db, 0, iumname, 0, DB_HASH, 0, 0 )) {
+   if ((db->open)( db, 0, iumname, 0, DB_HASH, 0, 0 )) {
fputs( "cannot open db\n", stderr );
db->close( db, 0 );
goto err2;
diff --git a/src/drv_maildir.c b/src/drv_maildir.c
index f433f6a..e6cf08d 100644
--- a/src/drv_maildir.c
+++ b/src/drv_maildir.c
@@ -499,7 +499,7 @@ maildir_scan( maildir_store_t *ctx, msglist_t *msglist )
fputs( "Maildir error: db_create() failed\n", 
stderr );
return DRV_BOX_BAD;
}
-   if (tdb->open( tdb, 0, 0, 0, DB_HASH, DB_CREATE, 0 )) {
+   if ((tdb->open)( tdb, 0, 0, 0, DB_HASH, DB_CREATE, 0 )) 
{
fputs( "Maildir error: tdb->open() failed\n", 
stderr );
tdb->close( tdb, 0 );
return DRV_BOX_BAD;
@@ -783,7 +783,7 @@ maildir_select( store_t *gctx, int minuid, int maxuid, int 
*excs, int nexcs )
fputs( "Maildir error: db_create() failed\n", stderr );
goto bork;
}
-   if ((ret = ctx->db->open( ctx->db, 0, uvpath, 0, DB_HASH, 
DB_CREATE, 0 ))) {
+   if ((ret = (ctx->db->open)( ctx->db, 0, uvpath, 0, DB_HASH, 
DB_CREATE, 0 ))) {
ctx->db->err( ctx->db, ret, "Maildir error: 
db->open(%s)", uvpath );
  dbork:
ctx->db->close( ctx->db, 0 );
diff --git a/src/mdconvert.c b/src/mdconvert.c
index 12ff788..2de59ed 100644
--- a/src/mdconvert.c
+++ b/src/mdconvert.c
@@ -96,7 +96,7 @@ convert( const char *box, int altmap )
fputs( "Error: db_create() failed\n", stderr );
goto tbork;
}
-   if ((ret = db->open( db, 0, dbpath, 0, DB_HASH, DB_CREATE, 0 ))) {
+   if ((ret = (db->open)( db, 0, dbpath, 0, DB_HASH, DB_CREATE, 0 ))) {
db->err( db, ret, "Error: db->open(%s)", dbpath );
  dbork:
db->close( db, 0 );

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.5), (v1.0.6): backport: memmove for overlapping mem copies.

2016-11-05 Thread Oswald Buddenhagen
commit 2074a7ab03db93f609e4c0d808e51ebbda601cf9
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Thu Aug 10 06:33:18 2006 +

backport: memmove for overlapping mem copies.

 src/drv_imap.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index b8a4e5b..2a84f3d 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -376,7 +376,7 @@ buffer_gets( buffer_t * b, char **s )
n = b->bytes - start;
 
if (n)
-   memcpy( b->buf, b->buf + start, n );
+   memmove( b->buf, b->buf + start, n );
b->offset -= start;
b->bytes = n;
start = 0;

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.1.3): bump version

2016-11-05 Thread Oswald Buddenhagen
commit 960e10e4471e4c583c1b42f6ca0cbc807a5aad20
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Fri Apr 3 11:14:52 2015 +0200

bump version

 configure.ac |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index f6d5d64..3abd865 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([isync], [1.1.2])
+AC_INIT([isync], [1.1.3])
 AC_CONFIG_HEADERS([autodefs.h])
 AM_INIT_AUTOMAKE
 

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.5), (v1.0.6): handle failure to store message. this helps with invalid messages like

2016-11-05 Thread Oswald Buddenhagen
commit 608a2863e04c8b14ef9a03e48db4fdd0c55ceaab
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sat Mar 21 16:05:51 2009 +

handle failure to store message. this helps with invalid messages like
0-byte files after crashes.

 src/drv_imap.c |1 +
 src/sync.c |   14 ++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index 9520cdd..dbdb1b1 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -1586,6 +1586,7 @@ imap_store_msg( store_t *gctx, msg_data_t *data, int *uid 
)
}
/* invalid message */
free( fmap );
+   fprintf( stderr, "IMAP warning: storing message with incomplete 
header.\n" );
return DRV_MSG_BAD;
 mktid:
for (j = 0; j < TUIDL; j++)
diff --git a/src/sync.c b/src/sync.c
index 59035b6..5a5d247 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -301,6 +301,13 @@ sync_old( int tops, store_t *sctx, store_t *tctx, 
store_conf_t *tconf, FILE *jfp
case DRV_OK:
smsg->flags = msgdata.flags;
switch (tdriver->store_msg( 
tctx, ,  )) {
+   case DRV_MSG_BAD:
+   warn( pull ?
+ "Warning: Slave 
refuses to store message %d from master.\n" :
+ "Warning: Master 
refuses to store message %d from slave.\n",
+ smsg->uid );
+   smsg->status |= 
M_NOT_SYNCED;
+   break;
case DRV_STORE_BAD: return pull 
? SYNC_SLAVE_BAD : SYNC_MASTER_BAD;
default: return SYNC_FAIL;
case DRV_OK:
@@ -399,6 +406,13 @@ sync_new( int tops, store_t *sctx, store_t *tctx, 
store_conf_t *tconf, FILE *jfp
}
msg->flags = msgdata.flags;
switch (tdriver->store_msg( 
tctx, ,  )) {
+   case DRV_MSG_BAD:
+   warn( pull ?
+ "Warning: Slave 
refuses to store message %d from master.\n" :
+ "Warning: Master 
refuses to store message %d from slave.\n",
+ msg->uid );
+   msg->status |= 
M_NOT_SYNCED;
+   continue;
case DRV_STORE_BAD: return pull 
? SYNC_SLAVE_BAD : SYNC_MASTER_BAD;
default: return SYNC_FAIL;
case DRV_OK: break;

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.3), (v1.0.4), (v1.0.5), (v1.0.6): work around glibc bug: printf("%.*s", INT_MAX, s) tries to allocate 2G.

2016-11-05 Thread Oswald Buddenhagen
commit 2e39fa9930b6475497db367434ca8928092096ff
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sat Jul 29 11:53:47 2006 +

work around glibc bug: printf("%.*s", INT_MAX, s) tries to allocate 2G.

 src/drv_maildir.c |2 +-
 src/mdconvert.c   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/drv_maildir.c b/src/drv_maildir.c
index e5235c1..54cadc1 100644
--- a/src/drv_maildir.c
+++ b/src/drv_maildir.c
@@ -640,7 +640,7 @@ maildir_scan( maildir_store_t *ctx, msglist_t *msglist )
if (u)
ml = u - entry->base;
else
-   ru = "", ml = INT_MAX;
+   ru = "", ml = sizeof(buf);
fnl = nfsnprintf( buf + bl, sizeof(buf) - bl, 
"%s/%.*s,U=%d%s", subdirs[entry->recent], ml, entry->base, uid, ru ) + 1 - 4;
memcpy( nbuf, buf, bl + 4 );
nfsnprintf( nbuf + bl + 4, sizeof(nbuf) - bl - 
4, "%s", entry->base );
diff --git a/src/mdconvert.c b/src/mdconvert.c
index f2c60a1..12ff788 100644
--- a/src/mdconvert.c
+++ b/src/mdconvert.c
@@ -154,7 +154,7 @@ convert( const char *box, int altmap )
if (u)
ml = u - e->d_name;
else
-   ru = "", ml = INT_MAX;
+   ru = "", ml = sizeof(buf);
if (altmap) {
if (!p)
continue;

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.5), (v1.0.6): backport: compat wrapper: don't crash if neither host nor tunnel are

2016-11-05 Thread Oswald Buddenhagen
commit dff2f6a9f502312f39117e0ded14e6c95481fb64
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sat Feb 23 14:19:13 2008 +

backport: compat wrapper: don't crash if neither host nor tunnel are
specified.

 src/compat/config.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/compat/config.c b/src/compat/config.c
index 596c347..f87ca6f 100644
--- a/src/compat/config.c
+++ b/src/compat/config.c
@@ -252,7 +252,7 @@ write_imap_server( FILE *fp, config_t *cfg )
if (sscanf( cfg->host, "%d.%d.%d.%d", , , ,  ) == 4)
/* XXX this does not avoid clashes. add port? */
cfg->server_name = nfstrdup( cfg->host );
-   else {
+   else if (cfg->host) {
p = strrchr( cfg->host, '.' );
if (!p)
hl = nfsnprintf( buf, sizeof(buf), "%s", 
cfg->host );
@@ -271,6 +271,9 @@ write_imap_server( FILE *fp, config_t *cfg )
cfg->server_name = nfstrdup( buf );
cfg->servers = 1;
  gotsrv: ;
+   } else {
+   fprintf( stderr, "ERROR: Neither host nor tunnel specified for 
mailbox %s.\n", cfg->path );
+   exit( 1 );
}
fprintf( fp, "IMAPAccount %s\n", cfg->server_name );
if (cfg->use_imaps)

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.5), (v1.0.6): backport: give the implicitly created imap account config the name of

2016-11-05 Thread Oswald Buddenhagen
commit d2ccc93584849a2981a5194c4d31b0c5617d3ee1
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sun Apr 13 09:57:27 2008 +

backport: give the implicitly created imap account config the name of
the store.

 src/drv_imap.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index 39663b8..ae85524 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -1815,6 +1815,7 @@ imap_parse_store( conffile_t *cfg, store_conf_t **storep, 
int *err )
if (!store->server) {
store->server = nfmalloc( sizeof(sserver) );
memcpy( store->server, , sizeof(sserver) );
+   store->server->name = store->gen.name;
} else if (acc_opt) {
fprintf( stderr, "IMAP store '%s' has both Account and 
account-specific options\n", store->gen.name );
*err = 1;

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.3), (v1.0.4), (v1.0.5), (v1.0.6): backport: less confusing uid ranges in debug

2016-11-05 Thread Oswald Buddenhagen
commit 534ccb326aa76c522b41729ea0c9ced931ec17f4
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Tue Jan 31 15:16:27 2006 +

backport: less confusing uid ranges in debug

 src/sync.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sync.c b/src/sync.c
index 3722f01..347dfef 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -697,7 +697,7 @@ sync_boxes( store_t *mctx, const char *mname,
} else
maxwuid = 0;
info( "Selecting slave %s... ", sname );
-   debug( "selecting slave [1,%d]\n", maxwuid );
+   debug( maxwuid == INT_MAX ? "selecting slave [1,inf]\n" : "selecting 
slave [1,%d]\n", maxwuid );
switch (sdriver->select( sctx, (sctx->opts & OPEN_OLD) ? 1 : smaxuid + 
1, maxwuid, 0, 0 )) {
case DRV_STORE_BAD: ret = SYNC_SLAVE_BAD; goto bail;
case DRV_BOX_BAD: ret = SYNC_FAIL; goto bail;
@@ -800,7 +800,7 @@ sync_boxes( store_t *mctx, const char *mname,
} else
maxwuid = 0;
info( "Selecting master %s... ", mname );
-   debug( "selecting master [%d,%d]\n", minwuid, maxwuid );
+   debug( maxwuid == INT_MAX ? "selecting master [%d,inf]\n" : "selecting 
master [%d,%d]\n", minwuid, maxwuid );
switch (mdriver->select( mctx, minwuid, maxwuid, mexcs, nmexcs )) {
case DRV_STORE_BAD: ret = SYNC_MASTER_BAD; goto finish;
case DRV_BOX_BAD: ret = SYNC_FAIL; goto finish;

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.3), (v1.0.4), (v1.0.5), (v1.0.6): backport: compile fixes

2016-11-05 Thread Oswald Buddenhagen
commit 63c065a12738b0fc2531516a21dc56f8a367db28
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Tue Jan 31 15:15:00 2006 +

backport: compile fixes

 configure.in   |1 +
 src/drv_imap.c |4 
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/configure.in b/configure.in
index 037005d..4ce6282 100644
--- a/configure.in
+++ b/configure.in
@@ -9,6 +9,7 @@ if test "$GCC" = yes; then
 CFLAGS="$CFLAGS -pipe -W -Wall -Wshadow -Wstrict-prototypes"
 fi
 
+AC_CHECK_HEADERS([sys/filio.h])
 AC_CHECK_FUNCS(vasprintf)
 
 AC_CHECK_LIB(socket, socket, [SOCK_LIBS="-lsocket"])
diff --git a/src/drv_imap.c b/src/drv_imap.c
index fcdc1f1..f930764 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -31,11 +31,15 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#ifdef HAVE_SYS_FILIO_H
+# include 
+#endif
 #include 
 #include 
 #include 

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.4), (v1.0.5), (v1.0.6): bump version

2016-11-05 Thread Oswald Buddenhagen
commit 5e43508aec18f05186432ed6488e4506ab63feab
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sat Feb 23 09:41:19 2008 +

bump version

 configure.in |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.in b/configure.in
index 6b4dce2..7c50405 100644
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
 AC_INIT(src/isync.h)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(isync, 1.0.3)
+AM_INIT_AUTOMAKE(isync, 1.0.4)
 
 AM_MAINTAINER_MODE
 

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.3), (v1.0.4), (v1.0.5), (v1.0.6): backport: put INBOX in Maildir

2016-11-05 Thread Oswald Buddenhagen
commit 4b70d9b96c8b309b3edd46c96fcfd67d6addb6bc
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Wed Nov 1 06:20:56 2006 +

backport: put INBOX in Maildir

 src/compat/config.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/compat/config.c b/src/compat/config.c
index 9db89ec..f2ac9a7 100644
--- a/src/compat/config.c
+++ b/src/compat/config.c
@@ -250,6 +250,7 @@ write_imap_server( FILE *fp, config_t *cfg )
 cfg->server_name, cfg->tunnel );
} else {
if (sscanf( cfg->host, "%d.%d.%d.%d", , , ,  ) == 4)
+   /* XXX this does not avoid clashes. add port? */
cfg->server_name = nfstrdup( cfg->host );
else {
p = strrchr( cfg->host, '.' );
@@ -350,7 +351,8 @@ write_config( int fd )
 
fprintf( fp, "SyncState *\n\n" );
if (local_home || o2o)
-   fprintf( fp, "MaildirStore local\nPath \"%s/\"\nAltMap %s\n\n", 
maildir, tb( altmap > 0 ) );
+   fprintf( fp, "MaildirStore local\nPath \"%s/\"\nInbox 
\"%s/INBOX\"\nAltMap %s\n\n",
+maildir, maildir, tb( altmap > 0 ) );
if (local_root)
fprintf( fp, "MaildirStore local_root\nPath /\nAltMap %s\n\n", 
tb( altmap > 0 ) );
if (o2o) {

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.4), (v1.0.5), (v1.0.6): backport: don't use #ifdef inside htons() arguments - it can be a macro.

2016-11-05 Thread Oswald Buddenhagen
commit 5d03247bec69fa525508801a4ce1a0ab88fc124a
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sat Sep 22 08:49:05 2007 +

backport: don't use #ifdef inside htons() arguments - it can be a macro.

 src/drv_imap.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index 1e976f2..39663b8 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -1244,11 +1244,11 @@ imap_open_store( store_conf_t *conf, store_t *oldctx )
info( "ok\n" );
} else {
memset( , 0, sizeof(addr) );
-   addr.sin_port = htons( srvc->port ? srvc->port :
+   addr.sin_port = srvc->port ? htons( srvc->port ) :
 #ifdef HAVE_LIBSSL
-  srvc->use_imaps ? 993 :
+   srvc->use_imaps ? htons( 993 ) :
 #endif
-  143 );
+   htons( 143 );
addr.sin_family = AF_INET;
 
info( "Resolving %s... ", srvc->host );

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.4), (v1.0.5), (v1.0.6): regen

2016-11-05 Thread Oswald Buddenhagen
commit 8616ed393df0f95c46679b7c40499843035f20b4
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sat Feb 23 09:39:10 2008 +

regen

 ChangeLog |   63 +
 1 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dd3c10e..ee2467d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,66 @@
+2008-02-23 10:38  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/compat/config.c:
+
+   backport: quote user name in generated config.
+
+2008-02-23 10:22  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/main.c:
+
+   backport: don't overlook 2nd and later single-letter options in last
+   argument.
+
+2008-02-23 10:03  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/: drv_maildir.c, mdconvert.c, compat/convert.c:
+
+   backport: put pointers to bdb open() into parentheses, so they won't be
+   macro-expanded as libc open.
+
+2007-09-22 10:49  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/drv_imap.c:
+
+   backport: don't use #ifdef inside htons() arguments - it can be a macro.
+
+2007-04-04 19:55  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/sync.c:
+
+   avoid crash in case of a rather weird (==misconfigured?) sync state
+   location.
+
+2007-04-04 15:27  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/drv_imap.c:
+
+   accept empty SEARCH IMAP responses - reasonable servers omit them
+   alltogether, but this is allowed, too. patch by
+   CCMAIL: Alexander Gerasiov <g...@cs.msu.su>
+   fixes debian bug #413336
+
+   fixed in HEAD a year ago - accidentally ...
+
+2007-02-10 16:41  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/drv_imap.c:
+
+   backport: fix crash due to uninited var when parsing IMAPServer.
+   -REF: <e1hfuim-00041h...@sc8-pr-cvs2.sourceforge.net>
+
+2006-11-18 14:17  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/drv_maildir.c:
+
+   backport: reverse-map  to INBOX when encountered during listing.
+
+2006-11-09 19:01  Oswald Buddenhagen <o...@users.sf.net>
+
+   * src/compat/main.c:
+
+   backport: make compat wrapper default to current user for imap login
+
 2006-11-03 14:05  Oswald Buddenhagen <o...@users.sf.net>
 
* Makefile.am:

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.4), (v1.0.5), (v1.0.6): backport: quote user name in generated config.

2016-11-05 Thread Oswald Buddenhagen
commit 6636d7ebb77067b2ce6a76e0827ce7e8a96cc3dd
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sat Feb 23 09:38:00 2008 +

backport: quote user name in generated config.

 src/compat/config.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/compat/config.c b/src/compat/config.c
index f2ac9a7..596c347 100644
--- a/src/compat/config.c
+++ b/src/compat/config.c
@@ -280,7 +280,7 @@ write_imap_server( FILE *fp, config_t *cfg )
fprintf( fp, "Port %d\n", cfg->port );
}
if (cfg->user)
-   fprintf( fp, "User %s\n", cfg->user );
+   fprintf( fp, "User \"%s\"\n", cfg->user );
if (cfg->pass)
fprintf( fp, "Pass \"%s\"\n", cfg->pass );
fprintf( fp, "RequireCRAM %s\nRequireSSL %s\n"

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.6): bump version

2016-11-05 Thread Oswald Buddenhagen
commit af863bb60164971a5c17fe3bf515f8c77ba534a2
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Wed Feb 20 08:20:15 2013 +0100

bump version

 configure.in |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.in b/configure.in
index 7ff9efc..18fc36a 100644
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
 AC_INIT(src/isync.h)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(isync, 1.0.5)
+AM_INIT_AUTOMAKE(isync, 1.0.6)
 
 AM_MAINTAINER_MODE
 

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v1.0.5' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v1.0.5' has been created at 9f1320f.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.5), (v1.0.6): don't hang after failed start_tls()

2016-11-05 Thread Oswald Buddenhagen
commit 2d5a73c55dfb4f34930cd0a1af3a741372a4ceb2
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sun Oct 3 11:53:18 2010 +0200

don't hang after failed start_tls()

we'd send a LOGOUT command in plain text while the server was already
expecting an encrypted command, which would typically lead to waiting
for more data and thus an indefinite hang.
so close the socket immediately instead of letting the normal shutdown
path take care of it.
inspired by a patch by Steven Flintham.


 src/drv_imap.c |   10 --
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index dbdb1b1..53db79d 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -1280,7 +1280,7 @@ imap_open_store( store_conf_t *conf, store_t *oldctx )
 #if HAVE_LIBSSL
if (srvc->use_imaps) {
if (start_tls( ctx ))
-   goto bail;
+   goto ssl_bail;
use_ssl = 1;
}
 #endif
@@ -1314,7 +1314,7 @@ imap_open_store( store_conf_t *conf, store_t *oldctx )
if (imap_exec( ctx, 0, "STARTTLS" ) != RESP_OK)
goto bail;
if (start_tls( ctx ))
-   goto bail;
+   goto ssl_bail;
use_ssl = 1;
 
if (imap_exec( ctx, 0, "CAPABILITY" ) != 
RESP_OK)
@@ -1399,6 +1399,12 @@ imap_open_store( store_conf_t *conf, store_t *oldctx )
ctx->trashnc = 1;
return (store_t *)ctx;
 
+#if HAVE_LIBSSL
+  ssl_bail:
+   /* This avoids that we try to send LOGOUT to an unusable socket. */
+   close( imap->buf.sock.fd );
+   imap->buf.sock.fd = -1;
+#endif
   bail:
imap_close_store( >gen );
return 0;

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.5), (v1.0.6): cvsignore => gitignore

2016-11-05 Thread Oswald Buddenhagen
commit e895cd11f7a6cdf1cb403335dd3161cabe399b0f
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sun Feb 7 12:24:30 2010 +0100

cvsignore => gitignore

(cherry picked from commit 4729b1ee230ae944e38c864e7bc390c63fa03bac)

 .cvsignore => .gitignore  |6 ++
 Makefile.am   |2 +-
 src/{.cvsignore => .gitignore}|1 +
 src/compat/{.cvsignore => .gitignore} |1 +
 4 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/.cvsignore b/.gitignore
similarity index 84%
rename from .cvsignore
rename to .gitignore
index ad6c4ed..8c1c41c 100644
--- a/.cvsignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
 .autoconf_trace
+ChangeLog
+INSTALL
 Makefile
 Makefile.in
 autom4te.cache
@@ -14,9 +16,13 @@ config.sub
 configure
 configure.lineno
 configure-stamp
+depcomp
+install-sh
 isync.spec
 isync-*.tar.gz
+missing
 patch-stamp
 stamp-h
 stamp-h.in
 stamp-h1
+*~
diff --git a/Makefile.am b/Makefile.am
index 0dff87b..f83fb4f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -64,7 +64,7 @@ deb-clean:
 distdir distclean: deb-clean
 
 dist-hook:
-   find $(distdir)/debian \( -name CVS -o -name .cvsignore -o -name .#\*# 
-o -type l \) -print0 | xargs -0r rm -rf
+   find $(distdir)/debian \( -name .git -o -name .gitignore -o -name .#\*# 
-o -type l \) -print0 | xargs -0r rm -rf
 
 dist-sign: dist
gpg -b -a $(PACKAGE)-$(VERSION).tar.gz
diff --git a/src/.cvsignore b/src/.gitignore
similarity index 91%
rename from src/.cvsignore
rename to src/.gitignore
index d6cbd59..25ae8f6 100644
--- a/src/.cvsignore
+++ b/src/.gitignore
@@ -3,3 +3,4 @@ Makefile
 Makefile.in
 mbsync
 mdconvert
+*.o
diff --git a/src/compat/.cvsignore b/src/compat/.gitignore
similarity index 89%
rename from src/compat/.cvsignore
rename to src/compat/.gitignore
index 5630809..8b6b13f 100644
--- a/src/compat/.cvsignore
+++ b/src/compat/.gitignore
@@ -2,3 +2,4 @@
 Makefile
 Makefile.in
 isync
+*.o

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v1.2.1' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v1.2.1' has been created at e054c57.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v1.1.0' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v1.1.0' has been created at f9386d0.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.3), (v1.0.4), (v1.0.5), (v1.0.6): backport: fix 'isync -w' writing .mbsyncrc to a wrong directory

2016-11-05 Thread Oswald Buddenhagen
commit b40fb7f2818f4677ad39d7e536418650efad8077
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Tue Jan 31 15:17:43 2006 +

backport: fix 'isync -w' writing .mbsyncrc to a wrong directory

 src/compat/main.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/compat/main.c b/src/compat/main.c
index 7faf1a3..69d3a51 100644
--- a/src/compat/main.c
+++ b/src/compat/main.c
@@ -331,8 +331,8 @@ main( int argc, char **argv )
while ((de = readdir( dir ))) {
if (*de->d_name == '.')
continue;
-   nfsnprintf( path1, sizeof(path1), "%s/%s/cur", 
xmaildir, de->d_name );
-   if (stat( path1,  ) || !S_ISDIR( st.st_mode 
))
+   nfsnprintf( path2, sizeof(path2), "%s/%s/cur", 
xmaildir, de->d_name );
+   if (stat( path2,  ) || !S_ISDIR( st.st_mode 
))
continue;
global.path = de->d_name;
global.box = (inbox && !strcmp( inbox, 
global.path )) ?

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.3), (v1.0.4), (v1.0.5), (v1.0.6): bump version

2016-11-05 Thread Oswald Buddenhagen
commit afc48600fa3c58aa53318ba384afbe6b0b19a829
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Wed Nov 1 06:33:37 2006 +

bump version

 configure.in |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.in b/configure.in
index 3ea551b..6b4dce2 100644
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
 AC_INIT(src/isync.h)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(isync, 1.0.2)
+AM_INIT_AUTOMAKE(isync, 1.0.3)
 
 AM_MAINTAINER_MODE
 

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v1.2.0' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v1.2.0' has been created at 95276cd.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.3), (v1.0.4), (v1.0.5), (v1.0.6): backport: don't crash on truncating db

2016-11-05 Thread Oswald Buddenhagen
commit 41c4e0d6814ba883eecb05f30e83b6ba71940a96
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Tue Oct 24 17:39:24 2006 +

backport: don't crash on truncating db

 src/drv_maildir.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/drv_maildir.c b/src/drv_maildir.c
index 2b91890..f65f213 100644
--- a/src/drv_maildir.c
+++ b/src/drv_maildir.c
@@ -345,7 +345,8 @@ maildir_init_uid( maildir_store_t *ctx, const char *msg )
ctx->uvok = 0;
 #ifdef USE_DB
if (ctx->db) {
-   ctx->db->truncate( ctx->db, 0, 0 /* _int32_t_dummy */, 0 );
+   u_int32_t count;
+   ctx->db->truncate( ctx->db, 0, , 0 );
return maildir_set_uid( ctx, 0, 0 );
}
 #endif /* USE_DB */
@@ -475,7 +476,7 @@ maildir_scan( maildir_store_t *ctx, msglist_t *msglist )
DBC *dbc;
 #endif /* USE_DB */
msg_t *entry;
-   int i, j, uid, bl, ml, fnl, ret;
+   int i, j, uid, bl, fnl, ret;
struct stat st;
char buf[_POSIX_PATH_MAX], nbuf[_POSIX_PATH_MAX];
 

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v0.3' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v0.3' has been created at 145e4ef.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v0.2' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v0.2' has been created at 813618f.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.3), (v1.0.4), (v1.0.5), (v1.0.6): backport:

2016-11-05 Thread Oswald Buddenhagen
commit 3759f0c80220a908714fcddc4ffe07fe231eb813
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Wed Nov 1 07:19:26 2006 +

backport:
- un-document "Host imaps:[...]" syntax and introduce new option UseIMAPS
  instead
- apply ted's patch to support UseIMAPS in conjunction with Tunnel
- document that SSLv2 is No Good (TM)

 src/drv_imap.c |   15 +--
 src/mbsync.1   |   27 +--
 2 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index 8b5cea7..6501a2f 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -1270,15 +1270,15 @@ imap_open_store( store_conf_t *conf, store_t *oldctx )
info( "ok\n" );
 
imap->buf.sock.fd = s;
+   }
 
 #if HAVE_LIBSSL
-   if (srvc->use_imaps) {
-   if (start_tls( ctx ))
-   goto bail;
-   use_ssl = 1;
-   }
-#endif
+   if (srvc->use_imaps) {
+   if (start_tls( ctx ))
+   goto bail;
+   use_ssl = 1;
}
+#endif
 
/* read the greeting string */
if (buffer_gets( >buf,  )) {
@@ -1726,6 +1726,7 @@ imap_parse_store( conffile_t *cfg, store_conf_t **storep, 
int *err )
 
while (getcline( cfg ) && cfg->cmd) {
if (!strcasecmp( "Host", cfg->cmd )) {
+   /* The imap[s]: syntax is just a backwards compat hack. 
*/
 #if HAVE_LIBSSL
if (!memcmp( "imaps:", cfg->val, 6 )) {
cfg->val += 6;
@@ -1758,6 +1759,8 @@ imap_parse_store( conffile_t *cfg, store_conf_t **storep, 
int *err )
}
} else if (!strcasecmp( "RequireSSL", cfg->cmd ))
server->require_ssl = parse_bool( cfg );
+   else if (!strcasecmp( "UseIMAPS", cfg->cmd ))
+   server->use_imaps = parse_bool( cfg );
else if (!strcasecmp( "UseSSLv2", cfg->cmd ))
server->use_sslv2 = parse_bool( cfg );
else if (!strcasecmp( "UseSSLv3", cfg->cmd ))
diff --git a/src/mbsync.1 b/src/mbsync.1
index 2b44bc2..14b5c99 100644
--- a/src/mbsync.1
+++ b/src/mbsync.1
@@ -210,17 +210,13 @@ The location of the \fBINBOX\fR. This is \fInot\fR 
relative to \fBPath\fR.
 Define the IMAP4 Account \fIname\fR, opening a section for its parameters.
 ..
 .TP
-\fBHost\fR [\fBimaps:\fR]\fIhost\fR
-Specify the DNS name or IP address of the IMAP server.  If \fIhost\fR is
-prefixed with \fBimaps:\fR the connection is assumed to be an SSL connection
-to port 993.
-Note that modern servers support SSL on the default port 143 via the
-STARTTLS extension, which will be used automatically by default.
+\fBHost\fR \fIhost\fR
+Specify the DNS name or IP address of the IMAP server.
 ..
 .TP
 \fBPort\fR \fIport\fR
-Specify the TCP port number of the IMAP server.  (Default: 143 for imap,
-993 for imaps)
+Specify the TCP port number of the IMAP server.  (Default: 143 for IMAP,
+993 for IMAPS)
 ..
 .TP
 \fBUser\fR \fIusername\fR
@@ -245,6 +241,15 @@ If set to \fIyes\fR, \fBmbsync\fR will abort the 
connection if no CRAM-MD5
 authentication is possible.  (Default: \fIno\fR)
 ..
 .TP
+\fBUseIMAPS\fR \fIyes\fR|\fIno\fR
+If set to \fIyes\fR, the default for \fBPort\fR is changed to 993 and
+\fBmbsync\fR will start SSL negotiation immediately after establishing
+the connection to the server.
+.br
+Note that modern servers support SSL on the regular IMAP port 143 via the
+STARTTLS extension, which will be used automatically by default.
+..
+.TP
 \fBRequireSSL\fR \fIyes\fR|\fIno\fR
 \fBmbsync\fR will abort the connection if a TLS/SSL session cannot be
 established with the IMAP server.  (Default: \fIyes\fR)
@@ -257,12 +262,14 @@ This option is \fImandatory\fR if SSL is used. See \fBSSL 
CERTIFICATES\fR below.
 .TP
 \fBUseSSLv2\fR \fIyes\fR|\fIno\fR
 Use SSLv2 for communication with the IMAP server over SSL?
-(Default: \fIyes\fR if an imaps \fBHost\fR is used, otherwise \fIno\fR)
+.br
+Note that this option is deprecated for security reasons.
+(Default: \fIno\fR)
 ..
 .TP
 \fBUseSSLv3\fR \fIyes\fR|\fIno\fR
 Use SSLv3 for communication with the IMAP server over SSL?
-(Default: \fIyes\fR if an imaps \fBHost\fR is used, otherwise \fIno\fR)
+(Default: \fIno\fR)
 ..
 .TP
 \fBUseTLSv1\fR \fIyes\fR|\fIno\fR

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.3), (v1.0.4), (v1.0.5), (v1.0.6): backport: move assigning default port to the place of use

2016-11-05 Thread Oswald Buddenhagen
commit 6494cfc4384e2448c4a26d868ce18dd24df3e3b6
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Wed Nov 1 07:14:50 2006 +

backport: move assigning default port to the place of use

 src/drv_imap.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index 2f215d8..8b5cea7 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -1242,7 +1242,11 @@ imap_open_store( store_conf_t *conf, store_t *oldctx )
info( "ok\n" );
} else {
memset( , 0, sizeof(addr) );
-   addr.sin_port = htons( srvc->port );
+   addr.sin_port = htons( srvc->port ? srvc->port :
+#ifdef HAVE_LIBSSL
+  srvc->use_imaps ? 993 :
+#endif
+  143 );
addr.sin_family = AF_INET;
 
info( "Resolving %s... ", srvc->host );
@@ -1728,15 +1732,11 @@ imap_parse_store( conffile_t *cfg, store_conf_t 
**storep, int *err )
server->use_imaps = 1;
server->use_sslv2 = 1;
server->use_sslv3 = 1;
-   if (!server->port)
-   server->port = 993;
} else
 #endif
{
if (!memcmp( "imap:", cfg->val, 5 ))
cfg->val += 5;
-   if (!server->port)
-   server->port = 143;
}
if (!memcmp( "//", cfg->val, 2 ))
cfg->val += 2;

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v1.1.2' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v1.1.2' has been created at 2fa75cf.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.3), (v1.0.4), (v1.0.5), (v1.0.6): backport: flush debug output

2016-11-05 Thread Oswald Buddenhagen
commit 9a5920c0289feb2c524af7bc409429e276376e86
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Tue Jan 31 14:25:18 2006 +

backport: flush debug output

 src/util.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/util.c b/src/util.c
index 54f4b8f..6fb43c2 100644
--- a/src/util.c
+++ b/src/util.c
@@ -41,6 +41,7 @@ debug( const char *msg, ... )
va_start( va, msg );
vprintf( msg, va );
va_end( va );
+   fflush( stdout );
}
 }
 

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v0.5' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v0.5' has been created at af94177.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v1.0.2' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v1.0.2' has been created at d7b8621.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v1.1.1' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v1.1.1' has been created at 4ab12ae.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v1.0.1' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v1.0.1' has been created at 1a77d2e.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.3), (v1.0.4), (v1.0.5), (v1.0.6): backport:

2016-11-05 Thread Oswald Buddenhagen
commit 161a4b11599cdda24339c34a34e91e33bb206e5a
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Tue Jan 31 15:12:34 2006 +

backport:
- sanitize flag handling of expired messages
- don't record we synced flags if we didn't
- remove now superfluous temporary rflags

 src/sync.c |   18 --
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/sync.c b/src/sync.c
index 3b0e1b6..3722f01 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -251,7 +251,7 @@ sync_old( int tops, store_t *sctx, store_t *tctx, 
store_conf_t *tconf, FILE *jfp
 {
driver_t *tdriver = tctx->conf->driver, *sdriver = sctx->conf->driver;
int uid, tuid, unex;
-   unsigned char sflags, aflags, dflags, rflags;
+   unsigned char sflags, aflags, dflags;
msg_data_t msgdata;
 
/* excludes (push) c.3) d.2) d.3) d.4) / (pull) b.3) d.7) d.8) d.9) */
@@ -332,20 +332,18 @@ sync_old( int tops, store_t *sctx, store_t *tctx, 
store_conf_t *tconf, FILE *jfp
unex = 0;
if (srec->status & S_EXPIRED) {
if (!pull) {
-   if (sflags & F_DELETED) {
-   if (!(sflags & F_FLAGGED))
-   aflags &= ~F_DELETED;
-   } else
-   unex = 1;
+   if ((aflags & ~F_DELETED) || dflags)
+   info( "Info: Flags of expired 
message changed in (%d,%d)\n", srec->muid, srec->suid );
+   return SYNC_OK;
} else {
if ((sflags & F_FLAGGED) && !(sflags & 
F_DELETED)) {
unex = 1;
dflags |= F_DELETED;
-   }
+   } else
+   return SYNC_OK;
}
}
-   rflags = (*nflags | aflags) & ~dflags;
-   if ((tops & OP_EXPUNGE) && (rflags & F_DELETED) &&
+   if ((tops & OP_EXPUNGE) && (sflags & F_DELETED) &&
(!tctx->conf->trash || tctx->conf->trash_only_new))
{
aflags &= F_DELETED;
@@ -356,7 +354,7 @@ sync_old( int tops, store_t *sctx, store_t *tctx, 
store_conf_t *tconf, FILE *jfp
case DRV_BOX_BAD: return SYNC_FAIL;
default: /* ok */ break;
case DRV_OK:
-   *nflags = rflags;
+   *nflags = (*nflags | aflags) & ~dflags;
if (unex) {
debug( "unexpiring pair(%d,%d)\n", 
srec->muid, srec->suid );
/* log last, so deletion can't be 
misinterpreted! */

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v1.0.4' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v1.0.4' has been created at 5e43508.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.4), (v1.0.5), (v1.0.6): backport: make compat wrapper default to current user for imap login

2016-11-05 Thread Oswald Buddenhagen
commit d51a91aeba01af72f324dffaa59123babee3ee18
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Thu Nov 9 18:01:27 2006 +

backport: make compat wrapper default to current user for imap login

 src/compat/main.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/compat/main.c b/src/compat/main.c
index 69d3a51..6183a91 100644
--- a/src/compat/main.c
+++ b/src/compat/main.c
@@ -22,6 +22,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -167,6 +168,11 @@ main( int argc, char **argv )
/* defaults */
/* XXX the precedence is borked:
   it's defaults < cmdline < file instead of defaults < file < cmdline 
*/
+#ifdef BSD
+   global.user = getenv( "USER" );
+#else
+   global.user = getenv( "LOGNAME" );
+#endif
global.port = 143;
global.box = "INBOX";
global.use_namespace = 1;

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] (v1.0.4), (v1.0.5), (v1.0.6): backport: fix crash due to uninited var when parsing IMAPServer.

2016-11-05 Thread Oswald Buddenhagen
commit 9a0539868aa9526e546142045c9ba0057062d54b
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Sat Feb 10 15:41:32 2007 +

backport: fix crash due to uninited var when parsing IMAPServer.
-REF: <e1hfuim-00041h...@sc8-pr-cvs2.sourceforge.net>

 src/drv_imap.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index 6501a2f..21e6018 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -1705,6 +1705,7 @@ imap_parse_store( conffile_t *cfg, store_conf_t **storep, 
int *err )
*serverapp = server;
serverapp = >next;
store = 0;
+   *storep = 0;
} else if (!strcasecmp( "IMAPStore", cfg->cmd )) {
store = nfcalloc( sizeof(*store) );
store->gen.driver = _driver;

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v1.0.0' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v1.0.0' has been created at 7e323da.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'isync_1_2_1' deleted

2016-11-05 Thread Oswald Buddenhagen
The tag 'isync_1_2_1', previously at e054c57, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v0.6' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v0.6' has been created at 9647c79.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v0.8' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v0.8' has been created at 6267139.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'v0.4' created

2016-11-05 Thread Oswald Buddenhagen
The tag 'v0.4' has been created at 21ac884.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch '0.9' created

2016-11-05 Thread Oswald Buddenhagen
The branch '0.9' has been created at 1d3eed9.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch '1.2' created

2016-11-05 Thread Oswald Buddenhagen
The branch '1.2' has been created at 41308e4.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch '1.0' created

2016-11-05 Thread Oswald Buddenhagen
The branch '1.0' has been created at 2f2c4ce.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch '1.1' created

2016-11-05 Thread Oswald Buddenhagen
The branch '1.1' has been created at 960e10e.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch 'inboxStrictness' deleted

2016-11-05 Thread Oswald Buddenhagen
The branch 'inboxStrictness', previously at 257f351, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch 'ignoreInboxCase' deleted

2016-11-05 Thread Oswald Buddenhagen
The branch 'ignoreInboxCase', previously at 6cc72b4, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch 'isync_0_9_branch' deleted

2016-11-05 Thread Oswald Buddenhagen
The branch 'isync_0_9_branch', previously at 1d3eed9, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch 'socket-debug' deleted

2016-11-05 Thread Oswald Buddenhagen
The branch 'socket-debug', previously at 7595196, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'isync_0_5' deleted

2016-11-05 Thread Oswald Buddenhagen
The tag 'isync_0_5', previously at af94177, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'isync_0_3' deleted

2016-11-05 Thread Oswald Buddenhagen
The tag 'isync_0_3', previously at 145e4ef, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'isync_0_1' deleted

2016-11-05 Thread Oswald Buddenhagen
The tag 'isync_0_1', previously at be31149, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'isync_0_4' deleted

2016-11-05 Thread Oswald Buddenhagen
The tag 'isync_0_4', previously at 21ac884, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'isync_0_6' deleted

2016-11-05 Thread Oswald Buddenhagen
The tag 'isync_0_6', previously at 9647c79, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] tag 'isync_1_0_0' deleted

2016-11-05 Thread Oswald Buddenhagen
The tag 'isync_1_0_0', previously at 7e323da, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch 'wip/ignoreInboxCase' reset

2016-11-05 Thread Oswald Buddenhagen
The branch 'wip/ignoreInboxCase', previously at 6cc72b4, has been
rewound by 57 revision(s) and subsequently fast-forwarded by 63
revision(s) to 4288064.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch 'wip/socket-debug' reset

2016-11-05 Thread Oswald Buddenhagen
The branch 'wip/socket-debug', previously at 7595196, has been rewound
by 2 revision(s) and subsequently fast-forwarded by 86 revision(s) to
984a89c.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] master: fix SubFolders style Maildir++

2016-11-05 Thread Oswald Buddenhagen
commit 0f24ca31b5fafe5228d0e99f460f1c823121b296
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Fri Nov 4 16:21:09 2016 +0100

fix SubFolders style Maildir++

turns out i misread the spec in a subtle way: while all other folders
are physically nested under INBOX, the IMAP view puts them at the same
(root) level. to get them shown as subfolders of INBOX, they need to
have _two_ leading dots.

this also implies that the Maildir++ mode has no use for a Path, so
reject attempts to specify one.

 src/drv_maildir.c |  127 +
 src/mbsync.1  |   13 +++--
 2 files changed, 89 insertions(+), 51 deletions(-)

diff --git a/src/drv_maildir.c b/src/drv_maildir.c
index 9be0ca8..f97ac82 100644
--- a/src/drv_maildir.c
+++ b/src/drv_maildir.c
@@ -113,13 +113,34 @@ maildir_parse_flags( const char *info_prefix, const char 
*base )
return flags;
 }
 
+static int
+maildir_ensure_path( maildir_store_conf_t *conf )
+{
+   if (!conf->gen.path) {
+   error( "Maildir error: store '%s' has no Path\n", 
conf->gen.name );
+   conf->failed = FAIL_FINAL;
+   return -1;
+   }
+   return 0;
+}
+
+/* Subdirs of INBOX include a leading slash. */
+/* Path includes a trailing slash, Inbox does not. */
 static char *
-maildir_join_path( maildir_store_conf_t *conf, const char *prefix, const char 
*box )
+maildir_join_path( maildir_store_conf_t *conf, int in_inbox, const char *box )
 {
char *out, *p;
-   int pl, bl, n, sub = 0;
+   const char *prefix;
+   int pl, bl, n;
char c;
 
+   if (in_inbox || conf->sub_style == SUB_MAILDIRPP) {
+   prefix = conf->inbox;
+   } else {
+   if (maildir_ensure_path( conf ) < 0)
+   return 0;
+   prefix = conf->gen.path;
+   }
pl = strlen( prefix );
for (bl = 0, n = 0; (c = box[bl]); bl++)
if (c == '/') {
@@ -134,24 +155,33 @@ maildir_join_path( maildir_store_conf_t *conf, const char 
*prefix, const char *b
   conf->gen.name, box );
return 0;
}
+   switch (conf->sub_style) {
+   case SUB_VERBATIM:
+   n = 0;
+   break;
+   case SUB_MAILDIRPP:
+   n = 2;
+   break;
+   default: /* SUB_LEGACY and SUB_UNSET */
+   break;
+   }
out = nfmalloc( pl + bl + n + 1 );
memcpy( out, prefix, pl );
p = out + pl;
+   if (conf->sub_style == SUB_MAILDIRPP) {
+   *p++ = '/';
+   *p++ = '.';
+   }
while ((c = *box++)) {
if (c == '/') {
switch (conf->sub_style) {
case SUB_VERBATIM:
*p++ = c;
break;
-   case SUB_MAILDIRPP:
-   if (!sub) {
-   sub = 1;
-   *p++ = c;
-   }
-   *p++ = '.';
-   break;
case SUB_LEGACY:
*p++ = c;
+   /* fallthrough */
+   default: /* SUB_MAILDIRPP */
*p++ = '.';
break;
}
@@ -164,17 +194,6 @@ maildir_join_path( maildir_store_conf_t *conf, const char 
*prefix, const char *b
 }
 
 static int
-maildir_ensure_path( maildir_store_conf_t *conf )
-{
-   if (!conf->gen.path) {
-   error( "Maildir error: store '%s' has no Path\n", 
conf->gen.name );
-   conf->failed = FAIL_FINAL;
-   return -1;
-   }
-   return 0;
-}
-
-static int
 maildir_validate_path( maildir_store_conf_t *conf )
 {
struct stat st;
@@ -212,15 +231,9 @@ maildir_connect_store( store_t *gctx,
cb( DRV_STORE_BAD, aux );
return;
}
-   if (conf->gen.trash) {
-   if (maildir_ensure_path( conf ) < 0) {
-   cb( DRV_STORE_BAD, aux );
-   return;
-   }
-   if (!(ctx->trash = maildir_join_path( conf, conf->gen.path, 
conf->gen.trash ))) {
-   cb( DRV_STORE_BAD, aux );
-   return;
-   }
+   if (conf->gen.trash && !(ctx->trash = maildir_join_path( conf, 0, 
conf->gen.trash ))) {
+   cb( DRV_STORE_BAD, aux );
+   return;
}
cb( DRV_OK, aux );
 }
@@ -325,6 +338,8 @@ maildir_list_recurse( store_t *gctx, int isBox, int flags,
return -1;
}
  

[commit] master: abstract growable arrays somewhat

2016-11-05 Thread Oswald Buddenhagen
commit 7b567164fff524b8d9ddbe09a8ffa78f66c6f8b5
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Fri Nov 4 21:48:58 2016 +0100

abstract growable arrays somewhat

... and sneak in a C99 requirement on the way. just because.

 configure.ac  |4 +-
 src/common.h  |   31 -
 src/driver.h  |2 +-
 src/drv_imap.c|   18 +-
 src/drv_maildir.c |   83 
 src/sync.c|   27 ++-
 src/util.c|4 +-
 7 files changed, 93 insertions(+), 76 deletions(-)

diff --git a/configure.ac b/configure.ac
index b103f71..2eab91a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,9 +4,9 @@ AM_INIT_AUTOMAKE
 
 AM_MAINTAINER_MODE
 
-AC_PROG_CC
+AC_PROG_CC_C99
 if test "$GCC" = yes; then
-CFLAGS="$CFLAGS -pipe -W -Wall -Wshadow -Wstrict-prototypes -ansi 
-pedantic -Wno-overlength-strings"
+CFLAGS="$CFLAGS -pipe -W -Wall -Wshadow -Wstrict-prototypes -std=c99 
-pedantic -Wno-overlength-strings"
 fi
 
 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
diff --git a/src/common.h b/src/common.h
index 18390f3..a2f80de 100644
--- a/src/common.h
+++ b/src/common.h
@@ -43,10 +43,12 @@ typedef unsigned int uint;
 # define ATTR_UNUSED __attribute__((unused))
 # define ATTR_NORETURN __attribute__((noreturn))
 # define ATTR_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+# define ATTR_PACKED(ref) __attribute__((packed,aligned(sizeof(ref
 #else
 # define ATTR_UNUSED
 # define ATTR_NORETURN
 # define ATTR_PRINTFLIKE(fmt,var)
+# define ATTR_PACKED(ref)
 #endif
 
 #ifdef __GNUC__
@@ -137,7 +139,34 @@ char *expand_strdup( const char *s );
 
 int map_name( const char *arg, char **result, int reserve, const char *in, 
const char *out );
 
-void sort_ints( int *arr, int len );
+#define DEFINE_ARRAY_TYPE(T) \
+   typedef struct T##_array { \
+   T *data; \
+   int size; \
+   } ATTR_PACKED(T *) T##_array_t; \
+   typedef struct T##_array_alloc { \
+   T##_array_t array; \
+   int alloc; \
+   } ATTR_PACKED(T *) T##_array_alloc_t; \
+   static INLINE T *T##_array_append( T##_array_alloc_t *arr ) \
+   { \
+   if (arr->array.size == arr->alloc) { \
+   arr->alloc = arr->alloc * 2 + 100; \
+   arr->array.data = nfrealloc( arr->array.data, 
arr->alloc * sizeof(T) ); \
+   } \
+   return >array.data[arr->array.size++]; \
+   }
+
+#define ARRAY_INIT(arr) \
+   do { (arr)->array.data = 0; (arr)->array.size = (arr)->alloc = 0; } 
while (0)
+
+#define ARRAY_SQUEEZE(arr) \
+   do { \
+   (arr)->data = nfrealloc( (arr)->data, (arr)->size * 
sizeof((arr)->data[0]) ); \
+   } while (0)
+
+DEFINE_ARRAY_TYPE(int)
+void sort_int_array( int_array_t array );
 
 void arc4_init( void );
 uchar arc4_getbyte( void );
diff --git a/src/driver.h b/src/driver.h
index 1abf671..42000e8 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -207,7 +207,7 @@ struct driver {
 * and those named in the excs array (smaller than minuid).
 * The driver takes ownership of the excs array. Messages below newuid 
do not need
 * to have the TUID populated even if OPEN_FIND is set. */
-   void (*load_box)( store_t *ctx, int minuid, int maxuid, int newuid, int 
*excs, int nexcs,
+   void (*load_box)( store_t *ctx, int minuid, int maxuid, int newuid, 
int_array_t excs,
  void (*cb)( int sts, void *aux ), void *aux );
 
/* Fetch the contents and flags of the given message from the current 
mailbox. */
diff --git a/src/drv_imap.c b/src/drv_imap.c
index 4911f18..e2ae985 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -2292,7 +2292,7 @@ imap_prepare_load_box( store_t *gctx, int opts )
 static void imap_submit_load( imap_store_t *, const char *, int, struct 
imap_cmd_refcounted_state * );
 
 static void
-imap_load_box( store_t *gctx, int minuid, int maxuid, int newuid, int *excs, 
int nexcs,
+imap_load_box( store_t *gctx, int minuid, int maxuid, int newuid, int_array_t 
excs,
void (*cb)( int sts, void *aux ), void *aux )
 {
imap_store_t *ctx = (imap_store_t *)gctx;
@@ -2300,21 +2300,21 @@ imap_load_box( store_t *gctx, int minuid, int maxuid, 
int newuid, int *excs, int
char buf[1000];
 
if (!ctx->gen.count) {
-   free( excs );
+   free( excs.data );
cb( DRV_OK, aux );
} else {
struct imap_cmd_refcounted_state *sts = 
imap_refcounted_new_state( cb, aux );
 
-   sort_ints( excs, nexcs );
-   for (i = 0; i < nexcs; ) {
-   for (bl = 0; i < nexcs && bl < 960; i++) {
+   sort_int_array( excs );
+   for (i = 0; i < excs.si

[commit] master: wrap message trashing into simple transactions

2016-11-05 Thread Oswald Buddenhagen
commit b63f169c5781b7bb886c0bd922945aeba5dd6da0
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Fri Nov 4 21:23:39 2016 +0100

wrap message trashing into simple transactions

trashing many messages at once inevitably overtaxes m$ exchange, and the
connection breaks. without any progress tracking, it would restart from
scratch each time, which would lead to a) it never finishing and b) many
copies of the messages in the trash.

full transactions as we do for "proper" syncing would be over the top,
as it's not *that* bad if some messages get duplicated in the trash. so
we record only the messages for which trashing completed, thus allowing
some overlap between the attempts.

 TODO   |3 ---
 src/sync.c |   33 +++--
 2 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/TODO b/TODO
index bfa068b..f991c43 100644
--- a/TODO
+++ b/TODO
@@ -1,8 +1,5 @@
 f{,data}sync() usage could be optimized by batching the calls.
 
-add some marker about message being already [remotely] trashed.
-real transactions would be certainly not particularly useful ...
-
 make SSL (connect) timeouts produce a bit more than "Unidentified socket 
error".
 
 uidvalidity lock timeout handling would be a good idea.
diff --git a/src/sync.c b/src/sync.c
index e5c532a..e78b8a9 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -175,6 +175,7 @@ typedef struct {
driver_t *drv[2];
const char *orig_name[2];
message_t *new_msgs[2];
+   int_array_alloc_t trashed_msgs[2];
int state[2], ref_count, nsrecs, ret, lfd, existing, replayed;
int new_pending[2], flags_pending[2], trash_pending[2];
int maxuid[2]; /* highest UID that was already propagated */
@@ -799,7 +800,7 @@ load_state( sync_vars_t *svars )
}
if ((c = buf[0]) == '#' ?
  (t3 = 0, (sscanf( buf + 2, "%d %d %n", 
, ,  ) < 2) || !t3 || (t - t3 != TUIDL + 3)) :
- c == '(' || c == ')' || c == '{' || c == 
'}' || c == '!' ?
+ c == '(' || c == ')' || c == '{' || c == 
'}' || c == '[' || c == ']' || c == '!' ?
(sscanf( buf + 2, "%d",  ) != 1) :
c == '+' || c == '&' || c == '-' || c 
== '|' || c == '/' || c == '\\' ?
  (sscanf( buf + 2, "%d %d", ,  ) 
!= 2) :
@@ -816,6 +817,10 @@ load_state( sync_vars_t *svars )
svars->newuid[M] = t1;
else if (c == '}')
svars->newuid[S] = t1;
+   else if (c == '[')
+   *int_array_append( 
>trashed_msgs[M] ) = t1;
+   else if (c == ']')
+   *int_array_append( 
>trashed_msgs[S] ) = t1;
else if (c == '!')
svars->smaxxuid = t1;
else if (c == '|') {
@@ -1920,6 +1925,11 @@ flags_set_p2( sync_vars_t *svars, sync_rec_t *srec, int 
t )
}
 }
 
+typedef struct {
+   void *aux;
+   message_t *msg;
+} trash_vars_t;
+
 static void msg_trashed( int sts, void *aux );
 static void msg_rtrashed( int sts, int uid, copy_vars_t *vars );
 
@@ -1927,6 +1937,7 @@ static void
 msgs_flags_set( sync_vars_t *svars, int t )
 {
message_t *tmsg;
+   trash_vars_t *tv;
copy_vars_t *cv;
 
if (!(svars->state[t] & ST_SENT_FLAGS) || svars->flags_pending[t])
@@ -1938,14 +1949,18 @@ msgs_flags_set( sync_vars_t *svars, int t )
(svars->ctx[t]->conf->trash || (svars->ctx[1-t]->conf->trash && 
svars->ctx[1-t]->conf->trash_remote_new))) {
debug( "trashing in %s\n", str_ms[t] );
for (tmsg = svars->ctx[t]->msgs; tmsg; tmsg = tmsg->next)
-   if ((tmsg->flags & F_DELETED) && (t == M || !tmsg->srec 
|| !(tmsg->srec->status & (S_EXPIRE|S_EXPIRED {
+   if ((tmsg->flags & F_DELETED) && !find_int_array( 
svars->trashed_msgs[t].array, tmsg->uid ) &&
+   (t == M || !tmsg->srec || !(tmsg->srec->status & 
(S_EXPIRE|S_EXPIRED {
if (svars->ctx[t]->conf->trash) {
if 
(!svars->ctx[t]->conf->trash_only_new || !tmsg->srec || tmsg->srec->uid[1-t] < 
0) {
debug( "%s: trashing message 
%d\n", str_ms[t], tmsg->uid );
  

[commit] branch 'wip/placeholders' created

2016-11-05 Thread Oswald Buddenhagen
The branch 'wip/placeholders' has been created at 05db75c.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch 'isync_1_0_branch' deleted

2016-11-05 Thread Oswald Buddenhagen
The branch 'isync_1_0_branch', previously at 2f2c4ce, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch 'isync_1_1_branch' deleted

2016-11-05 Thread Oswald Buddenhagen
The branch 'isync_1_1_branch', previously at 960e10e, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


[commit] branch 'isync_1_2_branch' deleted

2016-11-05 Thread Oswald Buddenhagen
The branch 'isync_1_2_branch', previously at 41308e4, has been deleted.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


Re: multiple logouts from outlook.com //req for rc file

2016-10-22 Thread Oswald Buddenhagen
On Fri, Oct 21, 2016 at 01:27:43PM +, Benyomin Hagalili wrote:
> issue1: bad logout from outlook.com
>
there was another report of this kind recently. i can't work with that
without seeing more of the log. send it to me privately.

> issue2: EOF on a particular UID, how do you fix that?
> 1213 in progress) >>> 1219 UID FETCH 12698 (BODY.PEEK[])
> (1214 in progress) >>> 1220 UID FETCH 12727 (BODY.PEEK[])
> (1215 in progress) >>> 1221 UID FETCH 12763 (BODY.PEEK[])
> * 405 FETCH (BODY[] {12497676}
> IMAP error: unexpected EOF from imap-mail.outlook.com (207.46.10.10:993)
> IMAP error: bogus FETCH response
> Channel bb
> Opening master store my-remote2...
> Resolving imap-mail.outlook.com... ok
> Connecting to imap-mail.outlook.com (2
> 
> How can I trash the 12497676 message on the server to fix this?
> 
that number is the size of the message, i.e., it's pretty huge, and for
some reason the connection just breaks while it's being transferred.
that may have to do with the size of the message itself, or the total
size of the session (try with several smaller messages which have at
least this size in total), or whatever.
as for deleting it, just do it server-side with outlook web access.

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


Re: Mbsync not uploading changes to my drafts

2016-10-18 Thread Oswald Buddenhagen
On Tue, Oct 18, 2016 at 02:09:39PM +0200, Antoine Levitt wrote:
> When I compose a draft in gmail, mbsync syncs it just fine, but there's
> no "D" flag at the end of the file name, and mu4e refuses to edit
> it. Could mbsync add an option to specify a mailbox as a "draft"
> mailbox, and add the suffix automatically?
> 
that approach sounds wrong to me: mbsync is supposed to sync the
messages verbatim. think about the implications: what should happen if a
D message is found in another folder on the client? there is some
inherent asymmetry involved here.
the cleaner approach would be getting gmail to do the flagging
server-side. isn't this possible?

> Separate but related issue: when I create drafts in mu4e, I get draft
> files that look like
> 
> 1476790027.b70383ace79cff96.epsilon:2,DS
> 
> When mbsync handles them, it renames them to something like
> 
> 1476790027.b70383ace79cff96.epsilon,U=53:2,DS
> 
> and mu4e gets confused: if I keep editing my draft, it agains creates a
> file without U=, which mbsync syncs with an increasing U= value, and
> then I'm left with tons of drafts. Based on what you said about messages
> being immutable, what's the proper behavior there? Should mu4e delete
> all drafts that share the same prefix but have different U= values?
> 
one can get around the renaming by using mbsync's AltMap mode. that
would prevent that mu4e loses track of previous draft versions. but that
tracking is, indeed, necessary only to delete them.

an implementation which would strip out the ,U=xxx infix to find the
file again (pretty much the same way as it already must do with flags)
would be possible. as the mu4e maintainer i wouldn't be too thrilled
about it, as this is a non-standard format (though it's used somewhat
widely).

in either case, each new draft version should have a different basename.

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


Re: Moved folder

2016-10-17 Thread Oswald Buddenhagen
On Mon, Oct 17, 2016 at 04:04:35PM +0200, Florian Lindner wrote:
> I have moved two folders from root to an Archive/ folder. The new folders in 
> the Archive/ were properly synced by mbsync
> but it complains about the two folders that formerly were at root:
> 
> What is the right way to deal with that?
> 
delete the respective states file from ~/.mbsync/

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


Re: `maxuid' issues in src/drv_imap.c

2016-11-24 Thread Oswald Buddenhagen
On Thu, Nov 24, 2016 at 08:12:29PM +0800, Casper Ti. Vector wrote:
> On Sun, Nov 20, 2016 at 11:45:52AM +0100, Oswald Buddenhagen wrote:
> > maybe mail me the output of a run with -Dn for a closer look.
> 
> Done in private mail.
> 
> > the 1e9 was just chosen to make the query string legible. sending the
> > INT_MAX verbatim would be more correct.
> 
> Looked at the IMAP spec just now; it seems that UIDs are supposed to be
> 32-bit unsigned integers.  Perhaps we should use `uint32_t' (or
> something equivalent) for the internal representation of UIDs,
>
yes

> and send `UINT32_MAX'?
> 
won't work, because this will break servers which use signed ints
(probably the majority).

i already started working on a solution which doesn't send an arbitrary
"maximal" uid at all. i hope to finish it one of the next weekends ...

--
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


Re: [commit] branch 'wip/uidval-recovery' reset

2016-11-13 Thread Oswald Buddenhagen
On Sun, Nov 13, 2016 at 09:50:07PM +, Oswald Buddenhagen wrote:
> The branch 'wip/uidval-recovery', previously at 9cd378d, has been
> rewound by 1 revision(s) and subsequently fast-forwarded by 10
> revision(s) to 1335ca3.

this is now mostly complete and just needs some testing, plus some
improvements in a not directly related patch in this series.

so if you're a fellow ms exchange sufferer, you might want to give this
a shot ...

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


Re: Failing to sync all mail in folder

2016-11-20 Thread Oswald Buddenhagen
On Tue, Nov 15, 2016 at 06:28:29PM +, Steve George wrote:
> For testing I used MaxMessages 400, so I think that's why it's 'stuck' at 
> only 
> downloading 400 messages. Even if I put in 'MaxMessages 500' it won't 
> actually 
> download them, and removing it completely doesn't download all messages.
> 
> [...] or there's a state file I need to change?
> 
indeed there is. you need to reset MaxPulledUid to zero in the slave
folder's .mbsyncstate.

--
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


Re: "lost track of pulled message(s)" and other warnings

2016-11-01 Thread Oswald Buddenhagen
On Mon, Oct 31, 2016 at 07:21:05PM +, Sean Hammond wrote:
> Seeing lots of this error message now:
> 
> Warning: message  from master has incomplete header.
> 
that indicates an invalid message that was cut before the end of the
headers (the body can be empty, but should be preceded by an empty line).
you better find out where these come from.

> And I've also seen this one:
> 
> Error decompressing data from imap.gmail.com (64.233.166.108:993):
> (null)
> 
hmpf. that possibly indicates a bug in mbsync. otoh, given that google
was also throwing internal server errors, i wouldn't be surprised if
their tls compression was botched, either.

this could be worked around by using DisableExtension COMPRESS=DEFLATE,
but that would come with a rather huge bandwidth cost, so it's probably
better to just let the connection break down from time to time.

> I assume there's aren't anything to worry about either?
> 
well, data loss is unlikely, but it's still better to find out the root
causes.

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel


<    3   4   5   6   7   8   9   10   11   12   >