From 4842f5148da89e7627f1b0c38f920d0fce992e76 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 21 Mar 2015 12:18:56 +0100 Subject: [PATCH 1/3] fix bogus "unexpected command continuation request" it helps if the code actually does what the comment above it claims. clarify it a bit, so i don't get stupid ideas again. This reverts commit cf6a7b4d182d2fe82f7371af9e5a857818f3d02d. --- src/drv_imap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/drv_imap.c b/src/drv_imap.c index f58736d..867053a 100644 --- a/src/drv_imap.c +++ b/src/drv_imap.c @@ -1241,9 +1241,10 @@ imap_socket_read( void *aux ) error( "IMAP error: unexpected reply: %s %s\n", arg, cmd ? cmd : "" ); break; /* this may mean anything, so prefer not to spam the log */ } else if (*arg == '+') { - /* This can happen only with the last command underway, as - it enforces a round-trip. */ - cmdp = ctx->in_progress; + /* There can be any number of commands in flight, but only the last + * one can require a continuation, as it enforces a round-trip. */ + cmdp = (struct imap_cmd *)((char *)ctx->in_progress_append - + offsetof(struct imap_cmd, next)); if (cmdp->param.data) { if (cmdp->param.to_trash) ctx->trashnc = TrashKnown; /* Can't get NO [TRYCREATE] any more. */ From c0ba6f03950ca505064a72825d1c4d4d1fb76586 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sun, 22 Mar 2015 11:44:33 +0100 Subject: [PATCH 2/3] escape backslashes in PassCmd examples the config parser strips one level of backslash escapes. --- src/mbsyncrc.sample | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mbsyncrc.sample b/src/mbsyncrc.sample index 1c155e9..c7d61c7 100644 --- a/src/mbsyncrc.sample +++ b/src/mbsyncrc.sample @@ -16,11 +16,11 @@ Pass xxxxxxxx # Fetch password from gnome-keyring: #PassCmd "gnome-keyring-query get mail_pw" # Fetch password from .netrc: -#PassCmd "sed -n -e 's,^machine work\.host\.com login tehuser password \(.*\),\1,p' < $HOME/.netrc" +#PassCmd "sed -n -e 's,^machine work\\.host\\.com login tehuser password \\(.*\\),\\1,p' < $HOME/.netrc" # Fetch password from a gpg-encrypted file: #PassCmd "gpg --quiet --for-your-eyes-only --decrypt $HOME/imappassword.gpg" # Fetch password from pwmd (http://pwmd.sourceforge.net/): -#PassCmd "echo -ne 'GET myIsp\tpassword' | pwmc datafile" +#PassCmd "echo -ne 'GET myIsp\\tpassword' | pwmc datafile" # On Mac OS X, run "KeyChain Access" -- File->New Password Item. Fill out form using # "Keychain Item Name" http://IMAPSERVER (note: the "http://" is a hack) # "Account Name" USERNAME From ee8b835c55e95eee3ce06cfb57478873289a3658 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 23 Mar 2015 19:00:27 +0100 Subject: [PATCH 3/3] fix out-of-Path INBOX never being matched by Patterns "(null)I" really doesn't cut it. amends cf0f32f8. --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 770de0d..167704e 100644 --- a/src/main.c +++ b/src/main.c @@ -723,7 +723,7 @@ store_opened( store_t *ctx, void *aux ) const char *pat = cpat->string; if (*pat != '!') { char buf[8]; - int bufl = snprintf( buf, sizeof(buf), "%s%s", mvars->chan->boxes[t], pat ); + int bufl = snprintf( buf, sizeof(buf), "%s%s", nz( mvars->chan->boxes[t], "" ), pat ); /* Partial matches like "INB*" or even "*" are not considered, * except implicity when the INBOX lives under Path. */ if (starts_with( buf, bufl, "INBOX", 5 )) {