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

Re: [PATCH v4] send-email: Add simple email aliases format

From
Allen Hubbe <allenbh@gmail.com>
Date
May 22, 2015, 12:12 UTC
Message-ID
<CAJ80satbXXBYva9qrgR1oA_f7LAHUeAm21=R-mGsWx+sDoQ9sQ@mail.gmail.com>
In-Reply-To
<CAPig+cRLxk26p7DFaS+gRkKZxkRwf8g=4=j2QHX6AC2Uk5J++w@mail.gmail.com>
On Fri, May 22, 2015 at 12:29 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 21 quoted lines
> On Thu, May 21, 2015 at 11:40 PM, Allen Hubbe <allenbh@gmail.com> wrote:
>> This format is more simple than the other alias file formats, so it may
>> be preferred by some users. [...]
>> Signed-off-by: Allen Hubbe <allenbh@gmail.com>
>> ---
>> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
>> index 804554609def..38ade31e0c28 100644
>> --- a/Documentation/git-send-email.txt
>> +++ b/Documentation/git-send-email.txt
>> @@ -383,7 +383,29 @@ sendemail.aliasesFile::
>>
>>  sendemail.aliasFileType::
>>         Format of the file(s) specified in sendemail.aliasesFile. Must be
>> -       one of 'mutt', 'mailrc', 'pine', 'elm', or 'gnus'.
>> +       one of 'simple', 'mutt', 'mailrc', 'pine', 'elm', or 'gnus'.
>> ++
>> +If the format is 'simple', then the alias file format is described below.
>> +Descriptions of the other file formats to the following formats can be found in
>> +the documentation of the email program of the same name.
>
> The second sentence probably needs some proof-reading.
Could you be more specific?
Show 12 quoted lines
>
>> ++
>> +This 'simple' format is is as follows.
>> ++
>> +       <alias>: <address|alias>[, <address|alias>...]
>> ++
>> +Aliases are specified one per line.  There is no line splitting.  Anything on a
>> +line after and including a `#` symbol is considered a comment, and is ignored.
>> +Blank lines are ignored.
>
> I'm not convinced that gratuitously diverging from the
> sendmail/postfix 'aliases' format is warranted. In particular, that
This isn't 'sendmail', as of v2.
Show 7 quoted lines
> format recognizes a comment line only when '#' is the first
> non-whitespace character[1]; and does not consider '#' a
> comment-introducer anywhere else in the line. By recognizing '#'
> anywhere as a comment-introducer, you may be painting this format into
> a corner rather than leaving it open for someone later to extend it to
> be more sendmail/postfix-like by, for instance, supporting name
> quoting and line-continuation[1].

It depends what we want to do with this parser: accept existing sendmail aliases files in git, or enforce that git alias files are usable for sendmail. I really don't expect the second to ever happen. The first, maybe, but only if the alias file is edited to remove aliases of pipes and maildirs etc. The second may not work if we have comments to the right, or aliases of aliases, which sendmail does not claim to support.

I don't know what sendmail would actually do with a '#' elsewhere. It only talks about having '#' at the beginning of a line, or in the alias name in quotes (which is not supported by this parser - proper handling of quoted strings is not easy). It doesn't say what sendmail does with '#' if the name is not quoted, and it doesn't define a meaning for '#' in the definition of an alias. If these other cases would be errors for sendmail, so what if they are not errors here?

>
> For the same reason, I'm not convinced that "simple" is a good name.

I was worried about that back in v1 before going to v2, but I really don't have a strong opinion about the name. I already changed the name, at the suggestion of Junio. I'd like to hear a consensus from you two, or a tiebreaker from a third, before I change it again.

Show 5 quoted lines
> "sendmail" may indeed be a more appropriate name, even if it means
> that this early implementation documents it as (currently) a subset of
> the richer sendmail/postfix 'aliases' format. By doing so, we leave
> the door open so a future person can implement additional features to
> bring it closer to that format.
Or, a future person can write a sendmail parser that is closer to that format.
Show 13 quoted lines
>
> [1]: http://www.postfix.org/aliases.5.html
>
>> ++
>> +Example of the 'simple' format:
>> ++
>> +       alice: Alice W Land <awol@example.com>
>> +       bob: Robert Bobbyton <bob@example.com>
>> +       # this is a comment
>> +          # this is also a comment
>> +       chloe: chloe@example.com
>> +       abgroup: alice, bob # comment after an alias
>> +       bcgrp: bob, chloe, Other <o@example.com>
Previous: Eric SunshineNext: Junio C Hamano
Message 3 of 10 in “send-email: Add simple email aliases format”
  1. send-email: Add simple email aliases formatAllen Hubbe, May 22, 2015
  2. Eric SunshineMay 22, 2015
  3. Allen HubbeMay 22, 2015
  4. Junio C HamanoMay 22, 2015
  5. Allen HubbeMay 22, 2015
  6. Junio C HamanoMay 22, 2015
  7. Allen HubbeMay 22, 2015
  8. Eric SunshineMay 22, 2015
  9. Allen HubbeMay 22, 2015
  10. Eric SunshineMay 22, 2015

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.