Re: [StGIT PATCH 1/4] Allow e-mails to be sent with the Unix sendmail tool
- From
Karl Hasselström <kha@treskal.com>
- Date
- Jun 22, 2008, 15:10 UTC
- Message-ID
- <20080622151026.GA4468@diana.vm.bytemark.co.uk>
- In-Reply-To
- <20080619214201.27794.18891.stgit@localhost.localdomain>
On 2008-06-19 22:42:01 +0100, Catalin Marinas wrote:
> If the stgit.smtpserver configuration option does not have a > host:port format, it is assumed to be an external tool. For example, > to use sendmail just set this variable to "/usr/sbin/sendmail -t -i" > (see the examples/gitconfig file).
Some comments below, but it looks good.
Show 5 quoted lines
> +def __send_message_sendmail(sendmail, msg): > + """Send the message using the sendmail command. > + """ > + cmd = sendmail.split() > + Run(*cmd).raw_input(msg).discard_output()
You could've written this without the "cmd" variable, but I understand why you didn't. The * operator (or whatever it is) isn't pretty. I sort of regret not making Run take a list argument instead, frankly.
Show 5 quoted lines
> class GitConfig:
> __defaults={
> 'stgit.autoresolved': 'no',
> - 'stgit.smtpserver': 'localhost:25',
> + 'stgit.smtpserver': '/usr/sbin/sendmail -t -i',Hmm. I think it's actually more common to have a misconfigured (or insufficiently configured) sendmail program than a misconfigured mail daemon listening to port 25, so I'd argue that the default shouldn't be changed. But it's not that important.
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle