From: Thomas Roessler Date: Sun, 10 Dec 2000 21:01:30 +0000 (+0000) Subject: Avoid implicit flag updates with IMAP. From Brendan Cully. X-Git-Tag: mutt-1-3-13-rel~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7453757ea62e6b5f5c5ddfa5e602c49fe9d27a50;p=mutt Avoid implicit flag updates with IMAP. From Brendan Cully. --- diff --git a/imap/message.c b/imap/message.c index 3a317fe1..071b2e8d 100644 --- a/imap/message.c +++ b/imap/message.c @@ -245,8 +245,11 @@ int imap_fetch_message (MESSAGE *msg, CONTEXT *ctx, int msgno) return -1; } - snprintf (buf, sizeof (buf), "UID FETCH %d RFC822", - HEADER_DATA(ctx->hdrs[msgno])->uid); + snprintf (buf, sizeof (buf), "UID FETCH %d %s", + HEADER_DATA(ctx->hdrs[msgno])->uid, + (mutt_bit_isset (idata->capabilities, IMAP4REV1) ? + (option (OPTIMAPPEEK) ? "BODY.PEEK[]" : "BODY[]") : + "RFC822")); imap_cmd_start (idata, buf); do @@ -272,7 +275,8 @@ int imap_fetch_message (MESSAGE *msg, CONTEXT *ctx, int msgno) if (uid != HEADER_DATA(ctx->hdrs[msgno])->uid) mutt_error (_("The message index is incorrect. Try reopening the mailbox.")); } - else if (strncasecmp ("RFC822", pc, 6) == 0) + else if ((strncasecmp ("RFC822", pc, 6) == 0) || + (strncasecmp ("BODY[]", pc, 6) == 0)) { pc = imap_next_word (pc); if (imap_get_literal_count(pc, &bytes) < 0) diff --git a/init.h b/init.h index e17e35fb..a121748b 100644 --- a/init.h +++ b/init.h @@ -704,6 +704,14 @@ struct option_t MuttVars[] = { ** user/password pairs on mutt invocation, or if opening the connection ** is slow. */ + { "imap_peek", DT_BOOL, R_NONE, OPTIMAPPEEK, 1 }, + /* + ** .pp + ** If set, mutt will avoid implicitly marking your mail as read whenever + ** you fetch a message from the server. This is generally a good thing, + ** but can make closing an IMAP folder somewhat slower. This option + ** exists to appease spead freaks. + */ { "imap_servernoise", DT_BOOL, R_NONE, OPTIMAPSERVERNOISE, 1 }, /* ** .pp diff --git a/mutt.h b/mutt.h index e98a4c38..e29e4a82 100644 --- a/mutt.h +++ b/mutt.h @@ -317,6 +317,7 @@ enum #ifdef USE_IMAP OPTIMAPLSUB, OPTIMAPPASSIVE, + OPTIMAPPEEK, OPTIMAPSERVERNOISE, # ifdef USE_SSL OPTIMAPFORCESSL,