From: Eric Wong <normalperson@yhbt.net>
To: git <git@vger.kernel.org>, Junio C Hamano <junkio@cox.net>,
Martin Langhoff <martin.langhoff@gmail.com>,
Ryan Anderson <ryan@michonline.com>, Greg KH <greg@kroah.com>
Cc: Eric Wong <normalperson@yhbt.net>
Subject: [PATCH] send-email: quiet some warnings, reject invalid addresses
Date: Mon, 15 May 2006 02:41:01 -0700 [thread overview]
Message-ID: <11476860611181-git-send-email-normalperson@yhbt.net> (raw)
In-Reply-To: <7vlkt3x1qz.fsf@assigned-by-dhcp.cox.net>
I'm not sure why we never actually rejected invalid addresses in
the first place. We just seemed to be using our email validity
checkers to kill duplicates.
Now we just drop invalid email addresses completely and warn
the user about it.
Since we support local sendmail, we'll also accept username-only
addresses.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
git-send-email.perl | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
f069e9a9cee726d82dfeee1d477152a0fe0651c1
diff --git a/git-send-email.perl b/git-send-email.perl
index 0540e93..312a4ea 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -307,6 +307,10 @@ our ($message_id, $cc, %mail, $subject,
sub extract_valid_address {
my $address = shift;
+
+ # check for a local address:
+ return $address if ($address =~ /^([\w\-]+)$/);
+
if ($have_email_valid) {
return Email::Valid->address($address);
} else {
@@ -498,9 +502,14 @@ sub unique_email_list(@) {
my @emails;
foreach my $entry (@_) {
- my $clean = extract_valid_address($entry);
- next if $seen{$clean}++;
- push @emails, $entry;
+ if (my $clean = extract_valid_address($entry)) {
+ $seen{$clean} ||= 0;
+ next if $seen{$clean}++;
+ push @emails, $entry;
+ } else {
+ print STDERR "W: unable to extract a valid address",
+ " from: $entry\n";
+ }
}
return @emails;
}
--
1.3.2.g7d11
next prev parent reply other threads:[~2006-05-15 9:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-15 2:32 [PATCH] send-email: allow sendmail binary to be used instead of SMTP Eric Wong
2006-05-15 2:34 ` Eric Wong
2006-05-15 2:38 ` [PATCH] send-email: quiet some warnings Eric Wong
2006-05-15 6:04 ` Junio C Hamano
2006-05-15 9:41 ` Eric Wong [this message]
2006-05-15 5:52 ` [PATCH] send-email: allow sendmail binary to be used instead of SMTP Junio C Hamano
2006-05-15 9:27 ` Eric Wong
2006-05-15 9:34 ` Eric Wong
2006-05-15 9:47 ` Junio C Hamano
2006-05-15 10:11 ` Eric Wong
2006-05-15 10:37 ` Martin Langhoff
2006-05-15 16:25 ` Junio C Hamano
2006-05-15 19:10 ` Eric Wong
2006-05-15 21:01 ` Ryan Anderson
2006-05-15 21:13 ` Junio C Hamano
2006-05-15 21:52 ` Ryan Anderson
2006-05-15 22:07 ` Martin Langhoff
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=11476860611181-git-send-email-normalperson@yhbt.net \
--to=normalperson@yhbt.net \
--cc=git@vger.kernel.org \
--cc=greg@kroah.com \
--cc=junkio@cox.net \
--cc=martin.langhoff@gmail.com \
--cc=ryan@michonline.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.
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).