{"thread":{"id":"21765","subject":"[PATCH] send-email: automatic envelope sender","startedAt":"2009-11-26T19:04:29Z","lastAt":"2009-11-27T02:34:31Z","messageCount":2,"participants":["Felipe Contreras","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"128489","messageId":"1259262269-23937-1-git-send-email-felipe.contreras@gmail.com","threadId":"21765","inReplyTo":null,"subject":"[PATCH] send-email: automatic envelope sender","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2009-11-26T19:04:29Z","receivedAt":"2009-11-26T19:04:29Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"This adds the option to specify the envelope sender as \"auto\" which\nwould pick the 'from' address. This is good because now we can specify\nthe address only in one place (and change it easily).\n\nComments by Junio C Hamano.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Documentation/git-send-email.txt |    7 ++++---\n git-send-email.perl              |    6 +++++-\n 2 files changed, 9 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex c85d7f4..8c482f4 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -108,9 +108,10 @@ Sending\n --envelope-sender=<address>::\n \tSpecify the envelope sender used to send the emails.\n \tThis is useful if your default address is not the address that is\n-\tsubscribed to a list. If you use the sendmail binary, you must have\n-\tsuitable privileges for the -f parameter. Default is the value of\n-\tthe 'sendemail.envelopesender' configuration variable; if that is\n+\tsubscribed to a list. In order to use the 'From' address, set the\n+\tvalue to \"auto\". If you use the sendmail binary, you must have\n+\tsuitable privileges for the -f parameter.  Default is the value of the\n+\t'sendemail.envelopesender' configuration variable; if that is\n \tunspecified, choosing the envelope sender is left to your MTA.\n \n --smtp-encryption=<encryption>::\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 4f5da4e..da2e56e 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -862,7 +862,11 @@ X-Mailer: git-send-email $gitversion\n \n \tmy @sendmail_parameters = ('-i', @recipients);\n \tmy $raw_from = $sanitized_sender;\n-\t$raw_from = $envelope_sender if (defined $envelope_sender);\n+\tif (defined $envelope_sender) {\n+\t\tif (not $envelope_sender eq \"auto\") {\n+\t\t\t$raw_from = $envelope_sender;\n+\t\t}\n+\t}\n \t$raw_from = extract_valid_address($raw_from);\n \tunshift (@sendmail_parameters,\n \t\t\t'-f', $raw_from) if(defined $envelope_sender);\n-- \n1.6.6.rc0.61.geeb75\n"},{"id":"128520","messageId":"7vfx80zoeg.fsf@alter.siamese.dyndns.org","threadId":"21765","inReplyTo":"1259262269-23937-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH] send-email: automatic envelope sender","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-27T02:34:31Z","receivedAt":"2009-11-27T02:34:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 4f5da4e..da2e56e 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -862,7 +862,11 @@ X-Mailer: git-send-email $gitversion\n>  \n>  \tmy @sendmail_parameters = ('-i', @recipients);\n>  \tmy $raw_from = $sanitized_sender;\n> -\t$raw_from = $envelope_sender if (defined $envelope_sender);\n> +\tif (defined $envelope_sender) {\n> +\t\tif (not $envelope_sender eq \"auto\") {\n> +\t\t\t$raw_from = $envelope_sender;\n> +\t\t}\n> +\t}\n\nThanks.\n\nI'd rewrite this to \n\n\tif (defined $envelope_sender && $envelope_sender ne \"auto\") {\n        \t...\n\t}\n\nbut otherwise the patch looks quite straightforward.\n\nTests?\n"}]}