goto bail;
}
- request_buf.length = mutt_from_base64 (buf2, idata->buf + 2);
+ request_buf.length = mutt_from_base64 (buf2, idata->cmd.buf + 2);
request_buf.value = buf2;
sec_token = &request_buf;
}
dprint (1, (debugfile, "Error receiving server response.\n"));
goto bail;
}
- request_buf.length = mutt_from_base64 (buf2, idata->buf + 2);
+ request_buf.length = mutt_from_base64 (buf2, idata->cmd.buf + 2);
request_buf.value = buf2;
maj_stat = gss_unwrap (&min_stat, context, &request_buf, &send_token,
mutt_socket_write(idata->conn, "*\r\n");
goto bail;
}
- if (imap_code (idata->buf))
+ if (imap_code (idata->cmd.buf))
{
/* flush the security context */
dprint (2, (debugfile, "Releasing GSS credentials\n"));
int uid;
int cacheno;
IMAP_CACHE *cache;
+ int read;
+ int rc;
/* Sam's weird courier server returns an OK response even when FETCH
* fails. Thanks Sam. */
short fetched = 0;
- int rc;
idata = (IMAP_DATA*) ctx->data;
*/
h = ctx->hdrs[msgno];
rewind (msg->fp);
+ /* It may be that the Status header indicates a message is read, but the
+ * IMAP server doesn't know the message has been \Seen. So we capture
+ * the server's notion of 'read' and if it differs from the message info
+ * picked up in mutt_read_rfc822_header, we mark the message (and context
+ * changed). Another possiblity: ignore Status on IMAP?*/
+ read = h->read;
/* I hate do this here, since it's so low-level, but I'm not sure where
* I can abstract it. Problem: the id and subj hashes lose their keys when
* mutt_free_envelope gets called, but keep their spots in the hash. This
if (h->env->real_subj)
hash_insert (ctx->subj_hash, h->env->real_subj, h, 1);
+ /* see above. We want the new status in h->read, so we unset it manually
+ * and let mutt_set_flag set it correctly, updating context. */
+ if (read != h->read)
+ {
+ h->read = read;
+ mutt_set_flag (ctx, h, M_NEW, read);
+ }
+
h->lines = 0;
fgets (buf, sizeof (buf), msg->fp);
while (!feof (msg->fp))