diff -ur mutt-1.3.24/hook.c mutt-1.3.24-mine/hook.c --- mutt-1.3.24/hook.c Fri Jun 29 03:06:14 2001 +++ mutt-1.3.24-mine/hook.c Wed Dec 5 12:32:47 2001 @@ -321,6 +321,14 @@ char buf[STRING]; current_hook_type = type; + + setenv("MUTT_SUBJECT", hdr->env->subject, 1); + if (hdr->env->real_subj) + setenv("MUTT_REAL_SUBJECT", hdr->env->real_subj, 1); + setenv("MUTT_TO", hdr->env->to, 1); + setenv("MUTT_CC", hdr->env->cc, 1); + if (hdr->env->message_id) + setenv("MUTT_MESSAGE_ID", hdr->env->message_id, 1); err.data = buf; err.dsize = sizeof (buf); diff -ur mutt-1.3.24/send.c mutt-1.3.24-mine/send.c --- mutt-1.3.24/send.c Tue Nov 6 02:46:29 2001 +++ mutt-1.3.24-mine/send.c Wed Dec 5 12:10:27 2001 @@ -281,10 +281,18 @@ } else if (ascii_strncasecmp ("message-id:", uh->data, 11) == 0) mutt_str_replace (&env->message_id, uh->data + 11); + else if (ascii_strncasecmp ("subject:", uh->data, 8) == 0) + { + regmatch_t pmatch[1]; + mutt_str_replace (&env->subject, uh->data + 8); + env->real_subj = (regexec (ReplyRegexp.rx, + env->subject, 1, pmatch, 0)) ? + env->subject : + env->subject + pmatch[0].rm_eo; + } else if (ascii_strncasecmp ("to:", uh->data, 3) != 0 && ascii_strncasecmp ("cc:", uh->data, 3) != 0 && - ascii_strncasecmp ("bcc:", uh->data, 4) != 0 && - ascii_strncasecmp ("subject:", uh->data, 8) != 0) + ascii_strncasecmp ("bcc:", uh->data, 4) != 0) { if (last) { @@ -1181,9 +1189,9 @@ } else if (! (flags & (SENDPOSTPONED|SENDRESEND))) { - if ((flags & (SENDREPLY | SENDFORWARD)) && ctx && - envelope_defaults (msg->env, ctx, cur, flags) == -1) - goto cleanup; + if ((flags & (SENDREPLY | SENDFORWARD)) && ctx) + if (envelope_defaults (msg->env, ctx, cur, flags) == -1) + goto cleanup; if (option (OPTHDRS)) process_user_recips (msg->env);