{"thread":{"id":"36286","subject":"[RFC][PATCH] send-email: add --[no-]xmailer option","startedAt":"2014-03-24T21:38:27Z","lastAt":"2014-12-04T19:44:55Z","messageCount":13,"participants":["Luis Henriques","Eric Wong","Kyle J. McKay","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"237509","messageId":"20140324213814.GA1267@achilles.my.domain","threadId":"36286","inReplyTo":null,"subject":"[RFC][PATCH] send-email: add --[no-]xmailer option","fromName":"Luis Henriques","fromEmail":"henrix@camandro.org","sentAt":"2014-03-24T21:38:27Z","receivedAt":"2014-03-24T21:38:27Z","isPatch":true,"sender":{"key":"henrix@camandro.org","avatar":"https://avatars.githubusercontent.com/u/73643340?v=4"},"body":"Add --[no-]xmailer that allows a user to disable adding the 'X-Mailer:'\nheader to the email being sent.\n\nSigned-off-by: Luis Henriques <henrix@camandro.org>\n---\n Documentation/config.txt         |  1 +\n Documentation/git-send-email.txt |  3 +++\n git-send-email.perl              | 12 ++++++++++--\n 3 files changed, 14 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 73c8973..c33d5a1 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -2222,6 +2222,7 @@ sendemail.smtpserveroption::\n sendemail.smtpuser::\n sendemail.thread::\n sendemail.validate::\n+sendemail.xmailer::\n \tSee linkgit:git-send-email[1] for description.\n \n sendemail.signedoffcc::\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex f0e57a5..fab6264 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -131,6 +131,9 @@ Note that no attempts whatsoever are made to validate the encoding.\n \tSpecify encoding of compose message. Default is the value of the\n \t'sendemail.composeencoding'; if that is unspecified, UTF-8 is assumed.\n \n+--xmailer::\n+\tPrevent adding the \"X-Mailer:\" header.  Default value is\n+\t'sendemail.xmailer'.\n \n Sending\n ~~~~~~~\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex fdb0029..8789124 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -54,6 +54,7 @@ git send-email [options] <file | directory | rev-list options >\n     --[no-]bcc              <str>  * Email Bcc:\n     --subject               <str>  * Email \"Subject:\"\n     --in-reply-to           <str>  * Email \"In-Reply-To:\"\n+    --[no-]xmailer                 * Don't add \"X-Mailer:\" header.  Default on.\n     --[no-]annotate                * Review each patch that will be sent in an editor.\n     --compose                      * Open an editor for introduction.\n     --compose-encoding      <str>  * Encoding to assume for introduction.\n@@ -174,6 +175,9 @@ my $force = 0;\n my $multiedit;\n my $editor;\n \n+# Usage of X-Mailer email header\n+my $xmailer;\n+\n sub do_edit {\n \tif (!defined($editor)) {\n \t\t$editor = Git::command_oneline('var', 'GIT_EDITOR');\n@@ -214,7 +218,8 @@ my %config_bool_settings = (\n     \"signedoffcc\" => [\\$signed_off_by_cc, undef],      # Deprecated\n     \"validate\" => [\\$validate, 1],\n     \"multiedit\" => [\\$multiedit, undef],\n-    \"annotate\" => [\\$annotate, undef]\n+    \"annotate\" => [\\$annotate, undef],\n+    \"xmailer\" => [\\$xmailer, 1]\n );\n \n my %config_settings = (\n@@ -311,6 +316,7 @@ my $rc = GetOptions(\"h\" => \\$help,\n \t\t    \"8bit-encoding=s\" => \\$auto_8bit_encoding,\n \t\t    \"compose-encoding=s\" => \\$compose_encoding,\n \t\t    \"force\" => \\$force,\n+\t\t    \"xmailer!\" => \\$xmailer,\n \t );\n \n usage() if $help;\n@@ -1144,8 +1150,10 @@ To: $to${ccline}\n Subject: $subject\n Date: $date\n Message-Id: $message_id\n-X-Mailer: git-send-email $gitversion\n \";\n+\tif ($xmailer) {\n+\t\t$header .= \"X-Mailer: git-send-email $gitversion\\n\";\n+\t}\n \tif ($reply_to) {\n \n \t\t$header .= \"In-Reply-To: $reply_to\\n\";\n-- \n1.9.1\n"},{"id":"252886","messageId":"20141202193243.GA2999@charon.olymp","threadId":"36286","inReplyTo":"20140324213814.GA1267@achilles.my.domain","subject":"Re: [RFC][PATCH] send-email: add --[no-]xmailer option","fromName":"Luis Henriques","fromEmail":"henrix@camandro.org","sentAt":"2014-12-02T19:32:44Z","receivedAt":"2014-12-02T19:32:44Z","isPatch":true,"sender":{"key":"henrix@camandro.org","avatar":"https://avatars.githubusercontent.com/u/73643340?v=4"},"body":"On Mon, Mar 24, 2014 at 09:38:27PM +0000, Luis Henriques wrote:\n> Add --[no-]xmailer that allows a user to disable adding the 'X-Mailer:'\n> header to the email being sent.\n>\n\nPing\n\nIt's been a while since I sent this patch.  Is there any interest in\nhaving this switch in git-send-email?\n\nI honestly don't like disclosing too much information about my system,\nin this case which MUA I'm using and its version.\n\nCheers,\n-- \nLuís\n\n> Signed-off-by: Luis Henriques <henrix@camandro.org>\n> ---\n>  Documentation/config.txt         |  1 +\n>  Documentation/git-send-email.txt |  3 +++\n>  git-send-email.perl              | 12 ++++++++++--\n>  3 files changed, 14 insertions(+), 2 deletions(-)\n> \n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index 73c8973..c33d5a1 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -2222,6 +2222,7 @@ sendemail.smtpserveroption::\n>  sendemail.smtpuser::\n>  sendemail.thread::\n>  sendemail.validate::\n> +sendemail.xmailer::\n>  \tSee linkgit:git-send-email[1] for description.\n>  \n>  sendemail.signedoffcc::\n> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\n> index f0e57a5..fab6264 100644\n> --- a/Documentation/git-send-email.txt\n> +++ b/Documentation/git-send-email.txt\n> @@ -131,6 +131,9 @@ Note that no attempts whatsoever are made to validate the encoding.\n>  \tSpecify encoding of compose message. Default is the value of the\n>  \t'sendemail.composeencoding'; if that is unspecified, UTF-8 is assumed.\n>  \n> +--xmailer::\n> +\tPrevent adding the \"X-Mailer:\" header.  Default value is\n> +\t'sendemail.xmailer'.\n>  \n>  Sending\n>  ~~~~~~~\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index fdb0029..8789124 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -54,6 +54,7 @@ git send-email [options] <file | directory | rev-list options >\n>      --[no-]bcc              <str>  * Email Bcc:\n>      --subject               <str>  * Email \"Subject:\"\n>      --in-reply-to           <str>  * Email \"In-Reply-To:\"\n> +    --[no-]xmailer                 * Don't add \"X-Mailer:\" header.  Default on.\n>      --[no-]annotate                * Review each patch that will be sent in an editor.\n>      --compose                      * Open an editor for introduction.\n>      --compose-encoding      <str>  * Encoding to assume for introduction.\n> @@ -174,6 +175,9 @@ my $force = 0;\n>  my $multiedit;\n>  my $editor;\n>  \n> +# Usage of X-Mailer email header\n> +my $xmailer;\n> +\n>  sub do_edit {\n>  \tif (!defined($editor)) {\n>  \t\t$editor = Git::command_oneline('var', 'GIT_EDITOR');\n> @@ -214,7 +218,8 @@ my %config_bool_settings = (\n>      \"signedoffcc\" => [\\$signed_off_by_cc, undef],      # Deprecated\n>      \"validate\" => [\\$validate, 1],\n>      \"multiedit\" => [\\$multiedit, undef],\n> -    \"annotate\" => [\\$annotate, undef]\n> +    \"annotate\" => [\\$annotate, undef],\n> +    \"xmailer\" => [\\$xmailer, 1]\n>  );\n>  \n>  my %config_settings = (\n> @@ -311,6 +316,7 @@ my $rc = GetOptions(\"h\" => \\$help,\n>  \t\t    \"8bit-encoding=s\" => \\$auto_8bit_encoding,\n>  \t\t    \"compose-encoding=s\" => \\$compose_encoding,\n>  \t\t    \"force\" => \\$force,\n> +\t\t    \"xmailer!\" => \\$xmailer,\n>  \t );\n>  \n>  usage() if $help;\n> @@ -1144,8 +1150,10 @@ To: $to${ccline}\n>  Subject: $subject\n>  Date: $date\n>  Message-Id: $message_id\n> -X-Mailer: git-send-email $gitversion\n>  \";\n> +\tif ($xmailer) {\n> +\t\t$header .= \"X-Mailer: git-send-email $gitversion\\n\";\n> +\t}\n>  \tif ($reply_to) {\n>  \n>  \t\t$header .= \"In-Reply-To: $reply_to\\n\";\n> -- \n> 1.9.1\n"},{"id":"252912","messageId":"20141203023419.GA10519@dcvr.yhbt.net","threadId":"36286","inReplyTo":"20141202193243.GA2999@charon.olymp","subject":"Re: [RFC][PATCH] send-email: add --[no-]xmailer option","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2014-12-03T02:34:19Z","receivedAt":"2014-12-03T02:34:19Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Luis Henriques <henrix@camandro.org> wrote:\n> On Mon, Mar 24, 2014 at 09:38:27PM +0000, Luis Henriques wrote:\n> > Add --[no-]xmailer that allows a user to disable adding the 'X-Mailer:'\n> > header to the email being sent.\n> >\n> \n> Ping\n> \n> It's been a while since I sent this patch.  Is there any interest in\n> having this switch in git-send-email?\n\nI wasn't paying attention when the original was sent, but this\nlooks good to me.\n\nAcked-by: Eric Wong <normalperson@yhbt.net>\n\n> I honestly don't like disclosing too much information about my system,\n> in this case which MUA I'm using and its version.\n\nRight on.  I would even favor this being the default.\n\nAuto-generated Message-Id headers also shows the use of git-send-email;\nperhaps there can be a way to configure that, too.  However,\ngit-send-email respects manually-added Message-Id headers in the\noriginal patch, so it's less of a problem, I suppose.\n"},{"id":"252917","messageId":"CE4526D6-F223-4FD8-A66E-F39D85E843B2@gmail.com","threadId":"36286","inReplyTo":"20141203023419.GA10519@dcvr.yhbt.net","subject":"Re: [RFC][PATCH] send-email: add --[no-]xmailer option","fromName":"Kyle J. McKay","fromEmail":"mackyle@gmail.com","sentAt":"2014-12-03T03:22:10Z","receivedAt":"2014-12-03T03:22:10Z","isPatch":true,"sender":{"key":"mackyle@gmail.com","avatar":"https://avatars.githubusercontent.com/u/813346?v=4"},"body":"On Dec 2, 2014, at 18:34, Eric Wong wrote:\n\n> Luis Henriques <henrix@camandro.org> wrote:\n>> On Mon, Mar 24, 2014 at 09:38:27PM +0000, Luis Henriques wrote:\n>>> Add --[no-]xmailer that allows a user to disable adding the 'X- \n>>> Mailer:'\n>>> header to the email being sent.\n>>>\n>>\n>> Ping\n>>\n>> It's been a while since I sent this patch.  Is there any interest in\n>> having this switch in git-send-email?\n>\n> I wasn't paying attention when the original was sent, but this\n> looks good to me.\n>\n> Acked-by: Eric Wong <normalperson@yhbt.net>\n>\n>> I honestly don't like disclosing too much information about my  \n>> system,\n>> in this case which MUA I'm using and its version.\n>\n> Right on.  I would even favor this being the default.\n\nI fully agree with you.\n\n> Auto-generated Message-Id headers also shows the use of git-send- \n> email;\n> perhaps there can be a way to configure that, too.  However,\n> git-send-email respects manually-added Message-Id headers in the\n> original patch, so it's less of a problem, I suppose.\n\nIt can be hashed like so to avoid leaking information:\n\ndiff --git a/git-send-email.orig b/git-send-email.new\nindex f3d75e8..d0b4bff 100755\n--- a/git-send-email.orig\n+++ b/git-send-email.new\n@@ -27,6 +27,7 @@ use Data::Dumper;\n  use Term::ANSIColor;\n  use File::Temp qw/ tempdir tempfile /;\n  use File::Spec::Functions qw(catfile);\n+use Digest::MD5 qw(md5_hex);\n  use Error qw(:try);\n  use Git;\n\n@@ -901,8 +903,10 @@ sub make_message_id {\n  \t\trequire Sys::Hostname;\n  \t\t$du_part = 'user@' . Sys::Hostname::hostname();\n  \t}\n-\tmy $message_id_template = \"<%s-git-send-email-%s>\";\n+\tmy $message_id_template = \"%s-git-send-email-%s\";\n  \t$message_id = sprintf($message_id_template, $uniq, $du_part);\n+\t@_ = split /@/, $message_id;\n+\t$message_id = '<'.substr(md5_hex($_[0]), \n0,31).'@'.substr(md5_hex($_[1]),1,31).'>';\n  \t#print \"new message id = $message_id\\n\"; # Was useful for debugging\n  }\n\n---\n\n--Kyle\n"},{"id":"252938","messageId":"20141203101344.GA2809@charon.olymp","threadId":"36286","inReplyTo":"CE4526D6-F223-4FD8-A66E-F39D85E843B2@gmail.com","subject":"Re: [RFC][PATCH] send-email: add --[no-]xmailer option","fromName":"Luis Henriques","fromEmail":"henrix@camandro.org","sentAt":"2014-12-03T10:13:45Z","receivedAt":"2014-12-03T10:13:45Z","isPatch":true,"sender":{"key":"henrix@camandro.org","avatar":"https://avatars.githubusercontent.com/u/73643340?v=4"},"body":"On Tue, Dec 02, 2014 at 07:22:10PM -0800, Kyle J. McKay wrote:\n> On Dec 2, 2014, at 18:34, Eric Wong wrote:\n> \n> >Luis Henriques <henrix@camandro.org> wrote:\n> >>On Mon, Mar 24, 2014 at 09:38:27PM +0000, Luis Henriques wrote:\n> >>>Add --[no-]xmailer that allows a user to disable adding the 'X-Mailer:'\n> >>>header to the email being sent.\n> >>>\n> >>\n> >>Ping\n> >>\n> >>It's been a while since I sent this patch.  Is there any interest in\n> >>having this switch in git-send-email?\n> >\n> >I wasn't paying attention when the original was sent, but this\n> >looks good to me.\n> >\n> >Acked-by: Eric Wong <normalperson@yhbt.net>\n> >\n> >>I honestly don't like disclosing too much information about my system,\n> >>in this case which MUA I'm using and its version.\n> >\n> >Right on.  I would even favor this being the default.\n> \n> I fully agree with you.\n> \n> >Auto-generated Message-Id headers also shows the use of git-send-email;\n> >perhaps there can be a way to configure that, too.  However,\n> >git-send-email respects manually-added Message-Id headers in the\n> >original patch, so it's less of a problem, I suppose.\n> \n> It can be hashed like so to avoid leaking information:\n\nAwesome, I like this idea too!\n\nCheers,\n-- \nLuís\n\n> \n> diff --git a/git-send-email.orig b/git-send-email.new\n> index f3d75e8..d0b4bff 100755\n> --- a/git-send-email.orig\n> +++ b/git-send-email.new\n> @@ -27,6 +27,7 @@ use Data::Dumper;\n>  use Term::ANSIColor;\n>  use File::Temp qw/ tempdir tempfile /;\n>  use File::Spec::Functions qw(catfile);\n> +use Digest::MD5 qw(md5_hex);\n>  use Error qw(:try);\n>  use Git;\n> \n> @@ -901,8 +903,10 @@ sub make_message_id {\n>  \t\trequire Sys::Hostname;\n>  \t\t$du_part = 'user@' . Sys::Hostname::hostname();\n>  \t}\n> -\tmy $message_id_template = \"<%s-git-send-email-%s>\";\n> +\tmy $message_id_template = \"%s-git-send-email-%s\";\n>  \t$message_id = sprintf($message_id_template, $uniq, $du_part);\n> +\t@_ = split /@/, $message_id;\n> +\t$message_id = '<'.substr(md5_hex($_[0]),0,31).'@'.substr(md5_hex($_[1]),1,31).'>';\n>  \t#print \"new message id = $message_id\\n\"; # Was useful for debugging\n>  }\n> \n> ---\n> \n> --Kyle\n"},{"id":"252956","messageId":"xmqqk328k6ya.fsf@gitster.dls.corp.google.com","threadId":"36286","inReplyTo":"20141203023419.GA10519@dcvr.yhbt.net","subject":"Re: [RFC][PATCH] send-email: add --[no-]xmailer option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-12-03T16:56:45Z","receivedAt":"2014-12-03T16:56:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> Luis Henriques <henrix@camandro.org> wrote:\n>> On Mon, Mar 24, 2014 at 09:38:27PM +0000, Luis Henriques wrote:\n>> > Add --[no-]xmailer that allows a user to disable adding the 'X-Mailer:'\n>> > header to the email being sent.\n>> >\n>> \n>> Ping\n>> \n>> It's been a while since I sent this patch.  Is there any interest in\n>> having this switch in git-send-email?\n>\n> I wasn't paying attention when the original was sent, but this\n> looks good to me.\n>\n> Acked-by: Eric Wong <normalperson@yhbt.net>\n>\n>> I honestly don't like disclosing too much information about my system,\n>> in this case which MUA I'm using and its version.\n>\n> Right on.  I would even favor this being the default.\n>\n> Auto-generated Message-Id headers also shows the use of git-send-email;\n> perhaps there can be a way to configure that, too.  However,\n> git-send-email respects manually-added Message-Id headers in the\n> original patch, so it's less of a problem, I suppose.\n\nI actually do not think this is a good idea from debuggability.\n"},{"id":"252958","messageId":"xmqqfvcwk6en.fsf@gitster.dls.corp.google.com","threadId":"36286","inReplyTo":"20140324213814.GA1267@achilles.my.domain","subject":"Re: [RFC][PATCH] send-email: add --[no-]xmailer option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-12-03T17:08:32Z","receivedAt":"2014-12-03T17:08:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Luis Henriques <henrix@camandro.org> writes:\n\n> +--xmailer::\n> +\tPrevent adding the \"X-Mailer:\" header.  Default value is\n> +\t'sendemail.xmailer'.\n\nTwo problems here.\n\n - \"git send-email --xmailer\" would _ADD_, not prevent adding, the\n   header, regardless of the value of sendemail.xmailer.\n\n - It is unspecified what happens when you do not have\n   sendemail.xmailer and do not give the --xmailer option.\n\nPerhaps\n\n--xmailer::\n--no-xmailer::\n\n\tBy default, `git send-email` adds an \"X-Mailer:\" header to\n        the message to identify the version of itself.  The\n        `--no-xmailer` option can be used to turn this off (setting\n        the `sendemail.xmailer` configuration to false has the same\n        effect).  The `--xmailer` option from the command line is\n        useful to countermand `sendemail.xmailer` that is set to\n        `false`.\n\nor something?\n\n\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index fdb0029..8789124 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -54,6 +54,7 @@ git send-email [options] <file | directory | rev-list options >\n>      --[no-]bcc              <str>  * Email Bcc:\n>      --subject               <str>  * Email \"Subject:\"\n>      --in-reply-to           <str>  * Email \"In-Reply-To:\"\n> +    --[no-]xmailer                 * Don't add \"X-Mailer:\" header.  Default on.\n\nThe same confusion exists here.  \"Don't ... default on\" hints that\nby default we won't see \"X-mailer:\" which is not true.\n\nA way to avoid confusion is to describe what the option is about for\nthe positive variant, just like it is done for \"--[no-]annotate\"\noption below.\n\n> @@ -174,6 +175,9 @@ my $force = 0;\n>  my $multiedit;\n>  my $editor;\n>  \n> +# Usage of X-Mailer email header\n> +my $xmailer;\n> +\n>  sub do_edit {\n>  \tif (!defined($editor)) {\n>  \t\t$editor = Git::command_oneline('var', 'GIT_EDITOR');\n> @@ -214,7 +218,8 @@ my %config_bool_settings = (\n>      \"signedoffcc\" => [\\$signed_off_by_cc, undef],      # Deprecated\n>      \"validate\" => [\\$validate, 1],\n>      \"multiedit\" => [\\$multiedit, undef],\n> -    \"annotate\" => [\\$annotate, undef]\n> +    \"annotate\" => [\\$annotate, undef],\n> +    \"xmailer\" => [\\$xmailer, 1]\n>  );\n>  \n>  my %config_settings = (\n> @@ -311,6 +316,7 @@ my $rc = GetOptions(\"h\" => \\$help,\n>  \t\t    \"8bit-encoding=s\" => \\$auto_8bit_encoding,\n>  \t\t    \"compose-encoding=s\" => \\$compose_encoding,\n>  \t\t    \"force\" => \\$force,\n> +\t\t    \"xmailer!\" => \\$xmailer,\n>  \t );\n>  \n>  usage() if $help;\n> @@ -1144,8 +1150,10 @@ To: $to${ccline}\n>  Subject: $subject\n>  Date: $date\n>  Message-Id: $message_id\n> -X-Mailer: git-send-email $gitversion\n>  \";\n> +\tif ($xmailer) {\n> +\t\t$header .= \"X-Mailer: git-send-email $gitversion\\n\";\n> +\t}\n>  \tif ($reply_to) {\n>  \n>  \t\t$header .= \"In-Reply-To: $reply_to\\n\";\n\ntests?\n\nThanks.\n"},{"id":"252961","messageId":"xmqq388wk5q8.fsf@gitster.dls.corp.google.com","threadId":"36286","inReplyTo":"xmqqfvcwk6en.fsf@gitster.dls.corp.google.com","subject":"Re: [RFC][PATCH] send-email: add --[no-]xmailer option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-12-03T17:23:11Z","receivedAt":"2014-12-03T17:23:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Two problems here.\n> ...\n> tests?\n\nSomething like this squashed into the patch you posted earlier,\nperhaps, would be a good place to start.\n\n Documentation/git-send-email.txt |  6 ++++--\n git-send-email.perl              | 11 +++++------\n 2 files changed, 9 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex f2425ef..a0bd806 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -132,8 +132,10 @@ Note that no attempts whatsoever are made to validate the encoding.\n \t'sendemail.composeencoding'; if that is unspecified, UTF-8 is assumed.\n \n --xmailer::\n-\tPrevent adding the \"X-Mailer:\" header.  Default value is\n-\t'sendemail.xmailer'.\n+--no-xmailer::\n+\tAdd (or prevent adding) the \"X-Mailer:\" header.  By default,\n+\tthe header is added, but it can be turned off by setting the\n+\t`sendemail.xmailer` configuration variable to `false`.\n \n Sending\n ~~~~~~~\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 9ca7c5b..a6e66b9 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -54,7 +54,7 @@ sub usage {\n     --[no-]bcc              <str>  * Email Bcc:\n     --subject               <str>  * Email \"Subject:\"\n     --in-reply-to           <str>  * Email \"In-Reply-To:\"\n-    --[no-]xmailer                 * Don't add \"X-Mailer:\" header.  Default on.\n+    --[no-]xmailer                 * Add \"X-Mailer:\" header (default).\n     --[no-]annotate                * Review each patch that will be sent in an editor.\n     --compose                      * Open an editor for introduction.\n     --compose-encoding      <str>  * Encoding to assume for introduction.\n@@ -177,8 +177,7 @@ sub format_2822_time {\n my $multiedit;\n my $editor;\n \n-# Usage of X-Mailer email header\n-my $xmailer;\n+my $use_xmailer;\n \n sub do_edit {\n \tif (!defined($editor)) {\n@@ -224,7 +223,7 @@ sub do_edit {\n     \"validate\" => [\\$validate, 1],\n     \"multiedit\" => [\\$multiedit, undef],\n     \"annotate\" => [\\$annotate, undef],\n-    \"xmailer\" => [\\$xmailer, 1]\n+    \"xmailer\" => [\\$use_xmailer, 1]\n );\n \n my %config_settings = (\n@@ -323,7 +322,7 @@ sub signal_handler {\n \t\t    \"8bit-encoding=s\" => \\$auto_8bit_encoding,\n \t\t    \"compose-encoding=s\" => \\$compose_encoding,\n \t\t    \"force\" => \\$force,\n-\t\t    \"xmailer!\" => \\$xmailer,\n+\t\t    \"xmailer!\" => \\$use_xmailer,\n \t );\n \n usage() if $help;\n@@ -1170,7 +1169,7 @@ sub send_message {\n Date: $date\n Message-Id: $message_id\n \";\n-\tif ($xmailer) {\n+\tif ($use_xmailer) {\n \t\t$header .= \"X-Mailer: git-send-email $gitversion\\n\";\n \t}\n \tif ($reply_to) {\n-- \n2.2.0-141-gd3f4719\n"},{"id":"252964","messageId":"xmqqtx1ciqe8.fsf@gitster.dls.corp.google.com","threadId":"36286","inReplyTo":"xmqq388wk5q8.fsf@gitster.dls.corp.google.com","subject":"Re: [RFC][PATCH] send-email: add --[no-]xmailer option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-12-03T17:39:43Z","receivedAt":"2014-12-03T17:39:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> @@ -177,8 +177,7 @@ sub format_2822_time {\n>  my $multiedit;\n>  my $editor;\n>  \n> -# Usage of X-Mailer email header\n> -my $xmailer;\n> +my $use_xmailer;\n\nJust another small thing.  The version of \"SQUASH???\" commit I will\nqueue on 'pu' will have this next to where $annotate is defined.\n"},{"id":"252967","messageId":"20141203180248.GA3362@charon.olymp","threadId":"36286","inReplyTo":"xmqq388wk5q8.fsf@gitster.dls.corp.google.com","subject":"Re: [RFC][PATCH] send-email: add --[no-]xmailer option","fromName":"Luis Henriques","fromEmail":"henrix@camandro.org","sentAt":"2014-12-03T18:02:48Z","receivedAt":"2014-12-03T18:02:48Z","isPatch":true,"sender":{"key":"henrix@camandro.org","avatar":"https://avatars.githubusercontent.com/u/73643340?v=4"},"body":"On Wed, Dec 03, 2014 at 09:23:11AM -0800, Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > Two problems here.\n> > ...\n> > tests?\n> \n> Something like this squashed into the patch you posted earlier,\n> perhaps, would be a good place to start.\n>\n\nAwesome, thank you for your review.  I'll post a new version of the\npatch including your suggestions.  Regarding the tests, I'll need a\nbit more time to work on those.\n\nCheers,\n-- \nLuís\n\n\n>  Documentation/git-send-email.txt |  6 ++++--\n>  git-send-email.perl              | 11 +++++------\n>  2 files changed, 9 insertions(+), 8 deletions(-)\n> \n> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\n> index f2425ef..a0bd806 100644\n> --- a/Documentation/git-send-email.txt\n> +++ b/Documentation/git-send-email.txt\n> @@ -132,8 +132,10 @@ Note that no attempts whatsoever are made to validate the encoding.\n>  \t'sendemail.composeencoding'; if that is unspecified, UTF-8 is assumed.\n>  \n>  --xmailer::\n> -\tPrevent adding the \"X-Mailer:\" header.  Default value is\n> -\t'sendemail.xmailer'.\n> +--no-xmailer::\n> +\tAdd (or prevent adding) the \"X-Mailer:\" header.  By default,\n> +\tthe header is added, but it can be turned off by setting the\n> +\t`sendemail.xmailer` configuration variable to `false`.\n>  \n>  Sending\n>  ~~~~~~~\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 9ca7c5b..a6e66b9 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -54,7 +54,7 @@ sub usage {\n>      --[no-]bcc              <str>  * Email Bcc:\n>      --subject               <str>  * Email \"Subject:\"\n>      --in-reply-to           <str>  * Email \"In-Reply-To:\"\n> -    --[no-]xmailer                 * Don't add \"X-Mailer:\" header.  Default on.\n> +    --[no-]xmailer                 * Add \"X-Mailer:\" header (default).\n>      --[no-]annotate                * Review each patch that will be sent in an editor.\n>      --compose                      * Open an editor for introduction.\n>      --compose-encoding      <str>  * Encoding to assume for introduction.\n> @@ -177,8 +177,7 @@ sub format_2822_time {\n>  my $multiedit;\n>  my $editor;\n>  \n> -# Usage of X-Mailer email header\n> -my $xmailer;\n> +my $use_xmailer;\n>  \n>  sub do_edit {\n>  \tif (!defined($editor)) {\n> @@ -224,7 +223,7 @@ sub do_edit {\n>      \"validate\" => [\\$validate, 1],\n>      \"multiedit\" => [\\$multiedit, undef],\n>      \"annotate\" => [\\$annotate, undef],\n> -    \"xmailer\" => [\\$xmailer, 1]\n> +    \"xmailer\" => [\\$use_xmailer, 1]\n>  );\n>  \n>  my %config_settings = (\n> @@ -323,7 +322,7 @@ sub signal_handler {\n>  \t\t    \"8bit-encoding=s\" => \\$auto_8bit_encoding,\n>  \t\t    \"compose-encoding=s\" => \\$compose_encoding,\n>  \t\t    \"force\" => \\$force,\n> -\t\t    \"xmailer!\" => \\$xmailer,\n> +\t\t    \"xmailer!\" => \\$use_xmailer,\n>  \t );\n>  \n>  usage() if $help;\n> @@ -1170,7 +1169,7 @@ sub send_message {\n>  Date: $date\n>  Message-Id: $message_id\n>  \";\n> -\tif ($xmailer) {\n> +\tif ($use_xmailer) {\n>  \t\t$header .= \"X-Mailer: git-send-email $gitversion\\n\";\n>  \t}\n>  \tif ($reply_to) {\n> -- \n> 2.2.0-141-gd3f4719\n> \n"},{"id":"253079","messageId":"20141204192245.GA3386@charon.olymp","threadId":"36286","inReplyTo":"xmqqk328k6ya.fsf@gitster.dls.corp.google.com","subject":"Re: [RFC][PATCH] send-email: add --[no-]xmailer option","fromName":"Luis Henriques","fromEmail":"henrix@camandro.org","sentAt":"2014-12-04T19:22:45Z","receivedAt":"2014-12-04T19:22:45Z","isPatch":true,"sender":{"key":"henrix@camandro.org","avatar":"https://avatars.githubusercontent.com/u/73643340?v=4"},"body":"On Wed, Dec 03, 2014 at 08:56:45AM -0800, Junio C Hamano wrote:\n> Eric Wong <normalperson@yhbt.net> writes:\n> \n> > Luis Henriques <henrix@camandro.org> wrote:\n> >> On Mon, Mar 24, 2014 at 09:38:27PM +0000, Luis Henriques wrote:\n> >> > Add --[no-]xmailer that allows a user to disable adding the 'X-Mailer:'\n> >> > header to the email being sent.\n> >> >\n> >> \n> >> Ping\n> >> \n> >> It's been a while since I sent this patch.  Is there any interest in\n> >> having this switch in git-send-email?\n> >\n> > I wasn't paying attention when the original was sent, but this\n> > looks good to me.\n> >\n> > Acked-by: Eric Wong <normalperson@yhbt.net>\n> >\n> >> I honestly don't like disclosing too much information about my system,\n> >> in this case which MUA I'm using and its version.\n> >\n> > Right on.  I would even favor this being the default.\n> >\n> > Auto-generated Message-Id headers also shows the use of git-send-email;\n> > perhaps there can be a way to configure that, too.  However,\n> > git-send-email respects manually-added Message-Id headers in the\n> > original patch, so it's less of a problem, I suppose.\n> \n> I actually do not think this is a good idea from debuggability.\n\nDo you think this could be merged with yet another switch?  I can't\nthink of a name for the switch, something like... \"--hide-msgid\"?\n\nAnother option would be to re-work the --no-xmailer switch to change\nit into a \"--hide-id\" (or something), where both the \"X-Mailer:\"\nheader would be dropped and the Message-id would be obfuscated.\n\nCheers,\n-- \nLuís\n"},{"id":"253082","messageId":"xmqqd27ztdkr.fsf@gitster.dls.corp.google.com","threadId":"36286","inReplyTo":"20141204192245.GA3386@charon.olymp","subject":"Re: [RFC][PATCH] send-email: add --[no-]xmailer option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-12-04T19:33:24Z","receivedAt":"2014-12-04T19:33:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Luis Henriques <henrix@camandro.org> writes:\n\n> On Wed, Dec 03, 2014 at 08:56:45AM -0800, Junio C Hamano wrote:\n>\n>> I actually do not think this is a good idea from debuggability.\n>\n> Do you think this could be merged with yet another switch?  I can't\n> think of a name for the switch, something like... \"--hide-msgid\"?\n\nIn case it wasn't clear, by \"this\" I meant the removal of\n\"X-Mailer:\", iow, \"Adding --no-xmailer option is a bad idea from\ndebuggability's point of view\".\n\nNot adding message-id is not an option; MSAs are supposed to always\nadd one if they want to be RFC compliant, aren't they?\n"},{"id":"253085","messageId":"20141204194455.GB3386@charon.olymp","threadId":"36286","inReplyTo":"xmqqd27ztdkr.fsf@gitster.dls.corp.google.com","subject":"Re: [RFC][PATCH] send-email: add --[no-]xmailer option","fromName":"Luis Henriques","fromEmail":"henrix@camandro.org","sentAt":"2014-12-04T19:44:55Z","receivedAt":"2014-12-04T19:44:55Z","isPatch":true,"sender":{"key":"henrix@camandro.org","avatar":"https://avatars.githubusercontent.com/u/73643340?v=4"},"body":"On Thu, Dec 04, 2014 at 11:33:24AM -0800, Junio C Hamano wrote:\n> Luis Henriques <henrix@camandro.org> writes:\n> \n> > On Wed, Dec 03, 2014 at 08:56:45AM -0800, Junio C Hamano wrote:\n> >\n> >> I actually do not think this is a good idea from debuggability.\n> >\n> > Do you think this could be merged with yet another switch?  I can't\n> > think of a name for the switch, something like... \"--hide-msgid\"?\n> \n> In case it wasn't clear, by \"this\" I meant the removal of\n> \"X-Mailer:\", iow, \"Adding --no-xmailer option is a bad idea from\n> debuggability's point of view\".\n>\n\nOh, ok.  I thought you were talking about the message-id.\n\n> Not adding message-id is not an option; MSAs are supposed to always\n> add one if they want to be RFC compliant, aren't they?\n\nYes, of course -- having a message ID is a requirement.  But I was\nhoping you could accept a solution similar to the one suggested by\nKyle (adding him to Cc): he was suggesting hashing the message ID,\nwhich would be a good compromise, I believe.\n\nCheers,\n-- \nLuís\n"}]}