git-send-email: Read the default SMTP server from the GIT config file

Make the default value for --smtp-server configurable through the
'sendemail.smtpserver' option in .git/config (or $HOME/.gitconfig).

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Acked-by: Ryan Anderson <rda@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Sergey Vlasov 2006-10-29 22:31:39 +03:00 committed by Junio C Hamano
parent 9c572b21dd
commit 6dcfa306f2
2 changed files with 8 additions and 3 deletions

View File

@ -68,9 +68,11 @@ The options available are:
--smtp-server:: --smtp-server::
If set, specifies the outgoing SMTP server to use. A full If set, specifies the outgoing SMTP server to use. A full
pathname of a sendmail-like program can be specified instead; pathname of a sendmail-like program can be specified instead;
the program must support the `-i` option. Defaults to the program must support the `-i` option. Default value can
`/usr/sbin/sendmail` or `/usr/lib/sendmail` if such program is be specified by the 'sendemail.smtpserver' configuration
available, or to `localhost` otherwise. option; the built-in default is `/usr/sbin/sendmail` or
`/usr/lib/sendmail` if such program is available, or
`localhost` otherwise.
--subject:: --subject::
Specify the initial subject of the email thread. Specify the initial subject of the email thread.

View File

@ -230,6 +230,9 @@ if (!defined $initial_reply_to && $prompting) {
$initial_reply_to =~ s/(^\s+|\s+$)//g; $initial_reply_to =~ s/(^\s+|\s+$)//g;
} }
if (!$smtp_server) {
$smtp_server = $repo->config('sendemail.smtpserver');
}
if (!$smtp_server) { if (!$smtp_server) {
foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) { foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {
if (-x $_) { if (-x $_) {