Compare commits
18 commits
Author | SHA1 | Date | |
---|---|---|---|
|
f7ba199d35 | ||
|
a54459af1c | ||
|
3759f0c802 | ||
|
6494cfc438 | ||
|
afc48600fa | ||
|
4b70d9b96c | ||
|
41c4e0d681 | ||
|
b6c6299ea6 | ||
|
2e39fa9930 | ||
|
927feae988 | ||
|
3f1009a839 | ||
|
fd3f4f33ff | ||
|
314287cbb4 | ||
|
b40fb7f281 | ||
|
534ccb326a | ||
|
63c065a127 | ||
|
161a4b1159 | ||
|
9a5920c028 |
11 changed files with 259 additions and 100 deletions
181
ChangeLog
181
ChangeLog
|
@ -1,3 +1,158 @@
|
|||
2006-11-03 14:05 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* Makefile.am:
|
||||
|
||||
add target for creating signed package
|
||||
|
||||
2006-11-01 08:19 Oswald Buddenhagen <ossi@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 <ossi@users.sf.net>
|
||||
|
||||
* src/drv_imap.c:
|
||||
|
||||
backport: move assigning default port to the place of use
|
||||
|
||||
2006-11-01 07:33 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* configure.in:
|
||||
|
||||
bump version
|
||||
|
||||
2006-11-01 07:20 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* src/compat/config.c:
|
||||
|
||||
backport: put INBOX in Maildir
|
||||
|
||||
2006-10-24 19:39 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* src/drv_maildir.c:
|
||||
|
||||
backport: don't crash on truncating db
|
||||
|
||||
2006-07-31 07:31 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* src/drv_maildir.c:
|
||||
|
||||
another attempt at working around glibc breakage.
|
||||
|
||||
2006-07-29 13:52 Oswald Buddenhagen <ossi@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 <ossi@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 <ossi@users.sf.net>
|
||||
|
||||
* configure.in:
|
||||
|
||||
bump version
|
||||
|
||||
2006-01-31 16:21 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* Makefile.am:
|
||||
|
||||
backport: deal with branches in "make log"
|
||||
|
||||
2006-01-31 16:17 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* src/compat/main.c:
|
||||
|
||||
backport: fix 'isync -w' writing .mbsyncrc to a wrong directory
|
||||
|
||||
2006-01-31 16:16 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* src/sync.c:
|
||||
|
||||
backport: less confusing uid ranges in debug
|
||||
|
||||
2006-01-31 16:15 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* configure.in, src/drv_imap.c:
|
||||
|
||||
backport: compile fixes
|
||||
|
||||
2006-01-31 16:12 Oswald Buddenhagen <ossi@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 <ossi@users.sf.net>
|
||||
|
||||
* src/util.c:
|
||||
|
||||
backport: flush debug output
|
||||
|
||||
2005-12-22 15:59 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* src/sync.c:
|
||||
|
||||
fix sync entries not being purged due to c&p error.
|
||||
|
||||
2005-12-21 14:04 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* src/drv_maildir.c:
|
||||
|
||||
less confusing error message on invalid mailbox.
|
||||
|
||||
2005-12-18 15:10 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* src/config.c:
|
||||
|
||||
it's beyond me what this memset was supposed to do ...
|
||||
|
||||
2005-12-18 14:41 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* src/: config.c, main.c:
|
||||
|
||||
trailing whitespace
|
||||
|
||||
2005-12-17 14:47 Oswald Buddenhagen <ossi@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 <ossi@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 <ossi@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 <ossi@users.sf.net>
|
||||
|
||||
* src/drv_imap.c:
|
||||
|
||||
64-bit cleanness
|
||||
|
||||
2005-03-28 12:43 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* src/drv_imap.c:
|
||||
|
@ -213,18 +368,6 @@
|
|||
excessively secure temp file creation.
|
||||
more user friendliness.
|
||||
|
||||
2004-03-23 16:52 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* src/sync.c:
|
||||
|
||||
be cygwin-compliant: don't use link()
|
||||
|
||||
2004-03-22 17:51 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* src/sync.c:
|
||||
|
||||
unscrew file naming scheme
|
||||
|
||||
2004-02-07 16:36 Oswald Buddenhagen <ossi@users.sf.net>
|
||||
|
||||
* src/dotlock.c:
|
||||
|
@ -1066,12 +1209,6 @@
|
|||
|
||||
added -a (--all) flag to synchronize all mailboxes defined in ~/.isyncrc
|
||||
|
||||
2001-06-12 02:32 Michael Elkins <me@sigpipe.org>
|
||||
|
||||
* AUTHORS, README, COPYING, Makefile.am, configure.in, src/main.c:
|
||||
|
||||
initial import
|
||||
|
||||
2001-02-28 02:02 Michael Elkins <me@sigpipe.org>
|
||||
|
||||
* src/: config.c, imap.c:
|
||||
|
@ -1435,11 +1572,3 @@
|
|||
|
||||
Initial revision
|
||||
|
||||
2000-12-20 22:41 Michael Elkins <me@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
|
||||
|
||||
|
|
|
@ -4,7 +4,8 @@ EXTRA_DIST = debian isync.spec $(bin_SCRIPTS)
|
|||
|
||||
log:
|
||||
@perl -p -e "s/^(\\S+)\\s+(\\S.+\\S)\\s+(\\S+)\\s*\$$/\$$1:'\$$2 <\$$3>'\\n/" < ../CVSROOT/accounts > .usermap
|
||||
cvs2cl -U .usermap --no-wrap --separate-header -I ChangeLog -I NEWS -I TODO -I debian/
|
||||
@if test -f CVS/Tag; then tag=`cut -c2- CVS/Tag`; else tag=trunk; fi; \
|
||||
cvs2cl -U .usermap -F $$tag --no-wrap --separate-header -I ChangeLog -I NEWS -I TODO -I debian/
|
||||
@rm -f .usermap ChangeLog.bak
|
||||
|
||||
deb:
|
||||
|
@ -19,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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
AC_INIT(src/isync.h)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(isync, 1.0.1)
|
||||
AM_INIT_AUTOMAKE(isync, 1.0.3)
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
|
@ -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"])
|
||||
|
|
|
@ -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", &a1, &a2, &a3, &a4 ) == 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) {
|
||||
|
|
|
@ -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, &st ) || !S_ISDIR( st.st_mode ))
|
||||
nfsnprintf( path2, sizeof(path2), "%s/%s/cur", xmaildir, de->d_name );
|
||||
if (stat( path2, &st ) || !S_ISDIR( st.st_mode ))
|
||||
continue;
|
||||
global.path = de->d_name;
|
||||
global.box = (inbox && !strcmp( inbox, global.path )) ?
|
||||
|
|
|
@ -31,11 +31,15 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#ifdef HAVE_SYS_FILIO_H
|
||||
# include <sys/filio.h>
|
||||
#endif
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <arpa/inet.h>
|
||||
|
@ -250,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;
|
||||
}
|
||||
|
||||
|
@ -1240,7 +1242,11 @@ imap_open_store( store_conf_t *conf, store_t *oldctx )
|
|||
info( "ok\n" );
|
||||
} else {
|
||||
memset( &addr, 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 );
|
||||
|
@ -1264,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( &imap->buf, &rsp )) {
|
||||
|
@ -1691,6 +1697,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) );
|
||||
|
@ -1703,6 +1710,7 @@ imap_parse_store( conffile_t *cfg, store_conf_t **storep, int *err )
|
|||
store->gen.driver = &imap_driver;
|
||||
store->gen.name = nfstrdup( cfg->val );
|
||||
store->use_namespace = 1;
|
||||
*storep = &store->gen;
|
||||
memset( &sserver, 0, sizeof(sserver) );
|
||||
server = &sserver;
|
||||
} else
|
||||
|
@ -1717,32 +1725,19 @@ 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 )) {
|
||||
/* The imap[s]: syntax is just a backwards compat hack. */
|
||||
#if HAVE_LIBSSL
|
||||
if (!memcmp( "imaps:", cfg->val, 6 )) {
|
||||
cfg->val += 6;
|
||||
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;
|
||||
|
@ -1755,10 +1750,17 @@ 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( "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 ))
|
||||
|
@ -1771,34 +1773,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 ))
|
||||
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( "UseNamespace", cfg->cmd ))
|
||||
store->use_namespace = parse_bool( cfg );
|
||||
else if (!strcasecmp( "Path", cfg->cmd ))
|
||||
store->gen.path = nfstrdup( cfg->val );
|
||||
else
|
||||
parse_generic_store( &store->gen, cfg, err );
|
||||
continue;
|
||||
} else {
|
||||
fprintf( stderr, "%s:%d: unknown keyword '%s'\n",
|
||||
fprintf( stderr, "%s:%d: unknown/misplaced keyword '%s'\n",
|
||||
cfg->file, cfg->line, cfg->cmd );
|
||||
*err = 1;
|
||||
continue;
|
||||
}
|
||||
acc_opt = 1;
|
||||
}
|
||||
if (!store || !store->server) {
|
||||
if (!server->tunnel && !server->host) {
|
||||
if (store)
|
||||
fprintf( stderr, "IMAP store '%s' has incomplete connection details\n", store->gen.name );
|
||||
fprintf( stderr, "IMAP store '%s' has incomplete/missing connection details\n", store->gen.name );
|
||||
else
|
||||
fprintf( stderr, "IMAP account '%s' has incomplete connection details\n", server->name );
|
||||
fprintf( stderr, "IMAP account '%s' has incomplete/missing connection details\n", server->name );
|
||||
*err = 1;
|
||||
/* leaking server/store */
|
||||
*storep = 0;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
*storep = &store->gen;
|
||||
if (store && !store->server) {
|
||||
store->server = nfmalloc( sizeof(sserver) );
|
||||
memcpy( store->server, &sserver, sizeof(sserver) );
|
||||
if (store) {
|
||||
if (!store->server) {
|
||||
store->server = nfmalloc( sizeof(sserver) );
|
||||
memcpy( store->server, &sserver, sizeof(sserver) );
|
||||
} else if (acc_opt) {
|
||||
fprintf( stderr, "IMAP store '%s' has both Account and account-specific options\n", store->gen.name );
|
||||
*err = 1;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -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 /* &u_int32_t_dummy */, 0 );
|
||||
u_int32_t count;
|
||||
ctx->db->truncate( ctx->db, 0, &count, 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];
|
||||
|
||||
|
@ -637,11 +638,10 @@ maildir_scan( maildir_store_t *ctx, msglist_t *msglist )
|
|||
for (ru = u + 3; isdigit( (unsigned char)*ru ); ru++);
|
||||
else
|
||||
u = ru = strchr( entry->base, ':' );
|
||||
if (u)
|
||||
ml = u - entry->base;
|
||||
else
|
||||
ru = "", ml = INT_MAX;
|
||||
fnl = nfsnprintf( buf + bl, sizeof(buf) - bl, "%s/%.*s,U=%d%s", subdirs[entry->recent], ml, entry->base, uid, ru ) + 1 - 4;
|
||||
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", subdirs[entry->recent], entry->base, uid ))
|
||||
+ 1 - 4;
|
||||
memcpy( nbuf, buf, bl + 4 );
|
||||
nfsnprintf( nbuf + bl + 4, sizeof(nbuf) - bl - 4, "%s", entry->base );
|
||||
if (rename( nbuf, buf )) {
|
||||
|
|
27
src/mbsync.1
27
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
|
||||
|
|
|
@ -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;
|
||||
|
|
22
src/sync.c
22
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! */
|
||||
|
@ -699,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;
|
||||
|
@ -802,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;
|
||||
|
|
|
@ -41,6 +41,7 @@ debug( const char *msg, ... )
|
|||
va_start( va, msg );
|
||||
vprintf( msg, va );
|
||||
va_end( va );
|
||||
fflush( stdout );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue