git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Stewart Smith <trawets@amazon.com>,
	git@vger.kernel.org, Todd Zullinger <tmz@pobox.com>
Subject: Re: [PATCH] git-send-email: Add --no-validate-email option
Date: Wed, 22 Jun 2022 00:48:40 +0000	[thread overview]
Message-ID: <YrJm6KactXg4elvD@tapette.crustytoothpaste.net> (raw)
In-Reply-To: <220622.864k0dmzl9.gmgdl@evledraar.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2852 bytes --]

On 2022-06-21 at 22:12:24, Ævar Arnfjörð Bjarmason wrote:
> 
> On Tue, Jun 21 2022, brian m. carlson wrote:
> 
> > Email::Valid is in fact correct.  However, the email which you want to
> > use doesn't conform to the RFC and isn't valid.  So this should probably
> > say something like, "Allow people to use an email address which is not
> > valid according to the RFCs if the server accepts it."
> 
> That's fair, but that rationale is quite disconnected from how the code
> works now. You happen to get that check if you have Email::Valid
> installed, otherwise not.
> 
> So if it's a use-case we care about we should make it a hard dependency.

Git has traditionally tried to avoid having lots of hard dependencies on
Perl modules.  For example, Perl modules are a hassle with Homebrew.

Most packagers prefer to enable the full suite of Perl modules, but it
is a bit nicer to not make it mandatory.  However, if you feel strongly,
we can change that.

> > I think this patch would be fine as it stands with those changes. Unlike
> > Ævar, I don't think we should get rid of Email::Valid, just like I don't
> > think we should get rid of the transfer encoding checks.  I support
> > warning people before sending invalid emails, especially since I believe
> > the address in question would not be deliverable through some mail
> > servers (such as mine).
> 
> Would this be addressed by instead opening a connection to the server,
> and seeing if it is willing to accept these addresess on a "RCPT TO"
> line?

No, because that tells you whether your smarthost will accept it.  There
are often multiple different parties involved in SMTP (including various
filtering programs, smarthosts, and relays) and all you'll know is
whether the first one of them accepts it.  I have seen systems where
there could well be four or five stages of processing an email before
it even left the host.

This is no different than with things like lines longer than 998 octets,
SMTPUTF8, or various other SMTP protocol issues.  The only surefire way
to know that your email will be accepted by the remote system is to
speak the protocol properly.  If people want an option to break the
protocol, that's fine, but we should try to avoid doing that by default.

The benefit to using Email::Valid in most cases is it prevents lots of
obvious mistakes, where the email address is clearly syntactically
invalid and undeliverable, especially due to bad author and committer
metadata.  The Linux kernel history shows that this is not uncommon and
it's useful to avoid this problem so you don't have to blow up people's
inboxes with a v2 right away just because you got an invalid address on
v1.  (Says the guy who has had to do almost exactly this.)
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  reply	other threads:[~2022-06-22  0:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20  0:44 [PATCH] git-send-email: Add --no-validate-email option Stewart Smith
2022-06-20  8:28 ` Ævar Arnfjörð Bjarmason
2022-06-21  0:11 ` brian m. carlson
2022-06-21 16:00   ` Junio C Hamano
2022-06-21 22:12   ` Ævar Arnfjörð Bjarmason
2022-06-22  0:48     ` brian m. carlson [this message]
2022-06-30 11:18       ` Ævar Arnfjörð Bjarmason
2022-06-30 21:03         ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YrJm6KactXg4elvD@tapette.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=tmz@pobox.com \
    --cc=trawets@amazon.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).