1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-05 15:16:34 +02:00

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>
This commit is contained in:
Wincent Colaiuta 2007-11-21 13:35:05 +01:00 committed by Junio C Hamano
parent 060009b419
commit 5f5b611805

View File

@ -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 @@ sub send_message
}
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;