<<< Date Index >>>     <<< Thread Index >>>

Re: send-hook not setting $from



On Sat, Dec 06, 2003 at 08:39:13PM -0500, Patrick Shanahan wrote:
: * Eugene Lee <list-mutt@xxxxxxxx> [12-06-03 20:16]:
: > On Fri, Dec 05, 2003 at 07:28:11AM -0500, David Yitzchak Cohen wrote:
: > > 
: > > In plain English, changing $from in a send-hook has no effect on the
: > > message being composed because Mutt has already set your From> header
: > > before it executes the send-hook (based on what $from was then - i.e.,
: > > before your hook was called).
: > 
: > This behavior is not explained in the normal HTML documentation.
: 
: but it is (reading & comprehension are necessary):
: 
: 3.17.  Change settings based upon message recipients
:   
: Usage: reply-hook [!]pattern command Usage: send-hook [!]pattern command

1. Please don't quote docs to non-release versions of Mutt.  If it
doesn't have a URL, it's not so easy to trace.

2. Everything you quoted, except for the stuff specific to reply-hook,
is identical to the online docs for send-hook:

        http://www.mutt.org/doc/manual/manual-3.html#send-hook

3. None of the docs you quoted mention anything about $from not working
in a send-hook.

4. The send-hook docs emphasize how it works based on the recipient list.
There's nothing there about modifying the From: header.

5. I have read the send-hook docs in both the release and development
versions of Mutt.  Neither describe this unusual behavior.  Quoting the
subsection and saying "RTFM" is useless because the docs say nothing on
this subject.  Want proof?

: 3.17 Change settings based upon message recipients 

"based upon message recipients".  No mention of $from.

: Usage: send-hook [!]pattern command 
:
: This command can be used to execute arbitrary configuration commands
: based upon recipients of the message.

"based upon message recipients".  No mention of $from.

: pattern is a regular expression matching the desired address.

"matching the desired address", i.e. the recipient list.
No mention of $from.

: command is executed when regexp matches recipients of the message.

"matches recipients of the message".  No mention of $from.

: When multiple matches occur, commands are executed in the order they
: are specified in the muttrc. 

No mention of $from.

: See  Message Matching in Hooks for information on the exact format of
: pattern. 

No mention of $from.

: Example: send-hook mutt "set mime_forward signature=''" 

No mention of $from.

: Another typical use for this command is to change the values of the
: $attribution,  $signature and  $locale variables in order to change
: the language of the attributions and signatures based upon the
: recipients. 

It mentions other configuration variables.  But no mention of $from.

: Note: the send-hook's are only executed ONCE after getting the initial
: list of recipients.

send-hook matches after it gets the recipient list.  No mention of $from.

: Adding a recipient after replying or editing the
: message will NOT cause any send-hook to be executed.

Nothing wrong here, except it doesn't talk about setting the From: header.
And no mention of $from.

: Also note that my_hdr commands which modify recipient headers, or the
: message's subject, don't have any effect on the current message when
: executed from a send-hook. 

I read "recipient headers" as To:, Cc:, and Bcc: headers.  And yet,
no mention of $from.

I call "Shenanigans!" on Patrick!  :-)