git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Douglas Stockwell <douglas.stockwell@gmail.com>
Cc: git@vger.kernel.org, Douglas Stockwell <doug@11011.net>
Subject: Re: [PATCH] send-email: Add support for SSL and SMTP-AUTH
Date: Sun, 02 Sep 2007 00:55:39 -0700	[thread overview]
Message-ID: <7vveatpklg.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <11887028854022-git-send-email-doug@11011.net> (Douglas Stockwell's message of "Sun, 2 Sep 2007 12:14:45 +0900")

Thanks for the patch.  I think SMTP-AUTH is a worthy addition.

I however have a bit of reservation about making the password
itself a configuration variable.  I understand this is good
enough for the simplest case that you have only single e-mail
identity and mailserver to talk to.

By defining the two "default" variables, you are encouraging
users who want to use different identity per project to define
the smtpauthuser and smtpauthpass variables in .git/config of
each repository.  I see two issues with this.

 (1) Suppose I interact with under one mail identity with
     projects A and B and under another mail identity with
     project C and D.  I need to have duplicate variable
     settings in .git/config of A and B for one and another
     duplicated sets in C and D.

 (2) Although the recommended BCP is not to allow other people
     to interact with your private working repository (iow, you
     keep a separate "bare" repository you use solely for
     publishing, you push from your private working repository
     to that publishing repository, and have others look at only
     the publishing repository), people often do not follow this
     BCP and expose their private working repository to their
     colleages for fetching (or even pushing).  We currently do
     not allow reading remote repository's configuration over
     the git protocol, but there were some cases in the past
     that the ability to do so might lead to their solutions
     discussed on the list.  We might not keep .git/config in
     the repository that is accessed by fetch clients private in
     the future.

So it might be better to split the configuration variables in this
way:

 (1) in ~/.gitconfig (that is hopefully readable only by the
     user):

	[sendemail "default"]
        	server = mail.isp.com
                user = junkio
                pass = junkio-password-for-mail-isp-com

	[sendemail "git"]
        	server = mail.git.xz
                user = gitster
                pass = gitster-password-for-mail-git.xz

     This defines two "mail identities" I could use, depending
     on which project's repository I run send-email.

 (2) in project/.git/config:

	[sendemail]
        	identity = git

     This defines which "mail identity" I want to use for this
     particular project.

This way, you can maintain more than one identity by having
multiple [sendemail "$identity"] sections in ~/.gitconfig, and
avoid having to expose and duplicate user/pass in various
project's .git/config.

The look-up rules by send-email program would be:

 * if anything is given explicitly from the command line, use
   that; otherwise

 * if sendemail.identity does not exist, pretend
   "sendemail.identity = default" was given (let's call that
   identity nickname $identity in the following);

   * if sendemail.$identity.server.exists, use that as the smtp
     server to contact; otherwise sendemail.smtpserver is used;

   * for user/pass information, use sendemail.$identity.user and
     sendemail.$identity.pass.

Hmm?

  reply	other threads:[~2007-09-02  7:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-02  3:14 [PATCH] send-email: Add support for SSL and SMTP-AUTH Douglas Stockwell
2007-09-02  7:55 ` Junio C Hamano [this message]
2007-09-02  9:43   ` Wincent Colaiuta
2007-09-02 11:06   ` David Symonds
2007-09-02 12:32   ` Johannes Schindelin
  -- strict thread matches above, loose matches on Subject: below --
2007-09-02 18:06 Douglas Stockwell
2007-09-03  6:48 ` Wincent Colaiuta
2007-09-03  7:58 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vveatpklg.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=doug@11011.net \
    --cc=douglas.stockwell@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).