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

Re: [PATCH] send-email: Don't leak To: headers between patches

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Oct 4, 2010, 07:15 UTC
Message-ID
<AANLkTimuP8Myj-PAU76hjtWdOkbzg2WrZwaFNOxRqfsM@mail.gmail.com>
In-Reply-To
<1286175924-15761-1-git-send-email-bebarino@gmail.com>
On Mon, Oct 4, 2010 at 07:05, Stephen Boyd <bebarino@gmail.com> wrote:
Show 8 quoted lines
> If the first patch in a series has a To: header in the file and the
> second patch in the series doesn't the address from the first patch will
> be part of the To: addresses in the second patch. Fix this by treating the
> to list like the cc list. Have an initial to list come from the command
> line, user input and config options. Then build up a to list from each
> patch and concatenate the two together before sending the patch. Finally,
> reset the list after sending each patch so the To: headers from a patch
> don't get used for the next one.
Couldn't this whole thing be done by:
>  # Variables we fill in automatically, or via prompting:
> -my (@to,$no_to,@cc,$no_cc,@initial_cc,@bcclist,$no_bcc,@xh,
> +my (@to,$no_to,@initial_to,@cc,$no_cc,@initial_cc,@bcclist,$no_bcc,@xh,
Changing this to an "our" variable instead of a "my".
>        my $body_encoding;
> +       @to = ();
Then doing:
    local @to = @to;
> +       @to = (@initial_to, @to);
>        @cc = (@initial_cc, @cc);

And keeping this as it is, and should the @cc addresses by accumulated across patches, but not the @to addresses?

Show 15 quoted lines
> +test_expect_success $PREREQ 'To headers from files reset each patch' '
> +       patch1=`git format-patch -1 --to="bodies@example.com"` &&
> +       patch2=`git format-patch -1 --to="other@example.com" HEAD~` &&
> +       test_when_finished "rm $patch1 && rm $patch2" &&
> +       git send-email \
> +               --dry-run \
> +               --from="Example <nobody@example.com>" \
> +               --to="nobody@example.com" \
> +               --smtp-server relay.example.com \
> +               $patch1 $patch2 >stdout &&
> +       test $(grep -c "RCPT TO:<bodies@example.com>" stdout) = 1 &&
> +       test $(grep -c "RCPT TO:<nobody@example.com>" stdout) = 2 &&
> +       test $(grep -c "RCPT TO:<other@example.com>" stdout) = 1
> +'
> +
Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 4 of 9 in “send-email: Clear To: field for every mail”
  1. send-email: Clear To: field for every mailViresh KUMAR, Oct 4, 2010
  2. send-email: Don't leak To: headers between patchesStephen Boyd, Oct 4, 2010
  3. Junio C HamanoOct 4, 2010
  4. Ævar Arnfjörð BjarmasonOct 4, 2010
  5. Ævar Arnfjörð BjarmasonOct 4, 2010
  6. Junio C HamanoOct 4, 2010
  7. Joe PerchesOct 4, 2010
  8. Junio C HamanoOct 4, 2010
  9. viresh kumarOct 4, 2010

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.