How do I program Mutt to decide when a new letter arrives?

There is an option in the Mutt config variables beep_new

that causes Mutt to beep when a new email arrives. There is also a command <shell_esc>

that executes a command in the inner shell. Is there a way to make Mutt perform some user-defined action (shell command) when a new email arrives? Maybe it <pipe-message>

can help? (Can be used <pipe-message>

in a config file to invoke a shell command. Is there a way to do this when starting Mutt?)

EDIT: As per Glenn's advice, the script from Mutt can be called by setting up a custom state format in the .muttrc file:

set status_format="/some/ '%r %f (%L) |"


But I can't figure out how to use this to detect new emails, since the command line shows the message "New mail in ..." rather than the status bar. And if the letter arrives in a mailbox that is not the current one, then the status bar does not change at all.

EDIT 2: OK, the% b variable in status_format did it.


source to share

1 answer

Mutt cannot do this (at least not without some workaround).

NeoMutt can: see new_mail_command .



All Articles