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

send-hook not setting $from



Let's say I have the following in my ~/.muttrc:

        send-hook . 'set from=me@xxxxxxxxxx'
        send-hook '~C abuse@xxxxxxx' 'set from=me+aol@xxxxxxxxxx'

Then I launch Mutt fresh, and send an email to "abuse@xxxxxxx".  The
expected From: header generated by Mutt should be "me+aol@xxxxxxxxxx".
Instead, the From: header still says "me@xxxxxxxxxx".  If I abort the
message and send another email to "abuse@xxxxxxx", the From: header
changes to "me+aol@xxxxxxxxxx" as expected.

I don't have this problem if I manually change the From: header using
my_hdr.  But this solution, however functional, seems like a messy hack.
Nothing in Mutt's docs says that "set from" cannot work in a send-hook.

When composing an email, the first thing Mutt asks for is the To:
header, i.e. a list of recipients.  Next, it asks for the Subject:.
Then it sends you to an editor to create your message body.  Mutt's
standard procedure creates an impression that the From: header has not
yet been composed, at least until the recipient list is known.  Since
a send-hook is designed primarly to operate on the recipient list, it
makes sense that "set from" should work in a send-hook.  If this is
really not the case, would it be reasonable to file a request/bug that
Mutt be patched to perform in this expected fashion?

Any comments or suggestions are appreciated, thanks!