git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC][PATCH] send-email: add --[no-]xmailer option

From
Luis Henriques <henrix@camandro.org>
Date
Dec 3, 2014, 10:13 UTC
Message-ID
<20141203101344.GA2809@charon.olymp>
In-Reply-To
<CE4526D6-F223-4FD8-A66E-F39D85E843B2@gmail.com>
On Tue, Dec 02, 2014 at 07:22:10PM -0800, Kyle J. McKay wrote:
Show 31 quoted lines
> On Dec 2, 2014, at 18:34, Eric Wong wrote:
> 
> >Luis Henriques <henrix@camandro.org> wrote:
> >>On Mon, Mar 24, 2014 at 09:38:27PM +0000, Luis Henriques wrote:
> >>>Add --[no-]xmailer that allows a user to disable adding the 'X-Mailer:'
> >>>header to the email being sent.
> >>>
> >>
> >>Ping
> >>
> >>It's been a while since I sent this patch.  Is there any interest in
> >>having this switch in git-send-email?
> >
> >I wasn't paying attention when the original was sent, but this
> >looks good to me.
> >
> >Acked-by: Eric Wong <normalperson@yhbt.net>
> >
> >>I honestly don't like disclosing too much information about my system,
> >>in this case which MUA I'm using and its version.
> >
> >Right on.  I would even favor this being the default.
> 
> I fully agree with you.
> 
> >Auto-generated Message-Id headers also shows the use of git-send-email;
> >perhaps there can be a way to configure that, too.  However,
> >git-send-email respects manually-added Message-Id headers in the
> >original patch, so it's less of a problem, I suppose.
> 
> It can be hashed like so to avoid leaking information:
Awesome, I like this idea too!
Cheers,
-- 
Luís

> 
> diff --git a/git-send-email.orig b/git-send-email.new
> index f3d75e8..d0b4bff 100755
> --- a/git-send-email.orig
> +++ b/git-send-email.new
> @@ -27,6 +27,7 @@ use Data::Dumper;
>  use Term::ANSIColor;
>  use File::Temp qw/ tempdir tempfile /;
>  use File::Spec::Functions qw(catfile);
> +use Digest::MD5 qw(md5_hex);
>  use Error qw(:try);
>  use Git;
> 
> @@ -901,8 +903,10 @@ sub make_message_id {
>  		require Sys::Hostname;
>  		$du_part = 'user@' . Sys::Hostname::hostname();
>  	}
> -	my $message_id_template = "<%s-git-send-email-%s>";
> +	my $message_id_template = "%s-git-send-email-%s";
>  	$message_id = sprintf($message_id_template, $uniq, $du_part);
> +	@_ = split /@/, $message_id;
> +	$message_id = '<'.substr(md5_hex($_[0]),0,31).'@'.substr(md5_hex($_[1]),1,31).'>';
>  	#print "new message id = $message_id\n"; # Was useful for debugging
>  }
> 
> ---
> 
> --Kyle
Previous: Kyle J. McKayNext: Junio C Hamano
Message 5 of 13 in “send-email: add --[no-]xmailer option”
  1. Luis HenriquesMar 24, 2014
  2. Luis HenriquesDec 2, 2014
  3. Eric WongDec 3, 2014
  4. Kyle J. McKayDec 3, 2014
  5. Luis HenriquesDec 3, 2014
  6. Junio C HamanoDec 3, 2014
  7. Luis HenriquesDec 4, 2014
  8. Junio C HamanoDec 4, 2014
  9. Luis HenriquesDec 4, 2014
  10. Junio C HamanoDec 3, 2014
  11. Junio C HamanoDec 3, 2014
  12. Junio C HamanoDec 3, 2014
  13. Luis HenriquesDec 3, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.