@matheusbsbs / matheus-bagliano / commits / 052fbea26e
Fork 0

New send-email option smtpserveroption.

The new command line parameter --smtp-server-option or default configuration sendemail.smtpserveroption can be used to pass specific options to the SMTP server. Update the documentation accordingly. Signed-off-by: Pascal Obry <pascal@obry.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Pascal Obry committed Sep 6, 2010 at 20:12 UTC 052fbea26e51121d155ccaa3b0ae6ac892cc41ea
3 files changed +17 -1
Documentation/config.txt
+1
@@ -1717,6 +1717,7 @@ sendemail.to::
1717 sendemail.smtpdomain::
1718 sendemail.smtpserver::
1719 sendemail.smtpserverport::
1720 +sendemail.smtpserveroption::
1721 sendemail.smtpuser::
1722 sendemail.thread::
1723 sendemail.validate::
Documentation/git-send-email.txt
+9
@@ -165,6 +165,15 @@ user is prompted for a password while the input is masked for privacy.
165 are also accepted. The port can also be set with the
166 'sendemail.smtpserverport' configuration variable.
167
168 +--smtp-server-option=<option>::
169 + If set, specifies the outgoing SMTP server option to use.
170 + Default value can be specified by the 'sendemail.smtpserveroption'
171 + configuration option.
172 ++
173 +The --smtp-server-option option must be repeated for each option you want
174 +to pass to the server. Likewise, different lines in the configuration files
175 +must be used for each option.
176 +
177 --smtp-ssl::
178 Legacy alias for '--smtp-encryption ssl'.
179
git-send-email.perl
+7 -1
@@ -60,6 +60,7 @@ git send-email [options] <file | directory | rev-list options >
60 --envelope-sender <str> * Email envelope sender.
61 --smtp-server <str:int> * Outgoing SMTP server to use. The port
62 is optional. Default 'localhost'.
63 + --smtp-server-option <str> * Outgoing SMTP server option to use.
64 --smtp-server-port <int> * Outgoing SMTP server port.
65 --smtp-user <str> * Username for SMTP-AUTH.
66 --smtp-pass <str> * Password for SMTP-AUTH; not necessary.
@@ -188,7 +189,8 @@ sub do_edit {
189
190 # Variables with corresponding config settings
191 my ($thread, $chain_reply_to, $suppress_from, $signed_off_by_cc, $cc_cmd);
191 -my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_encryption);
192 +my ($smtp_server, $smtp_server_port, @smtp_server_options);
193 +my ($smtp_authuser, $smtp_encryption);
194 my ($identity, $aliasfiletype, @alias_files, $smtp_domain);
195 my ($validate, $confirm);
196 my (@suppress_cc);
@@ -210,6 +212,7 @@ my %config_bool_settings = (
212 my %config_settings = (
213 "smtpserver" => \$smtp_server,
214 "smtpserverport" => \$smtp_server_port,
215 + "smtpserveroption" => \@smtp_server_options,
216 "smtpuser" => \$smtp_authuser,
217 "smtppass" => \$smtp_authpass,
218 "smtpdomain" => \$smtp_domain,
@@ -279,6 +282,7 @@ my $rc = GetOptions("sender|from=s" => \$sender,
282 "no-bcc" => \$no_bcc,
283 "chain-reply-to!" => \$chain_reply_to,
284 "smtp-server=s" => \$smtp_server,
285 + "smtp-server-option=s" => \@smtp_server_options,
286 "smtp-server-port=s" => \$smtp_server_port,
287 "smtp-user=s" => \$smtp_authuser,
288 "smtp-pass:s" => \$smtp_authpass,
@@ -1015,6 +1019,8 @@ X-Mailer: git-send-email $gitversion
1019 }
1020 }
1021
1022 + unshift (@sendmail_parameters, @smtp_server_options);
1023 +
1024 if ($dry_run) {
1025 # We don't want to send the email.
1026 } elsif ($smtp_server =~ m#^/#) {