unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Gregor Zattler <telegraph@gmx.net>
To: help-gnu-emacs@gnu.org
Subject: Re: superfluous(?) quotes in mail alias expansion
Date: Wed, 22 Mar 2023 22:13:01 +0100	[thread overview]
Message-ID: <875yas7an6.fsf@no.lan> (raw)
In-Reply-To: <87h6ueqj12.fsf@dataswamp.org>

Hi Emanuel,
* Emanuel Berg <incal@dataswamp.org> [2023-03-21; 15:24 +01]:
> Gregor Zattler wrote:
>
>> the fine manual has this to say regarding mail aliases:
>>
>>    If an address contains a space, quote the whole
>>    address with a pair of double quotes, like this:
>>
>>         alias jsmith "John Q. Smith <none@example.com>"
>>
>>    Note that you need not include double quotes around
>>    individual parts of the address, such as the
>>    person’s full name.  Emacs puts them in if they are
>>    needed.  For instance, it inserts the above address
>>    as ‘"John Q. Smith" <none@example.com>’.
>>
>> This describes correctly how this mechanism works,
>> regarding it's outcome, but not why.
>
> In the data file, it's just so it can be parsed. When it gets
> inserted, quotes are added if they are needed.
>
> Try putting it like this in ~/.mailrc:
>
> alias jsmith-1 "John Q. Smith <none@example.com>"
> alias jsmith-2 "John Q Smith <none@example.com>"
> alias jsmith jsmith-1 jsmith-2
>
> then expand both with "jsmith", it will look like this:
>
> To: "John Q. Smith" <none@example.com>,
>  John Q Smith <none@example.com>
>
> Quotes inserted (because of the dot) in the first case, not in
> the second as not needed.

I see, thanks.  But why does the dot need quoting?  I
tried to understand RFC 5322 section 3.4, and 4.1 which
if I understand correctly allowed for a dot at this
part of the To: Header, but only so since ~10 years.

OK, I'm convinced that it then is more conservative to
send with the quotes.

Anyway I did a test: An email from one system to
another with

John Q. Smith

unquoted in the To: header arrived.  The display-name
part was not quoted in the copy which came through all
the smtp hops.  But notmuch as mutt show this message
with quotes around the display-name.


Goodbye, Gregor



  reply	other threads:[~2023-03-22 21:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 13:58 superfluous(?) quotes in mail alias expansion Gregor Zattler
2023-03-21 14:24 ` Emanuel Berg
2023-03-22 21:13   ` Gregor Zattler [this message]
2023-03-24 10:47   ` Byung-Hee HWANG

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=875yas7an6.fsf@no.lan \
    --to=telegraph@gmx.net \
    --cc=help-gnu-emacs@gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).