threads / patch / 23388

patch, 3 partssend-email: Don't use FQDNs without a '.'

Subject: [PATCH 1/3] send-email: Don't use FQDNs without a '.'

## tl;dr

12 messages between Apr 9, 2010 and Apr 16, 2010. Diffs are folded; open one to read it.

replies: 11people: 4as markdown or json

Brian Gernhardt· Apr 9, 2010, 05:11 UTC · lore

[PATCH 0/3] send-email: --smtp-domain improvements

The first patch keeps send-email from using a bogus FQDN for my laptop. Oddly enough, my MTA doesn't mind "localhost.localdomain" but complains about "My-Computer".

The second adds documentation for --smtp-domain to the git-send-email man page. The only documentation for it was in the code and the usage message.

The last is just an enhancement, but I was honestly surprised that --smtp-domain didn't have a configuration.

Brian Gernhardt (3):
  send-email: Don't use FQDNs without a '.'
  Document send-email --smtp-domain
  send-email: Add sendemail.smtpdomain
 Documentation/git-send-email.txt |    7 +++++++
 git-send-email.perl              |   26 ++++++++++++++------------
 2 files changed, 21 insertions(+), 12 deletions(-)
Brian Gernhardt· Apr 9, 2010, 05:11 UTC · re: Brian Gernhardt · lore

Although Net::Domain::domainname attempts to be very thorough, the host's configuration can still refuse to give a FQDN. Check to see if what we receive contains a dot as a basic sanity check.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
---
 My OS X machine doesn't add ".local" to it's hostname for some reason.
 Since a FQDN requires at least one . between the TLD and hostname,
 we can check for it to avoid nonsense results like "My-Computer".
 git-send-email.perl |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
Show changes to git-send-email.perl +4 −2
diff --git a/git-send-email.perl b/git-send-email.perl
index ce569a9..85fe374 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -870,7 +870,8 @@ sub maildomain_net
 	if (eval { require Net::Domain; 1 }) {
 		my $domain = Net::Domain::domainname();
 		$maildomain = $domain
-			unless $^O eq 'darwin' && $domain =~ /\.local$/;
+			unless $^O eq 'darwin' && $domain =~ /\.local$/
+				or $domain !~ /\./;
 	}
 
 	return $maildomain;
@@ -888,7 +889,8 @@ sub maildomain_mta
 				$smtp->quit;
 
 				$maildomain = $domain
-					unless $^O eq 'darwin' && $domain =~ /\.local$/;
+					unless $^O eq 'darwin' && $domain =~ /\.local$/
+						or $domain !~ /\./;
 
 				last if $maildomain;
 			}
-- 
1.7.1.rc0.210.ge6da
Junio C Hamano· Apr 9, 2010, 05:36 UTC · re: Brian Gernhardt · lore

Re: [PATCH 1/3] send-email: Don't use FQDNs without a '.'

Brian Gernhardt <brian@gernhardtsoftware.com> writes:
>  		$maildomain = $domain
> -			unless $^O eq 'darwin' && $domain =~ /\.local$/;
> +			unless $^O eq 'darwin' && $domain =~ /\.local$/
> +				or $domain !~ /\./;

It would become *much* easier to read if we stop using the statement modifier, and write it in a more straightforward way:

	unless (($^O eq 'darwin' && $domain =~ /\.local$/)
        	|| $domain !~ /\./) {
                $maildomain = $domain;
	}

as the condition seems to have grown large enough to exceed "by the way don't do this under this narrow condition", which is what statement modifiers are designed to be used. Also mixing && and or that have different precedence taxes readers' brainpower unnecessarily.

I also think that this particular exception logic should probably be in a separate helper function that is called from the two places.

Jari, you are the last person who touched code around this area. What do you think?

Jari Aalto· Apr 13, 2010, 08:43 UTC · re: Junio C Hamano · lore

[PATCH] git-send-email.perl: Add sub maildomain_sanitize

Move duplicate maildomain checks to a single subroutine. Require that a FQDN contains at least one period.

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
---
 git-send-email.perl |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)
    Here is improved version.
    -- Jari
    >Re: [PATCH 1/3] send-email: Don't use FQDNs without a '.'
    >Junio C Hamano <gitster@pobox.com> writes:
    >> Brian Gernhardt <brian@gernhardtsoftware.com> writes:
    >
    >>  		$maildomain = $domain
    >> -			unless $^O eq 'darwin' && $domain =~ /\.local$/;
    >> +			unless $^O eq 'darwin' && $domain =~ /\.local$/
    >> +				or $domain !~ /\./;
    >
    > [Junio] It would become *much* easier to read if we stop using the statement
    > modifier, and write it in a more straightforward way:
    >
    > 	unless (($^O eq 'darwin' && $domain =~ /\.local$/)
    >         	|| $domain !~ /\./) {
    >                 $maildomain = $domain;
    > 	}
    >
    > as the condition seems to have grown large enough to exceed "by the way
    > don't do this under this narrow condition", which is what statement
    > modifiers are designed to be used.  Also mixing && and or that have
    > different precedence taxes readers' brainpower unnecessarily.
    >
    > I also think that this particular exception logic should probably be in a
    > separate helper function that is called from the two places.
    >
    > Jari, you are the last person who touched code around this area.  What do
    > you think?
Show changes to git-send-email.perl +17 −4
diff --git a/git-send-email.perl b/git-send-email.perl
index ce569a9..7a1c00f 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -863,14 +863,28 @@ sub sanitize_address
 # This maildomain*() code is based on ideas in Perl library Test::Reporter
 # /usr/share/perl5/Test/Reporter/Mail/Util.pm ==> sub _maildomain ()
 
+sub maildomain_sanitize
+{
+    local $_ = shift;
+
+    #	On Mac, the the domain name is not necessarily in FQDN format
+    #	Require a period in the string
+
+    if ( $^O eq 'darwin'  and  /\.local$/ ) {
+	# Nope, pass this one.
+    }
+    elsif ( /\./ ) {
+	$_;
+    }
+}
+
 sub maildomain_net
 {
 	my $maildomain;
 
 	if (eval { require Net::Domain; 1 }) {
 		my $domain = Net::Domain::domainname();
-		$maildomain = $domain
-			unless $^O eq 'darwin' && $domain =~ /\.local$/;
+		$maildomain = maildomain_sanitize($domain);
 	}
 
 	return $maildomain;
@@ -887,8 +901,7 @@ sub maildomain_mta
 				my $domain = $smtp->domain;
 				$smtp->quit;
 
-				$maildomain = $domain
-					unless $^O eq 'darwin' && $domain =~ /\.local$/;
+				$maildomain = maildomain_sanitize($domain);
 
 				last if $maildomain;
 			}
-- 
1.7.0
Jari Aalto· Apr 13, 2010, 11:35 UTC · re: Jari Aalto · lore

[PATCH] git-send-email.perl: add maildomain_sanitize()

Move duplicate maildomain checks to a single subroutine. Require that a FQDN contains at least one period.

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
---
 git-send-email.perl |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)
      Here is improved version 2 (use "tab" for indentation).
 
      -- Jari
 
      >Re: [PATCH 1/3] send-email: Don't use FQDNs without a '.'
      >Junio C Hamano <gitster@pobox.com> writes:
      >> Brian Gernhardt <brian@gernhardtsoftware.com> writes:
      >
      >>  		$maildomain = $domain
      >> -			unless $^O eq 'darwin' && $domain =~ /\.local$/;
      >> +			unless $^O eq 'darwin' && $domain =~ /\.local$/
      >> +				or $domain !~ /\./;
      >
      > [Junio] It would become *much* easier to read if we stop using the statement
      > modifier, and write it in a more straightforward way:
      >
      > 	unless (($^O eq 'darwin' && $domain =~ /\.local$/)
      >         	|| $domain !~ /\./) {
      >                 $maildomain = $domain;
      > 	}
      >
      > as the condition seems to have grown large enough to exceed "by the way
      > don't do this under this narrow condition", which is what statement
      > modifiers are designed to be used.  Also mixing && and or that have
      > different precedence taxes readers' brainpower unnecessarily.
      >
      > I also think that this particular exception logic should probably be in a
      > separate helper function that is called from the two places.
      >
      > Jari, you are the last person who touched code around this area.  What do
      > you think?
Show changes to git-send-email.perl +17 −4
diff --git a/git-send-email.perl b/git-send-email.perl
index ce569a9..0e8f18c 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -863,14 +863,28 @@ sub sanitize_address
 # This maildomain*() code is based on ideas in Perl library Test::Reporter
 # /usr/share/perl5/Test/Reporter/Mail/Util.pm ==> sub _maildomain ()
 
+sub maildomain_sanitize
+{
+	local $_ = shift;
+
+	#  On Mac, the the domain name is not necessarily in FQDN format
+	#  Require a period in the string
+
+	if ( $^O eq 'darwin'  and  /\.local$/ ) {
+		# Nope, pass this one.
+	}
+	elsif ( /\./ ) {
+		$_;
+	}
+}
+
 sub maildomain_net
 {
 	my $maildomain;
 
 	if (eval { require Net::Domain; 1 }) {
 		my $domain = Net::Domain::domainname();
-		$maildomain = $domain
-			unless $^O eq 'darwin' && $domain =~ /\.local$/;
+		$maildomain = maildomain_sanitize($domain);
 	}
 
 	return $maildomain;
@@ -887,8 +901,7 @@ sub maildomain_mta
 				my $domain = $smtp->domain;
 				$smtp->quit;
 
-				$maildomain = $domain
-					unless $^O eq 'darwin' && $domain =~ /\.local$/;
+				$maildomain = maildomain_sanitize($domain);
 
 				last if $maildomain;
 			}
-- 
1.7.0
Jakub Narebski· Apr 15, 2010, 12:47 UTC · re: Jari Aalto · lore

Re: [PATCH] git-send-email.perl: add maildomain_sanitize()

Jari Aalto <jari.aalto@cante.net> writes:
Show 5 quoted lines
> Move duplicate maildomain checks to a single subroutine.
> Require that a FQDN contains at least one period.
> 
> Signed-off-by: Jari Aalto <jari.aalto@cante.net>
> ---
Good idea.
[...]
Show 22 quoted lines
> diff --git a/git-send-email.perl b/git-send-email.perl
> index ce569a9..0e8f18c 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -863,14 +863,28 @@ sub sanitize_address
>  # This maildomain*() code is based on ideas in Perl library Test::Reporter
>  # /usr/share/perl5/Test/Reporter/Mail/Util.pm ==> sub _maildomain ()
>  
> +sub maildomain_sanitize
> +{
> +	local $_ = shift;
> +
> +	#  On Mac, the the domain name is not necessarily in FQDN format
> +	#  Require a period in the string
> +
> +	if ( $^O eq 'darwin'  and  /\.local$/ ) {
> +		# Nope, pass this one.
> +	}
> +	elsif ( /\./ ) {
> +		$_;
> +	}
> +}
Style:
  +sub maildomain_sanitize {
  +	local $domain = shift;
  +
  +	#  On Mac, the the domain name is not necessarily in FQDN format
  +	#  Require a period in the string
  +
  +	if ($^O eq 'darwin'  &&  $domain =~ /\.local$/) {
  +		# Nope, pass this one.
  +	} elsif ($domain =~ /\./) {
  +		return $domain;
  +	}
  +}
(probably fixed in new version of this series).
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Jari Aalto· Apr 16, 2010, 15:49 UTC · re: Jakub Narebski · lore

[PATCH v2] git-send-email.perl: Add sub maildomain_sanitize

Move duplicate maildomain checks to a single subroutine. Require that a FQDN contains at least one period.

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
---
 git-send-email.perl |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)
    Jakub Narebski <jnareb@gmail.com> writes:
    >   +sub maildomain_sanitize {
    >   +	local $domain = shift;
    >   +
    >   +	#  On Mac, the the domain name is not necessarily in FQDN format
    >   +	#  Require a period in the string
    >   +
    >   +	if ($^O eq 'darwin'  &&  $domain =~ /\.local$/) {
    >   +		# Nope, pass this one.
    >   +	} elsif ($domain =~ /\./) {
    >   +		return $domain;
    >   +	}
    >   +}
    Thanks for 2nd eye. Changed these in above:
    * Starting brace placement at function start
    * Placement of else
    * Maybe: use or "return" (debatable).
    But not these. Motivation:
    * The "$_" simplifies ussage everywhere in the function. XP: less is more.
    * The "and" is more readable than "&&". The "and" is also safer
      due to its lower precedence.
    Jari
Show changes to git-send-email.perl +15 −4
diff --git a/git-send-email.perl b/git-send-email.perl
index ce569a9..d52a8c3 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -863,14 +863,26 @@ sub sanitize_address
 # This maildomain*() code is based on ideas in Perl library Test::Reporter
 # /usr/share/perl5/Test/Reporter/Mail/Util.pm ==> sub _maildomain ()
 
+sub maildomain_sanitize {
+	local $_ = shift;
+
+	#  On Mac, the the domain name is not necessarily in FQDN format.
+	#  Require a period in the string.
+
+	if ( $^O eq 'darwin'  and  /\.local$/ ) {
+		# Nope, pass this one.
+	} elsif ( /\./ ) {
+		return $_;
+	}
+}
+
 sub maildomain_net
 {
 	my $maildomain;
 
 	if (eval { require Net::Domain; 1 }) {
 		my $domain = Net::Domain::domainname();
-		$maildomain = $domain
-			unless $^O eq 'darwin' && $domain =~ /\.local$/;
+		$maildomain = maildomain_sanitize($domain);
 	}
 
 	return $maildomain;
@@ -887,8 +899,7 @@ sub maildomain_mta
 				my $domain = $smtp->domain;
 				$smtp->quit;
 
-				$maildomain = $domain
-					unless $^O eq 'darwin' && $domain =~ /\.local$/;
+				$maildomain = maildomain_sanitize($domain);
 
 				last if $maildomain;
 			}
-- 
1.7.0
Jakub Narebski· Apr 16, 2010, 16:11 UTC · re: Jari Aalto · lore

Re: [PATCH v2] git-send-email.perl: Add sub maildomain_sanitize

Jari Aalto wrote:
Show 25 quoted lines
>     Jakub Narebski <jnareb@gmail.com> writes:
>     >   +sub maildomain_sanitize {
>     >   +	local $domain = shift;
>     >   +
>     >   +	#  On Mac, the the domain name is not necessarily in FQDN format
>     >   +	#  Require a period in the string
>     >   +
>     >   +	if ($^O eq 'darwin'  &&  $domain =~ /\.local$/) {
>     >   +		# Nope, pass this one.
>     >   +	} elsif ($domain =~ /\./) {
>     >   +		return $domain;
>     >   +	}
>     >   +}
> 
>     Thanks for 2nd eye. Changed these in above:
> 
>     * Starting brace placement at function start
>     * Placement of else
>     * Maybe: use or "return" (debatable).
> 
>     But not these. Motivation:
> 
>     * The "$_" simplifies usage everywhere in the function. XP: less is more.
>     * The "and" is more readable than "&&". The "and" is also safer
>       due to its lower precedence.
O.K.

Note however that while setting $_ ($ARG with English) simplifies regexp matching, you have to take care to use

   local $_ = shift;
and not
   my $_ = shift; 
And to use 'local'.
A bit of "difficulty conservation" at work.
[...]
Show 12 quoted lines
> +sub maildomain_sanitize {
> +	local $_ = shift;
> +
> +	#  On Mac, the the domain name is not necessarily in FQDN format.
> +	#  Require a period in the string.
> +
> +	if ( $^O eq 'darwin'  and  /\.local$/ ) {
> +		# Nope, pass this one.
> +	} elsif ( /\./ ) {
> +		return $_;
> +	}
> +}
-- 
Jakub Narebski
Poland
Jari Aalto· Apr 16, 2010, 17:00 UTC · re: Jakub Narebski · lore

Re: Start encouraging English.pm (Was: [PATCH v2] git-send-email.perl: Add sub maildomain_sanitize)

Jakub Narebski <jnareb@gmail.com> writes:
Show 5 quoted lines
> O.K.
>
>
> Note however that while setting $_ ($ARG with English) simplifies regexp
> matching
Speaking of which...
Could we please move to using this everywhere:
    use English qw( -no_match_vars );

That would give all the benefits of readability without performance penalties. The load time seems to be neglible:

    $ perl --version | grep v5
    This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
    $ time perl -e 'print'
    real    0m0.005s
    user    0m0.000s
    sys     0m0.004s
    $ time perl -e 'use English qw( -no_match_vars ); print'
    real    0m0.017s
    user    0m0.008s
    sys     0m0.008s
> you have to take care to use
>
>> +sub maildomain_sanitize {
>> +	local $_ = shift;
Show 7 quoted lines
>    local $_ = shift;
>
> and not
>
>    my $_ = shift; 
>
> And to use 'local'.
As done.

The Perl 5.12 now finally allow my'ing of $ARG too. But maybe we don't switch to it just yet...

Jari
Brian Gernhardt· Apr 9, 2010, 05:11 UTC · re: Brian Gernhardt · lore

[PATCH 2/3] Document send-email --smtp-domain

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
---
 --smtp-debug is still undocumented.  It also appears to be a boolean that
 takes 0 or 1 instead of being of the form --[no-]smtp-debug.
 Documentation/git-send-email.txt |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
Show changes to Documentation/git-send-email.txt +6 −0
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index ced35b2..f171471 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -119,6 +119,12 @@ Sending
 	value reverts to plain SMTP.  Default is the value of
 	'sendemail.smtpencryption'.
 
+--smtp-domain=<FQDN>::
+	Specifies the Fully Qualified Domain Name (FQDN) used in the
+	HELO/EHLO command to the SMTP server.  Some servers require the
+	FQDN to match your IP address.  If not set, git send-email attempts
+	to determine your FQDN automatically.
+
 --smtp-pass[=<password>]::
 	Password for SMTP-AUTH. The argument is optional: If no
 	argument is specified, then the empty string is used as
-- 
1.7.1.rc0.210.ge6da
Brian Gernhardt· Apr 9, 2010, 05:11 UTC · re: Brian Gernhardt · lore

[PATCH 3/3] send-email: Add sendemail.smtpdomain

--smtp-domain is an option that if you need once, you probably will need again. To help with that, allow the user to set it in their .gitconfig

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
---
 Seemed like a natural thing to add.  Was surprised it wasn't there when I went
 poking around.
 Documentation/git-send-email.txt |    3 ++-
 git-send-email.perl              |   20 ++++++++++----------
 2 files changed, 12 insertions(+), 11 deletions(-)
Show changes to 2 files +12 −11

Documentation/git-send-email.txt, git-send-email.perl

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index f171471..288a4ec 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -123,7 +123,8 @@ Sending
 	Specifies the Fully Qualified Domain Name (FQDN) used in the
 	HELO/EHLO command to the SMTP server.  Some servers require the
 	FQDN to match your IP address.  If not set, git send-email attempts
-	to determine your FQDN automatically.
+	to determine your FQDN automatically.  Default is the value of
+	'sendemail.smtpdomain'.
 
 --smtp-pass[=<password>]::
 	Password for SMTP-AUTH. The argument is optional: If no
diff --git a/git-send-email.perl b/git-send-email.perl
index 85fe374..14b996e 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -132,8 +132,7 @@ my $have_email_valid = eval { require Email::Valid; 1 };
 my $have_mail_address = eval { require Mail::Address; 1 };
 my $smtp;
 my $auth;
-my $mail_domain_default = "localhost.localdomain";
-my $mail_domain;
+my $smtp_domain_default = "localhost.localdomain";
 
 sub unique_email_list(@);
 sub cleanup_compose_files();
@@ -190,7 +189,7 @@ sub do_edit {
 # Variables with corresponding config settings
 my ($thread, $chain_reply_to, $suppress_from, $signed_off_by_cc, $cc_cmd);
 my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_encryption);
-my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts);
+my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts, $smtp_domain);
 my ($validate, $confirm);
 my (@suppress_cc);
 
@@ -212,6 +211,7 @@ my %config_settings = (
     "smtpserverport" => \$smtp_server_port,
     "smtpuser" => \$smtp_authuser,
     "smtppass" => \$smtp_authpass,
+	"smtpdomain" => \$smtp_domain,
     "to" => \@to,
     "cc" => \@initial_cc,
     "cccmd" => \$cc_cmd,
@@ -283,7 +283,7 @@ my $rc = GetOptions("sender|from=s" => \$sender,
 		    "smtp-ssl" => sub { $smtp_encryption = 'ssl' },
 		    "smtp-encryption=s" => \$smtp_encryption,
 		    "smtp-debug:i" => \$debug_net_smtp,
-		    "smtp-domain:s" => \$mail_domain,
+		    "smtp-domain:s" => \$smtp_domain,
 		    "identity=s" => \$identity,
 		    "annotate" => \$annotate,
 		    "compose" => \$compose,
@@ -902,7 +902,7 @@ sub maildomain_mta
 
 sub maildomain
 {
-	return maildomain_net() || maildomain_mta() || $mail_domain_default;
+	return maildomain_net() || maildomain_mta() || $smtp_domain_default;
 }
 
 # Returns 1 if the message was sent, and 0 otherwise.
@@ -1007,18 +1007,18 @@ X-Mailer: git-send-email $gitversion
 		if ($smtp_encryption eq 'ssl') {
 			$smtp_server_port ||= 465; # ssmtp
 			require Net::SMTP::SSL;
-			$mail_domain ||= maildomain();
+			$smtp_domain ||= maildomain();
 			$smtp ||= Net::SMTP::SSL->new($smtp_server,
-						      Hello => $mail_domain,
+						      Hello => $smtp_domain,
 						      Port => $smtp_server_port);
 		}
 		else {
 			require Net::SMTP;
-			$mail_domain ||= maildomain();
+			$smtp_domain ||= maildomain();
 			$smtp ||= Net::SMTP->new((defined $smtp_server_port)
 						 ? "$smtp_server:$smtp_server_port"
 						 : $smtp_server,
-						 Hello => $mail_domain,
+						 Hello => $smtp_domain,
 						 Debug => $debug_net_smtp);
 			if ($smtp_encryption eq 'tls' && $smtp) {
 				require Net::SMTP::SSL;
@@ -1041,7 +1041,7 @@ X-Mailer: git-send-email $gitversion
 			die "Unable to initialize SMTP properly. Check config and use --smtp-debug. ",
 			    "VALUES: server=$smtp_server ",
 			    "encryption=$smtp_encryption ",
-			    "maildomain=$mail_domain",
+			    "maildomain=$smtp_domain",
 			    defined $smtp_server_port ? "port=$smtp_server_port" : "";
 		}
 
-- 
1.7.1.rc0.210.ge6da
Jakub Narebski· Apr 9, 2010, 06:56 UTC · re: Brian Gernhardt · lore

Re: [PATCH 3/3] send-email: Add sendemail.smtpdomain

Brian Gernhardt <brian@gernhardtsoftware.com> writes:
> --smtp-domain is an option that if you need once, you probably will
> need again.  To help with that, allow the user to set it in their
> .gitconfig
             via 'sendemail.smtpdomain' ?
Show 10 quoted lines
> 
> Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
> ---
> 
>  Seemed like a natural thing to add.  Was surprised it wasn't there when I went
>  poking around.
> 
>  Documentation/git-send-email.txt |    3 ++-
>  git-send-email.perl              |   20 ++++++++++----------
>  2 files changed, 12 insertions(+), 11 deletions(-)

You should also add one-liner to Documentation/config.txt, mentioning 'sendemail.smtpdomain' configuration variable (the part referring reader to git-send-email(1) documentation).

P.S. Some of git-send-email configuration variables: sendemail.identity, sendemail.smtpencryption, sendemail.smtpssl (deprecated), and the concept of sendemail.<identity>.* are described in Documentation/config.txt, which means that they are present in git-config(1) manpage. Some of them are described in "Configuration" section of Documentation/git-send-email.txt (which means git-send-email(1) manpage): sendemail.aliasesfile, sendemail.aliasfiletype, sendemail.multiedit, sendemail.confirm; I think those are config variables which do not have corresponding command line option. The rest: sendemail.bcc, sendemail.cc, sendemail.from, sendemail.to, sendemail.envelopesender, sendemail.smtpencryption (which is described in git-config(1)), sendemail.smtppass, sendemail.smtpserver, sendemail.smtpserverport, sendemail.smtpuser, sendemail.cccmd, sendemail.chainreplyto, sendemail.identity and 'sendemail.<identity>' subsection (described in git-config(1)), sendemail.signedoffbycc, sendemail.suppresscc, sendemail.suppressfrom, sendemail.thread, and sendemail.validate are described only with corresponding command-line option.

Huh...
-- 
Jakub Narebski
Poland
ShadeHawk on #git

← back to recent threads