Skip to content

Commit

Permalink
git-send-email: Read the default SMTP server from the GIT config file
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sergey Vlasov authored and Junio C Hamano committed Oct 29, 2006
1 parent 9c572b2 commit 6dcfa30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Documentation/git-send-email.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ The options available are:
--smtp-server::
If set, specifies the outgoing SMTP server to use. A full
pathname of a sendmail-like program can be specified instead;
the program must support the `-i` option. Defaults to
`/usr/sbin/sendmail` or `/usr/lib/sendmail` if such program is
available, or to `localhost` otherwise.
the program must support the `-i` option. Default value can
be specified by the 'sendemail.smtpserver' configuration
option; the built-in default is `/usr/sbin/sendmail` or
`/usr/lib/sendmail` if such program is available, or
`localhost` otherwise.

--subject::
Specify the initial subject of the email thread.
Expand Down
3 changes: 3 additions & 0 deletions git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ sub expand_aliases {
$initial_reply_to =~ s/(^\s+|\s+$)//g;
}

if (!$smtp_server) {
$smtp_server = $repo->config('sendemail.smtpserver');
}
if (!$smtp_server) {
foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {
if (-x $_) {
Expand Down

0 comments on commit 6dcfa30

Please sign in to comment.