Skip to content

Commit 052fbea

Browse files
TurboGitgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1d02a00 commit 052fbea

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

Documentation/config.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,6 +1717,7 @@ sendemail.to::
17171717
sendemail.smtpdomain::
17181718
sendemail.smtpserver::
17191719
sendemail.smtpserverport::
1720+
sendemail.smtpserveroption::
17201721
sendemail.smtpuser::
17211722
sendemail.thread::
17221723
sendemail.validate::

Documentation/git-send-email.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,15 @@ user is prompted for a password while the input is masked for privacy.
165165
are also accepted. The port can also be set with the
166166
'sendemail.smtpserverport' configuration variable.
167167

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+
168177
--smtp-ssl::
169178
Legacy alias for '--smtp-encryption ssl'.
170179

git-send-email.perl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ sub usage {
6060
--envelope-sender <str> * Email envelope sender.
6161
--smtp-server <str:int> * Outgoing SMTP server to use. The port
6262
is optional. Default 'localhost'.
63+
--smtp-server-option <str> * Outgoing SMTP server option to use.
6364
--smtp-server-port <int> * Outgoing SMTP server port.
6465
--smtp-user <str> * Username for SMTP-AUTH.
6566
--smtp-pass <str> * Password for SMTP-AUTH; not necessary.
@@ -188,7 +189,8 @@ sub do_edit {
188189

189190
# Variables with corresponding config settings
190191
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);
192194
my ($identity, $aliasfiletype, @alias_files, $smtp_domain);
193195
my ($validate, $confirm);
194196
my (@suppress_cc);
@@ -210,6 +212,7 @@ sub do_edit {
210212
my %config_settings = (
211213
"smtpserver" => \$smtp_server,
212214
"smtpserverport" => \$smtp_server_port,
215+
"smtpserveroption" => \@smtp_server_options,
213216
"smtpuser" => \$smtp_authuser,
214217
"smtppass" => \$smtp_authpass,
215218
"smtpdomain" => \$smtp_domain,
@@ -279,6 +282,7 @@ sub signal_handler {
279282
"no-bcc" => \$no_bcc,
280283
"chain-reply-to!" => \$chain_reply_to,
281284
"smtp-server=s" => \$smtp_server,
285+
"smtp-server-option=s" => \@smtp_server_options,
282286
"smtp-server-port=s" => \$smtp_server_port,
283287
"smtp-user=s" => \$smtp_authuser,
284288
"smtp-pass:s" => \$smtp_authpass,
@@ -1015,6 +1019,8 @@ sub send_message {
10151019
}
10161020
}
10171021

1022+
unshift (@sendmail_parameters, @smtp_server_options);
1023+
10181024
if ($dry_run) {
10191025
# We don't want to send the email.
10201026
} elsif ($smtp_server =~ m#^/#) {

0 commit comments

Comments
 (0)