New Mail Feature

Execute a command upon the receipt of new mail.

1. Support

Since: NeoMutt 2016-07-23

Dependencies: None

2. Introduction

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 %ffor the folder name. For a complete list, see: $status_format.

For example in Linux you can use (most distributions already provide notify-send):

set new_mail_command="notify-send --icon='/home/santiago/Pictures/mutt.png' 'New Email in %f' '%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 in %f' -message '%n new messages, %u unread.' -activate 'com.apple.Terminal'"

3. Variables

Table 24.1. New Mail Command Variables

Name Type Default
new_mail_command string (empty)

4. Muttrc

# Example NeoMutt config file for the new-mail feature.

# --------------------------------------------------------------------------
# VARIABLES - shown with their default values
# --------------------------------------------------------------------------

# Set the command you want mutt to execute upon the receipt of a new email
set new_mail_command = ""

# Linux example:
# set new_command="notify-send --icon='/home/santiago/Pictures/mutt.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=muttrc

5. See Also

6. Known Bugs

None

7. Credits