All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pascal Obry <pascal@obry.net>
To: git@vger.kernel.org
Cc: Pascal Obry <pascal@obry.net>
Subject: [PATCH 2/2] New send-email option smtpserveroptions.
Date: Sat,  4 Sep 2010 18:06:12 +0200	[thread overview]
Message-ID: <1283616372-3340-3-git-send-email-pascal@obry.net> (raw)
In-Reply-To: <1283616372-3340-1-git-send-email-pascal@obry.net>

The new command line parameter --smtp-server-options or default
configuration sendemail.smtpserveroptions can be used to pass
specific options to the SMTP server.
---
 Documentation/git-send-email.txt |    5 +++++
 git-send-email.perl              |    9 ++++++++-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index c283084..425b102 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -157,6 +157,11 @@ user is prompted for a password while the input is masked for privacy.
 	`/usr/lib/sendmail` if such program is available, or
 	`localhost` otherwise.
 
+--smtp-server-options=<options>::
+	If set, specifies the outgoing SMTP server options to use.
+	Default value can be specified by the 'sendemail.smtpserveroptions'
+	configuration option.
+
 --smtp-server-port=<port>::
 	Specifies a port different from the default port (SMTP
 	servers typically listen to smtp port 25, but may also listen to
diff --git a/git-send-email.perl b/git-send-email.perl
index 0063606..e5cdda7 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -60,6 +60,7 @@ git send-email [options] <file | directory | rev-list options >
     --envelope-sender       <str>  * Email envelope sender.
     --smtp-server       <str:int>  * Outgoing SMTP server to use. The port
                                      is optional. Default 'localhost'.
+    --smtp-server-options   <int>  * Outgoing SMTP server options to use.
     --smtp-server-port      <int>  * Outgoing SMTP server port.
     --smtp-user             <str>  * Username for SMTP-AUTH.
     --smtp-pass             <str>  * Password for SMTP-AUTH; not necessary.
@@ -188,7 +189,8 @@ 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 ($smtp_server, $smtp_server_port, $smtp_server_options);
+my ($smtp_authuser, $smtp_encryption);
 my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts, $smtp_domain);
 my ($validate, $confirm);
 my (@suppress_cc);
@@ -210,6 +212,7 @@ my %config_bool_settings = (
 my %config_settings = (
     "smtpserver" => \$smtp_server,
     "smtpserverport" => \$smtp_server_port,
+    "smtpserveroptions" => \$smtp_server_options,
     "smtpuser" => \$smtp_authuser,
     "smtppass" => \$smtp_authpass,
     "smtpdomain" => \$smtp_domain,
@@ -279,6 +282,7 @@ my $rc = GetOptions("sender|from=s" => \$sender,
 		    "no-bcc" => \$no_bcc,
 		    "chain-reply-to!" => \$chain_reply_to,
 		    "smtp-server=s" => \$smtp_server,
+		    "smtp-server-options=s" => \$smtp_server_options,
 		    "smtp-server-port=s" => \$smtp_server_port,
 		    "smtp-user=s" => \$smtp_authuser,
 		    "smtp-pass:s" => \$smtp_authpass,
@@ -1015,6 +1019,9 @@ X-Mailer: git-send-email $gitversion
 		}
 	}
 
+	unshift (@sendmail_parameters, $smtp_server_options)
+	    if (defined $smtp_server_options);
+
 	if ($dry_run) {
 		# We don't want to send the email.
 	} elsif ($smtp_server =~ m#^/#) {
-- 
1.7.2.2.277.gb49c4

  parent reply	other threads:[~2010-09-04 16:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-04 16:06 [PATCH 0/2] Add support for SMTP server options Pascal Obry
2010-09-04 16:06 ` [PATCH 1/2] Minor indentation fix Pascal Obry
2010-09-04 16:06 ` Pascal Obry [this message]
2010-09-04 16:21   ` [PATCH 2/2] New send-email option smtpserveroptions Junio C Hamano
2010-09-04 16:39     ` Pascal Obry
2010-09-04 17:57       ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1283616372-3340-3-git-send-email-pascal@obry.net \
    --to=pascal@obry.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.