On 05Sep2015 09:19, Ian Zimmerman <[email protected]> wrote:
On 2015-09-05 16:25 +0200, Louis-David Mitterrand wrote:
When this reply-hook is applied the text between parens doesn't appear
in replies:

reply-hook '~h((X-Original-)?To\|From):.+(contact\|info)@example.net' \
        "set hostname=example.net; \
        my_hdr From: Flavius (Example Support) <[email protected]>"

If I remove the parens then "Example Support" appears in the header.

What is going on here?

I think this is mutt's overly strict (pedantic?) interpretation of RFC
2822 (or whatever is the current version), section 3.4 (Address
Specification).  That section says that an address is in one _and only
one_ of two forms:

1. Foo Bar <[email protected]>
2. [email protected] (Foo Bar)

Basically, parentheses are not free form, they are supposed to hold the
real name in case the address proper is not enclosed in angle brackets.

To be pedantic myself, the parentheses are comments (==> human readable additional information) and bundled in with "folding whitespace" in many places in the grammar, labelled "CFWS" (comments and folding whitespace). They're meant to be preserved - they're just not part of the address semantics - irrelevant to message delivery/routing.

But I think your form is legal, though obsolete.

Your address is the "name-addr" form from the grammer (example 1 in Ian's text above), and that is "[display-name] angle-addr". And a "display-name" is a "phrase" and a "phrase" is one or more "word"s or an "obs-phrase". A "word" is an atom (a bare word like Foo) or a quoted string. But an "obs-phrase" is a word followed by optional words, dots or CFWS.

On that basis I think mutt should accept your From: header.

The argument for dropping the "(comment)", were it illegal, is that we should try not to _emit_ illegal messages: accept then (we might get anything) but not create illegal stuff.

Cheers,
Cameron Simpson <[email protected]>

Reply via email to