[neomutt-users] Odd macro behavior when new mail comes in

Ken Halpern meetup at kenhalpern.com
Sun May 23 20:53:03 CEST 2021


Relative newbie to neomutt here, so apologies if this is obvious.  I managed to configure neomutt to do most of what I want, but have run into a puzzling piece of behavior.  I've scoured the docs, but have no idea what I'm doing wrong. 

I have a macro in my neomutt.rc which binds 's' to a modified save function (just a standard move to save folder, then delete from inbox).  

folder-hook inbox 'macro index,pager s ":set confirmappend=no delete=yes\n<save-message>=saved\n<sync-mailbox>:set confirmappend=yes delete=ask-yes\n"'

It works fine under most circumstances.  However, sometimes I get launched into a series of weird attempted replies.  Usually there are 3 of them.  First, it starts me on a reply to one message.  I ctrl x-c out (I'm using emacs as my editor) then a 2nd and I do the same, then a 3rd and I do the same.  It then puts me in something that looks like a directory listing.  I have to exit out of that, and it finally returns me to the main screen.  However, I now have one message tagged, another marked for deletion, and a third that has been moved/deleted as my macro is supposed to do.   

As far as I can tell, the triggering event for this is when new mail comes in.  For example, I have gmail setup to effectively bcc me on any message I send through its servers.  If I send a message from neomutt via my gmail account's smtp server, I'll soon thereafter receive a copy of that message (independent of  any local "sent" copies I generate) in my inbox.  My usual workflow is:  get a message from someone, reply to it, hit s to save the message I just replied to.  Neomutt then launches into the bizarre behavior just described because the bcc'd copy arrives as I'm doing it. However, it also happens if some random message arrives while I'm hitting 's' (or maybe soon after, it's hard to tell).  In fact, it happens with other similarly-defined macros too.

I figure that something in the macro is leaving things in an unfinished state, so when the new mail arrives certain actions are triggered.  I assume that the seemingly arbitrary tagging and marking-for-deletion of the 2 messages have to do with keystrokes 't' and 'd' somehow being delivered by the macro?  

Anyway, I figure I'm either doing something completely wrong, or failing to adequately protect the macro.  

I really appreciate any help with fixing this and making it safe for use!

Cheers,
Ken


More information about the neomutt-users mailing list