From: Junio C Hamano <gitster@pobox.com>
To: "Csókás, Bence" <csokas.bence@prolan.hu>
Cc: <git@vger.kernel.org>
Subject: Re: [PATCH v4] git-send-email: Use sanitized address when reading mbox body
Date: Mon, 01 Jul 2024 11:47:34 -0700 [thread overview]
Message-ID: <xmqqy16lvtix.fsf@gitster.g> (raw)
In-Reply-To: <20240701090115.56957-1-csokas.bence@prolan.hu> ("Csókás, Bence"'s message of "Mon, 1 Jul 2024 11:01:16 +0200")
"Csókás, Bence" <csokas.bence@prolan.hu> writes:
> Addresses that are mentioned on the trailers in the commit log
> ('Signed-off-by: ' etc.) are added to @cc (unless suppressed),
> passed to the SMTP server. However, these hand-written
> addresses may be malformed (e.g. having unquoted commas and
> other punctuation marks in the display-name part).
>
> The code was already calling `sanitize_address()` for suppression
> purposes, so we just have to use the result ($sc) for adding to @cc.
There is a leap between the description of the status quo and your
conclusion. "we just have to" becomes valid only after explaining
that sanitize_address turns the address-looking string into valid
addresses (and we do not want to send to malformed addresses--but
that goes without saying).
> Also note that
> `sanitize_address()` does not process the mailbox addresses,
> so it is up to `sendmail` to handle special characters there
> (e.g. there are mailboxes in regular use with '+'-es in them).
I do not quote see the point of this final note. mailboxes with
'q'es in them are also in regular use, and singling out '+' does not
make much sense in the context of explaining this change.
> Changes in v4:
> * t9001: use ${SQ} instead of double quotes
> * re-worded message again
OK. The additional recipient address
> + Co-developed-by: "C. O. Developer" <codev@example.com>
to contrast with
> + Signed-off-by: A. U. Thor <thor.au@example.com>
is a nice touch. We make sure that, with or without necessary
quoting in the original, we produce the correct result ;-).
Let's mark it for 'next' soonish, with proposed log message
rewritten somewhat.
Thanks.
----- >8 -----
git-send-email: use sanitized address when reading mbox body
Addresses that are mentioned on the trailers in the commit log
messages (e.g., "Reviewed-by") are added to the "Cc:" list by "git
send-email". These hand-written addresses, however, may be
malformed (e.g., having unquoted "." and other punctutation marks in
the display-name part) and can upset MTA.
The code does use the sanitize_address() helper on these
address-looking strings to turn them into valid addresses, but it is
used only to see if the address should be suppressed. The original
string taken from the message is added to the @cc list if the code
decides the address is not suppressed.
Because the addresses on trailer lines are hand-written and more
likely to contain malformed addresses, when adding to the @cc list,
use the result from sanitize_address, not the original. Note that
we do not modify the behaviour for addresses taken from the e-mail
headers, as they are more likely to be machine generated and
well-formed.
Signed-off-by: Csókás, Bence <csokas.bence@prolan.hu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
next prev parent reply other threads:[~2024-07-01 18:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-01 9:01 [PATCH v4] git-send-email: Use sanitized address when reading mbox body Csókás, Bence
2024-07-01 18:47 ` Junio C Hamano [this message]
2024-07-03 6:24 ` Csókás Bence
2024-07-03 15:44 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqy16lvtix.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=csokas.bence@prolan.hu \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).