Skip to content

Commit a7b60f0

Browse files
committed
Merge branch 'po/sendemail'
* po/sendemail: New send-email option smtpserveroption. Remove @smtp_host_parts variable as not used. Minor indentation fix.
2 parents acbaf54 + 052fbea commit a7b60f0

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

Documentation/config.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,7 @@ sendemail.to::
17371737
sendemail.smtpdomain::
17381738
sendemail.smtpserver::
17391739
sendemail.smtpserverport::
1740+
sendemail.smtpserveroption::
17401741
sendemail.smtpuser::
17411742
sendemail.thread::
17421743
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: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ sub usage {
6161
--envelope-sender <str> * Email envelope sender.
6262
--smtp-server <str:int> * Outgoing SMTP server to use. The port
6363
is optional. Default 'localhost'.
64+
--smtp-server-option <str> * Outgoing SMTP server option to use.
6465
--smtp-server-port <int> * Outgoing SMTP server port.
6566
--smtp-user <str> * Username for SMTP-AUTH.
6667
--smtp-pass <str> * Password for SMTP-AUTH; not necessary.
@@ -191,8 +192,9 @@ sub do_edit {
191192

192193
# Variables with corresponding config settings
193194
my ($thread, $chain_reply_to, $suppress_from, $signed_off_by_cc, $cc_cmd);
194-
my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_encryption);
195-
my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts, $smtp_domain);
195+
my ($smtp_server, $smtp_server_port, @smtp_server_options);
196+
my ($smtp_authuser, $smtp_encryption);
197+
my ($identity, $aliasfiletype, @alias_files, $smtp_domain);
196198
my ($validate, $confirm);
197199
my (@suppress_cc);
198200
my ($auto_8bit_encoding);
@@ -213,9 +215,10 @@ sub do_edit {
213215
my %config_settings = (
214216
"smtpserver" => \$smtp_server,
215217
"smtpserverport" => \$smtp_server_port,
218+
"smtpserveroption" => \@smtp_server_options,
216219
"smtpuser" => \$smtp_authuser,
217220
"smtppass" => \$smtp_authpass,
218-
"smtpdomain" => \$smtp_domain,
221+
"smtpdomain" => \$smtp_domain,
219222
"to" => \@to,
220223
"cc" => \@initial_cc,
221224
"cccmd" => \$cc_cmd,
@@ -282,6 +285,7 @@ sub signal_handler {
282285
"no-bcc" => \$no_bcc,
283286
"chain-reply-to!" => \$chain_reply_to,
284287
"smtp-server=s" => \$smtp_server,
288+
"smtp-server-option=s" => \@smtp_server_options,
285289
"smtp-server-port=s" => \$smtp_server_port,
286290
"smtp-user=s" => \$smtp_authuser,
287291
"smtp-pass:s" => \$smtp_authpass,
@@ -1029,6 +1033,8 @@ sub send_message {
10291033
}
10301034
}
10311035

1036+
unshift (@sendmail_parameters, @smtp_server_options);
1037+
10321038
if ($dry_run) {
10331039
# We don't want to send the email.
10341040
} elsif ($smtp_server =~ m#^/#) {

0 commit comments

Comments
 (0)