#641457 mutt: send-hook should not be executed if the mail is not going to be sent

Package:
mutt
Source:
mutt
Description:
text-based mailreader supporting MIME, GPG, PGP and threading
Submitter:
Raphaël Hertzog
Date:
2026-06-24 01:11:01 UTC
Severity:
normal
Tags:
#641457#5
Date:
2011-09-13 15:06:07 UTC
From:
To:
I have a hook like this:

send-hook '~s keyword' "push '<edit-subject><kill-line>Thank you<enter>'"

The idea is that I want the subject to be automatically modified if it contains
a specific keyword. This works well when you actually reply to the mail (or
write a new mail).

But if you exit the text editor without having done any change, the confirmation
screen is not displayed but the "push" is still executed and the various letters
end up executing multiple commands that should not have been executed because
they were intended for the "Compose menu" and not the "Index menu".

So the send-hook/send2-hook should really only be executed if the mail is going
to be sent...

And ideally if a reply is cancelled, a push recorded in a reply-hook should
also be cancelled. Because my first try was to use a reply-hook for my need.
:-)

Cheers,