diff -up mutt/pop.c.pophash mutt/pop.c
--- mutt/pop.c.pophash 2009-12-14 19:24:59.000000000 +0100
+++ mutt/pop.c 2011-10-04 16:51:23.307236908 +0200
@@ -618,8 +618,15 @@ int pop_fetch_message (MESSAGE* msg, CON
}
rewind (msg->fp);
uidl = h->data;
+
+ /* we replace envelop, key in subj_hash has to be updated as well */
+ if (ctx->subj_hash && h->env->real_subj)
+ hash_delete (ctx->subj_hash, h->env->real_subj, h, NULL);
mutt_free_envelope (&h->env);
h->env = mutt_read_rfc822_header (msg->fp, h, 0, 0);
+ if (ctx->subj_hash && h->env->real_subj)
+ hash_insert (ctx->subj_hash, h->env->real_subj, h, 1);
+
h->data = uidl;
h->lines = 0;
fgets (buf, sizeof (buf), msg->fp);