On Wed, May 13, 2026 at 10:10:10AM +0200, MUTTjndskjednej--- via Mutt-users 
wrote:
> > Sent: Wednesday, May 13, 2026 at 1:35 AM
> > From: "Kevin J. McCarthy"
> > Alternatively, you can wait until after the first edit session, and in
> > the compose menu edit the Cc/Bcc list via <edit-cc>
> 
> Yeah, I'd forget, knowing me! Like when I write "I've attached such and
> such to this email" and then having to write an apology email afterwards
> that actually does have the attachment. Sooo many times!

I do the same, and use mutt to help.  If you use Mutt's sendmail support to 
send emails (vs SMTP), save the attached script somewhere, make it executable, 
and edit muttrc to have this line:

set sendmail = "/path/to/muttCheckAttach /usr/lib/sendmail -oem -oi"

It's based on a script I got from the old wiki, but I've refined things over 
the years.  It looks for a multipart/mixed message (message with file 
attachments, roughly).  It scans for keywords like "attach" or "patch" 
(customizable).  It also looks for a header that is "X-attached: none" or 
"Resent-From:" (a header mutt adds to bounce messages).

If it finds a message without attachments but that does have keywords and 
doesn't find an override header, it prints an error message and fails the send, 
letting you reedit.

If the message isn't all of those things, it uses the argument to send the 
message on.

You'll find an X-attached: none header on this message, since it includes the 
keywords but no attachments!

-- 
Ed Blackman

Reply via email to