diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2001-06-11 18:32:03 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2001-06-11 18:32:03 +0000 |
commit | 51616d433a66602946e693f01dc8769bacc8787e (patch) | |
tree | 5b5b518ef3ab5271d0696ead24d869052e37824e /imap | |
parent | 10fd8347525cc5d069f162beacfef8e982a57e23 (diff) |
patch-bac.flags-20010611.1
Diffstat (limited to 'imap')
-rw-r--r-- | imap/auth.c | 16 | ||||
-rw-r--r-- | imap/imap.c | 25 |
2 files changed, 25 insertions, 16 deletions
diff --git a/imap/auth.c b/imap/auth.c index 1ce73e35..9e4c8d02 100644 --- a/imap/auth.c +++ b/imap/auth.c @@ -48,21 +48,23 @@ int imap_authenticate (IMAP_DATA* idata) { imap_auth_t* authenticator; char* methods; - char* comma; /* should be colon ;-) */ char* method; + char* delim; int r = -1; if (ImapAuthenticators && *ImapAuthenticators) { /* Try user-specified list of authentication methods */ methods = safe_strdup (ImapAuthenticators); - method = methods; - while (method) + for (method = methods; method; method = delim) { - comma = strchr (method, ':'); - if (comma) - *comma++ = '\0'; + delim = strchr (method, ':'); + if (delim) + *delim++ = '\0'; + if (! method[0]) + continue; + dprint (2, (debugfile, "imap_authenticate: Trying method %s\n", method)); authenticator = imap_authenticators; @@ -79,8 +81,6 @@ int imap_authenticate (IMAP_DATA* idata) authenticator++; } - - method = comma; } FREE (&methods); diff --git a/imap/imap.c b/imap/imap.c index dc208ed4..33aa7495 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -912,14 +912,18 @@ int imap_sync_mailbox (CONTEXT* ctx, int expunge, int* index_hint) mutt_message (_("Marking %d messages deleted..."), deleted); snprintf (tmp, sizeof (tmp), "UID STORE %s +FLAGS.SILENT (\\Deleted)", buf); + /* mark these messages as unchanged so second pass ignores them. Done + * here so BOGUS UW-IMAP 4.7 SILENT FLAGS updates are ignored. */ + for (n = 0; n < ctx->msgcount; n++) + if (ctx->hdrs[n]->deleted && ctx->hdrs[n]->changed) + ctx->hdrs[n]->active = 0; if (imap_exec (idata, tmp, 0) != 0) - /* continue, let regular store try before giving up */ - dprint(2, (debugfile, "imap_sync_mailbox: fast delete failed\n")); - else - /* mark these messages as unchanged so second pass ignores them */ - for (n = 0; n < ctx->msgcount; n++) - if (ctx->hdrs[n]->deleted && ctx->hdrs[n]->changed) - ctx->hdrs[n]->changed = 0; + { + mutt_error (_("Expunge failed")); + mutt_sleep (1); + rc = -1; + goto out; + } } } @@ -928,6 +932,8 @@ int imap_sync_mailbox (CONTEXT* ctx, int expunge, int* index_hint) { if (ctx->hdrs[n]->changed) { + ctx->hdrs[n]->changed = 0; + mutt_message (_("Saving message status flags... [%d/%d]"), n+1, ctx->msgcount); @@ -980,6 +986,9 @@ int imap_sync_mailbox (CONTEXT* ctx, int expunge, int* index_hint) snprintf (buf, sizeof (buf), "UID STORE %d FLAGS.SILENT (%s)", HEADER_DATA (ctx->hdrs[n])->uid, flags); + /* dumb hack for bad UW-IMAP 4.7 servers spurious FLAGS updates */ + ctx->hdrs[n]->active = 0; + /* after all this it's still possible to have no flags, if you * have no ACL rights */ if (*flags && (imap_exec (idata, buf, 0) != 0) && @@ -994,7 +1003,7 @@ int imap_sync_mailbox (CONTEXT* ctx, int expunge, int* index_hint) } } - ctx->hdrs[n]->changed = 0; + ctx->hdrs[n]->active = 1; } } ctx->changed = 0; |