git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [StGIT PATCH] Allow e-mails to be sent with the Unix sendmail tool

From
Karl Hasselström <kha@treskal.com>
Date
Jun 14, 2008, 09:05 UTC
Message-ID
<20080614090504.GB14282@diana.vm.bytemark.co.uk>
In-Reply-To
<20080614072824.7899.42222.stgit@localhost.localdomain>
On 2008-06-14 08:28:24 +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).

Looks good, except that the new feature (and the fact that it's magically triggered if the smtpserver starts with a /) is not documented. Maybe add something like this to the patch:

diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py
index 4027170..2b1b92c 100644
--- a/stgit/commands/mail.py
+++ b/stgit/commands/mail.py
@@ -31,10 +31,13 @@ usage = r"""%prog [options] [<patch1>] [<patch2>] [<patch3>..<patch4>]
 
 Send a patch or a range of patches by e-mail using the SMTP server
 specified by the 'stgit.smtpserver' configuration option, or the
-'--smtp-server' command line option. The From address and the e-mail
-format are generated from the template file passed as argument to
-'--template' (defaulting to '.git/patchmail.tmpl' or
-'~/.stgit/templates/patchmail.tmpl' or
+'--smtp-server' command line option. (You may give the absolute path
+to sendmail instead, followed by any sendmail options you wish to
+use.)
+
+The From address and the e-mail format are generated from the template
+file passed as argument to '--template' (defaulting to
+'.git/patchmail.tmpl' or '~/.stgit/templates/patchmail.tmpl' or
 '/usr/share/stgit/templates/patchmail.tmpl'). A patch can be sent as
 attachment using the --attach option in which case the 'mailattch.tmpl'
 template will be used instead of 'patchmail.tmpl'.
@@ -133,8 +136,10 @@ options = [make_option('-a', '--all',
                        help = 'sleep for SECONDS between e-mails sending'),
            make_option('--refid',
                        help = 'use REFID as the reference id'),
-           make_option('--smtp-server', metavar = 'HOST[:PORT]',
-                       help = 'SMTP server to use for sending mail'),
+           make_option('--smtp-server',
+                       metavar = 'HOST[:PORT] or "/path/to/sendmail -t -i"',
+                       help = ('SMTP server (or sendmail program) to use for'
+                               ' sending mail')),
            make_option('-u', '--smtp-user', metavar = 'USER',
                        help = 'username for SMTP authentication'),
            make_option('-p', '--smtp-password', metavar = 'PASSWORD',
-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Catalin Marinas
Message 2 of 2 in “Allow e-mails to be sent with the Unix sendmail tool”
  1. Allow e-mails to be sent with the Unix sendmail toolCatalin Marinas, Jun 14, 2008
  2. Karl HasselströmJun 14, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.