Skip to content

Commit

Permalink
Merge branch 'po/sendemail'
Browse files Browse the repository at this point in the history
* po/sendemail:
  New send-email option smtpserveroption.
  Remove @smtp_host_parts variable as not used.
  Minor indentation fix.
  • Loading branch information
Junio C Hamano committed Oct 27, 2010
2 parents acbaf54 + 052fbea commit a7b60f0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions Documentation/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1737,6 +1737,7 @@ sendemail.to::
sendemail.smtpdomain::
sendemail.smtpserver::
sendemail.smtpserverport::
sendemail.smtpserveroption::
sendemail.smtpuser::
sendemail.thread::
sendemail.validate::
Expand Down
9 changes: 9 additions & 0 deletions Documentation/git-send-email.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,15 @@ user is prompted for a password while the input is masked for privacy.
are also accepted. The port can also be set with the
'sendemail.smtpserverport' configuration variable.

--smtp-server-option=<option>::
If set, specifies the outgoing SMTP server option to use.
Default value can be specified by the 'sendemail.smtpserveroption'
configuration option.
+
The --smtp-server-option option must be repeated for each option you want
to pass to the server. Likewise, different lines in the configuration files
must be used for each option.

--smtp-ssl::
Legacy alias for '--smtp-encryption ssl'.

Expand Down
12 changes: 9 additions & 3 deletions git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ sub usage {
--envelope-sender <str> * Email envelope sender.
--smtp-server <str:int> * Outgoing SMTP server to use. The port
is optional. Default 'localhost'.
--smtp-server-option <str> * Outgoing SMTP server option 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.
Expand Down Expand Up @@ -191,8 +192,9 @@ 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, $smtp_domain);
my ($smtp_server, $smtp_server_port, @smtp_server_options);
my ($smtp_authuser, $smtp_encryption);
my ($identity, $aliasfiletype, @alias_files, $smtp_domain);
my ($validate, $confirm);
my (@suppress_cc);
my ($auto_8bit_encoding);
Expand All @@ -213,9 +215,10 @@ sub do_edit {
my %config_settings = (
"smtpserver" => \$smtp_server,
"smtpserverport" => \$smtp_server_port,
"smtpserveroption" => \@smtp_server_options,
"smtpuser" => \$smtp_authuser,
"smtppass" => \$smtp_authpass,
"smtpdomain" => \$smtp_domain,
"smtpdomain" => \$smtp_domain,
"to" => \@to,
"cc" => \@initial_cc,
"cccmd" => \$cc_cmd,
Expand Down Expand Up @@ -282,6 +285,7 @@ sub signal_handler {
"no-bcc" => \$no_bcc,
"chain-reply-to!" => \$chain_reply_to,
"smtp-server=s" => \$smtp_server,
"smtp-server-option=s" => \@smtp_server_options,
"smtp-server-port=s" => \$smtp_server_port,
"smtp-user=s" => \$smtp_authuser,
"smtp-pass:s" => \$smtp_authpass,
Expand Down Expand Up @@ -1029,6 +1033,8 @@ sub send_message {
}
}

unshift (@sendmail_parameters, @smtp_server_options);

if ($dry_run) {
# We don't want to send the email.
} elsif ($smtp_server =~ m#^/#) {
Expand Down

0 comments on commit a7b60f0

Please sign in to comment.