From 888f758e9599f619c745f8c93089225e46c6aac2 Mon Sep 17 00:00:00 2001 From: Serge Gebhardt Date: Sat, 19 Nov 2016 23:15:21 +0100 Subject: [PATCH] $forward_references includes References: header on forwards By default a forwarded message does not reference the messages it contains. This commit introduces a new boolean option `$forward_references`. When it is set, a forwarded message includes the `In-Reply-To:` and `References:` headers, just like a reply would. Hence the forwarded message becomes part of the original thread instead of starting a new one. --- doc/manual.xml.head | 9 +++++++++ init.h | 8 ++++++++ mutt.h | 1 + send.c | 4 ++++ 4 files changed, 22 insertions(+) diff --git a/doc/manual.xml.head b/doc/manual.xml.head index f4f1e5d..7ce5144 100644 --- a/doc/manual.xml.head +++ b/doc/manual.xml.head @@ -2286,6 +2286,15 @@ linkend="mime-forward">$mime_forward is set. +By default a forwarded message does not reference the messages it +contains. When $forward_references +is set, a forwarded message includes the In-Reply-To: +and References: headers, just like a reply would. Hence +the forwarded message becomes part of the original thread instead of +starting a new one. + + + Editing the message to forward follows the same procedure as sending or replying to a message does. diff --git a/init.h b/init.h index 3a9b078..bf5c383 100644 --- a/init.h +++ b/init.h @@ -982,6 +982,14 @@ struct option_t MuttVars[] = { { "forw_quote", DT_SYN, R_NONE, UL "forward_quote", 0 }, /* */ + { "forward_references", DT_BOOL, R_NONE, OPTFORWREF, 0 }, + /* + ** .pp + ** When \fIset\fP, forwarded messages set the ``In-Reply-To:'' and + ** ``References:'' headers in the same way as normal replies would. Hence the + ** forwarded message becomes part of the original thread instead of starting + ** a new one. + */ { "from", DT_ADDR, R_NONE, UL &From, UL 0 }, /* ** .pp diff --git a/mutt.h b/mutt.h index 0fe027f..94291c1 100644 --- a/mutt.h +++ b/mutt.h @@ -399,6 +399,7 @@ enum OPTFORCENAME, OPTFORWDECODE, OPTFORWQUOTE, + OPTFORWREF, #ifdef USE_HCACHE OPTHCACHEVERIFY, #if defined(HAVE_QDBM) || defined(HAVE_TC) || defined(HAVE_KC) diff --git a/send.c b/send.c index d2a2491..bb468f7 100644 --- a/send.c +++ b/send.c @@ -810,7 +810,11 @@ envelope_defaults (ENVELOPE *env, CONTEXT *ctx, HEADER *cur, int flags) mutt_make_reference_headers (tag ? NULL : curenv, env, ctx); } else if (flags & SENDFORWARD) + { mutt_make_forward_subject (env, ctx, cur); + if (option (OPTFORWREF)) + mutt_make_reference_headers (tag ? NULL : curenv, env, ctx); + } return (0); }