From: Christian Ludwig Date: Fri, 12 Jan 2018 10:47:51 GMT Subject: [PATCH] send-email: Support separate Reply-To address Message-ID: <20180112104751.28263-1-chrissicool@gmail.com> In some projects contributions from groups are only accepted from a common group email address. But every individual may want to recieve replies to her own personal address. That's what we have 'Reply-To' headers for in SMTP. Introduce an optional '--reply-to' command line option. Unfortunately the $reply_to variable name was already taken for the 'In-Reply-To' header field. To reduce code churn, use $reply_address as variable name instead. Signed-off-by: Christian Ludwig --- Documentation/git-send-email.txt | 5 +++++ git-send-email.perl | 18 +++++++++++++++++- t/t9001-send-email.sh | 2 ++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt index 8060ea35c..c3bc622b1 100644 --- a/Documentation/git-send-email.txt +++ b/Documentation/git-send-email.txt @@ -84,6 +84,11 @@ See the CONFIGURATION section for `sendemail.multiEdit`. the value of GIT_AUTHOR_IDENT, or GIT_COMMITTER_IDENT if that is not set, as returned by "git var -l". +--reply-to=
:: + Specify the address that replies from reciepients should + to go. Use this if replies to messages should go to another + address than what is specified with the --from parameter. + --in-reply-to=:: Make the first mail (or all the mails with `--no-thread`) appear as a reply to the given Message-Id, which avoids breaking threads to diff --git a/git-send-email.perl b/git-send-email.perl index edcc6d346..fc21081d3 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -56,6 +56,7 @@ git send-email --dump-aliases --[no-]cc * Email Cc: --[no-]bcc * Email Bcc: --subject * Email "Subject:" + --reply-to * Email "Reply-To:" --in-reply-to * Email "In-Reply-To:" --[no-]xmailer * Add "X-Mailer:" header (default). --[no-]annotate * Review each patch that will be sent in an editor. @@ -166,7 +167,7 @@ my $re_encoded_word = qr/=\?($re_token)\?($re_token)\?($re_encoded_text)\?=/; # Variables we fill in automatically, or via prompting: my (@to,$no_to,@initial_to,@cc,$no_cc,@initial_cc,@bcclist,$no_bcc,@xh, - $initial_reply_to,$initial_subject,@files, + $initial_reply_to,$reply_address,$initial_subject,@files, $author,$sender,$smtp_authpass,$annotate,$use_xmailer,$compose,$time); my $envelope_sender; @@ -315,6 +316,7 @@ die __("--dump-aliases incompatible with other options\n") $rc = GetOptions( "sender|from=s" => \$sender, "in-reply-to=s" => \$initial_reply_to, + "reply-to=s" => \$reply_address, "subject=s" => \$initial_subject, "to=s" => \@initial_to, "to-cmd=s" => \$to_cmd, @@ -677,6 +679,7 @@ if ($compose) { my $tpl_sender = $sender || $repoauthor || $repocommitter || ''; my $tpl_subject = $initial_subject || ''; my $tpl_reply_to = $initial_reply_to || ''; + my $tpl_reply_address = $reply_address || ''; print $c < References: +Reply-To: Reply Result: OK EOF @@ -297,6 +298,7 @@ test_expect_success $PREREQ 'Show all headers' ' --dry-run \ --suppress-cc=sob \ --from="Example " \ + --reply-to="Reply " \ --to=to@example.com \ --cc=cc@example.com \ --bcc=bcc@example.com \ -- 2.15.1