summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c38f024)
raw | patch | inline | side by side (parent: c38f024)
author | Robin H. Johnson <robbat2@gentoo.org> | |
Thu, 26 Apr 2007 02:37:21 +0000 (19:37 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 26 Apr 2007 04:12:16 +0000 (21:12 -0700) |
Always pass in clean addresses to Net::SMTP for the MAIL FROM, and use them on
the SMTP non-quiet output as well.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
the SMTP non-quiet output as well.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-send-email.perl | patch | blob | history |
diff --git a/git-send-email.perl b/git-send-email.perl
index b6022929042e0b03f395c553e93c6f47a35c6990..35c4722a15baca61b78d04fd74a446ff63200819 100755 (executable)
--- a/git-send-email.perl
+++ b/git-send-email.perl
}
my @sendmail_parameters = ('-i', @recipients);
+ my $raw_from = extract_valid_address($from);
if ($dry_run) {
# We don't want to send the email.
} else {
require Net::SMTP;
$smtp ||= Net::SMTP->new( $smtp_server );
- $smtp->mail( $from ) or die $smtp->message;
+ $smtp->mail( $raw_from ) or die $smtp->message;
$smtp->to( @recipients ) or die $smtp->message;
$smtp->data or die $smtp->message;
$smtp->datasend("$header\n$message") or die $smtp->message;
printf (($dry_run ? "Dry-" : "")."Sent %s\n", $subject);
} else {
print (($dry_run ? "Dry-" : "")."OK. Log says:\nDate: $date\n");
- if ($smtp) {
+ if ($smtp_server !~ m#^/#) {
print "Server: $smtp_server\n";
- print "MAIL FROM: $from\n";
- print "RCPT TO: ".join(',',@recipients)."\n";
+ print "MAIL FROM:<$raw_from>\n";
+ print "RCPT TO:".join(',',(map { "<$_>" } @recipients))."\n";
} else {
print "Sendmail: $smtp_server ".join(' ',@sendmail_parameters)."\n";
}