Skip to contentSkip to conversation

send-email: Honour SMTP domain when using TLS

PATCH In review Matthew Daley 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 send-email: Honour SMTP domain when using TLS

git-send-email sends two SMTP EHLOs when using TLS encryption, however only the first, unencrypted EHLO uses the SMTP domain that can be optionally specified by the user (--smtp-domain). This is because the call to hello() that produces the second, encrypted EHLO does not pass the SMTP domain as an argument, and hence a default of 'localhost.localdomain' is used instead.

Fix by passing in the SMTP domain in this call.

---
 git-send-email.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
git-send-email.perl +1 -1
index 6885dfa..d491db9 100755
@@ -1098,7 +1098,7 @@ X-Mailer: git-send-email $gitversion
 					$smtp_encryption = '';
 					# Send EHLO again to receive fresh
 					# supported commands
-					$smtp->hello();
+					$smtp->hello($smtp_domain);
 				} else {
 					die "Server does not support STARTTLS! ".$smtp->message;
 				}
Signature · 1 line
1.7.2.5
#1 lore raw
Quoted 10 lines · Matthew Daley

git-send-email sends two SMTP EHLOs when using TLS encryption, however only the first, unencrypted EHLO uses the SMTP domain that can be optionally specified by the user (--smtp-domain). This is because the call to hello() that produces the second, encrypted EHLO does not pass the SMTP domain as an argument, and hence a default of 'localhost.localdomain' is used instead.

Fix by passing in the SMTP domain in this call.

Sounds sensible, thanks.

Brian, who did 69cf7bf (send-email: Cleanup smtp-domain and add config, 2010-04-10) to make the initial hello use $smtp_domain, could you take a quick look and an Ack?

Quoted 16 lines
 git-send-email.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
git-send-email.perl +1 -1
index 6885dfa..d491db9 100755
@@ -1098,7 +1098,7 @@ X-Mailer: git-send-email $gitversion
 					$smtp_encryption = '';
 					# Send EHLO again to receive fresh
 					# supported commands
-					$smtp->hello();
+					$smtp->hello($smtp_domain);
 				} else {
 					die "Server does not support STARTTLS! ".$smtp->message;
 				}
#2 lore raw
Quoted 11 lines · Junio C Hamano
Quoted 9 lines · Matthew Daley

git-send-email sends two SMTP EHLOs when using TLS encryption, however only the first, unencrypted EHLO uses the SMTP domain that can be optionally specified by the user (--smtp-domain). This is because the call to hello() that produces the second, encrypted EHLO does not pass the SMTP domain as an argument, and hence a default of 'localhost.localdomain' is used instead.

Fix by passing in the SMTP domain in this call.

Quoted 7 lines
Quoted 1 line

Sounds sensible, thanks.

Brian, who did 69cf7bf (send-email: Cleanup smtp-domain and add config, 2010-04-10) to make the initial hello use $smtp_domain, could you take a quick look and an Ack?

It does look sensible to me, but I wasn't the one who added all the HELO work. I mostly was mucking about with variable names and how they got set. Jari Aalto added them originally in 134550f.

~~ Brian