aboutsummaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorWincent Colaiuta <win@wincent.com>2007-11-21 13:35:05 +0100
committerJunio C Hamano <gitster@pobox.com>2007-11-22 00:50:21 -0800
commit5f5b611805ed60a303ccbc07ebd9a5bac2dabb92 (patch)
tree4d3a9f6c2c6a67be5c3133be701dbccb7f272352 /git-send-email.perl
parent060009b4191c5dcdec858f5ec3d16cad012859df (diff)
downloadgit-5f5b611805ed60a303ccbc07ebd9a5bac2dabb92.tar.gz
git-5f5b611805ed60a303ccbc07ebd9a5bac2dabb92.tar.xz
Authenticate only once in git-send-email
When using git-send-email with SMTP authentication sending a patch series would redundantly authenticate multiple times, once for each patch. In the worst case, this would actually prevent the series from being sent because the server would reply with a "5.5.0 Already Authenticated" status code which would derail the process. This commit teaches git-send-email to authenticate once and only once at the beginning of the series. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 9c6fa6441..76baa8e43 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -145,6 +145,7 @@ sub format_2822_time {
my $have_email_valid = eval { require Email::Valid; 1 };
my $smtp;
+my $auth;
sub unique_email_list(@);
sub cleanup_compose_files();
@@ -635,7 +636,7 @@ X-Mailer: git-send-email $gitversion
}
if ((defined $smtp_authuser) && (defined $smtp_authpass)) {
- $smtp->auth( $smtp_authuser, $smtp_authpass ) or die $smtp->message;
+ $auth ||= $smtp->auth( $smtp_authuser, $smtp_authpass ) or die $smtp->message;
}
$smtp->mail( $raw_from ) or die $smtp->message;
$smtp->to( @recipients ) or die $smtp->message;