This feature enables the new_mail_command setting, which can be used to execute a custom script (e.g. a notification handler) upon receiving a new mail.
The command string can contain expandos, such as
%n
for the number of new messages. For a complete list, see:
$status_format.
When the notification is sent, the folder of the new mail is no longer known. This is a limitation of NeoMutt. The `%f` expando will show the open folder.
When using Maildir local mailboxes, you must set $check_new config variable for this feature to work.
For example in Linux you can use (most distributions already provide notify-send):
set new_mail_command="notify-send --icon='/home/santiago/Pictures/neomutt.png' \ 'New Email' '%n new messages, %u unread.' &"
And in OS X you will need to install a command line interface for Notification Center, for example terminal-notifier:
set new_mail_command="terminal-notifier -title '%v' -subtitle 'New Mail' \ -message '%n new messages, %u unread.' -activate 'com.apple.Terminal'"
# Example NeoMutt config file for the new-mail feature. # -------------------------------------------------------------------------- # VARIABLES – shown with their default values # -------------------------------------------------------------------------- # Set the command you want NeoMutt to execute upon the receipt of a new email set new_mail_command = "" # Linux example: # set new_mail_command="notify-send --icon='/home/santiago/Pictures/neomutt.png' \ # 'New Email in %f' '%n new messages, %u unread.' &" # OS X example: # set new_mail_command="terminal-notifier -title '%v' -subtitle 'New Mail in %f' \ # -message '%n new messages, %u unread.' -activate 'com.apple.Terminal'" # -------------------------------------------------------------------------- # vim: syntax=neomuttrc