This setting executes a command when new mail is received.
mutt_message _("New mail in this mailbox.");
if (option (OPTBEEPNEW))
beep ();
+ if (NewMailCmd)
+ {
+ char cmd[LONG_STRING];
+ menu_status_line(cmd, sizeof(cmd), menu, NONULL(NewMailCmd));
+ mutt_system(cmd);
+ }
} else if (check == M_FLAGS)
mutt_message _("Mailbox was externally modified.");
menu->redraw |= REDRAW_STATUS;
if (do_buffy_notify)
{
- if (mutt_buffy_notify () && option (OPTBEEPNEW))
- beep ();
+ if (mutt_buffy_notify ())
+ {
+ menu->redraw |= REDRAW_STATUS;
+ if (option (OPTBEEPNEW))
+ beep ();
+ if (NewMailCmd)
+ {
+ char cmd[LONG_STRING];
+ menu_status_line(cmd, sizeof(cmd), menu, NONULL(NewMailCmd));
+ mutt_system(cmd);
+ }
+ }
}
else
do_buffy_notify = 1;
<link linkend="maildir-trash">$maildir_trash</link>). For MH folders, a
mailbox is considered having new mail if there's at least one message in
the <quote>unseen</quote> sequence as specified by <link
-linkend="mh-seq-unseen">$mh_seq_unseen</link>.
++linkend="mh-seq-unseen">$mh_seq_unseen</link>. Optionally, <link
++linkend="new_mail_command">$new_mail_command</link> can be configured to
++execute an external program every time new mail is detected in the current
++inbox.
</para>
<para>
WHERE char *PostponeEncryptAs;
WHERE char *Prefix;
WHERE char *PrintCmd;
+WHERE char *NewMailCmd;
WHERE char *QueryCmd;
WHERE char *QueryFormat;
WHERE char *Realname;
{ "beep", DT_BOOL, R_NONE, OPTBEEP, 1 },
/*
** .pp
+ ** If \fIset\fP, Mutt will call this command after a new message is received.
+ ** See the $$status_format documentation for the values that can be formatted
+ ** into this command.
+ */
+ { "new_mail_command", DT_PATH, R_NONE, UL &NewMailCmd, UL NULL },
+ /*
+ ** .pp
** When this variable is \fIset\fP, mutt will beep when an error occurs.
*/
{ "beep_new", DT_BOOL, R_NONE, OPTBEEPNEW, 0 },