]> granicus.if.org Git - mutt/commitdiff
Fix postpone/resume to not remove a Mail-Followup-To header (closes #3070)
authorKevin McCarthy <kevin@8t8.us>
Fri, 26 Apr 2013 19:10:46 +0000 (12:10 -0700)
committerKevin McCarthy <kevin@8t8.us>
Fri, 26 Apr 2013 19:10:46 +0000 (12:10 -0700)
This solution changes mutt_prepare_template() to check whether the
message_id field is NULL to decide whether to wipe the message-id and
mail-followup-to headers when instantiating the message.

If we are resending a message, we don't want the previous message-id
and mail-followup-to headers.  If we are resuming a postponed message,
however, we want to keep the mail-followup-to header if any was set
before the postpone.
(grafted from d7d83298011a6e7aa31bde49e0b6b21209a85fd2)

postpone.c

index 2ba019c9f43ceb265cb0de157c4d743b1352aaef..801ef1042141d23fb62bc70c0fd1c1191ab4eb5f 100644 (file)
@@ -551,8 +551,15 @@ int mutt_prepare_template (FILE *fp, CONTEXT *ctx, HEADER *newhdr, HEADER *hdr,
   newhdr->content->length = hdr->content->length;
   mutt_parse_part (fp, newhdr->content);
 
-  FREE (&newhdr->env->message_id);
-  FREE (&newhdr->env->mail_followup_to); /* really? */
+  /* If message_id is set, then we are resending a message and don't want
+   * message_id or mail_followup_to. Otherwise, we are resuming a
+   * postponed message, and want to keep the mail_followup_to.
+   */
+  if (newhdr->env->message_id != NULL)
+  {
+    FREE (&newhdr->env->message_id);
+    FREE (&newhdr->env->mail_followup_to);
+  }
 
   /* decrypt pgp/mime encoded messages */