Verified Commit 2f39cf2a authored by Yoshiki Vázquez Baeza's avatar Yoshiki Vázquez Baeza Committed by Fabian Groffen

NewMailCmd: optionally execute a command upon new mail arrival

This setting allows to run any external program to e.g. produce a
notification on the desktop when Mutt finds new mail.
Signed-off-by: Fabian Groffen's avatarFabian Groffen <grobian@gentoo.org>
parent 5d5dce99
......@@ -636,6 +636,12 @@ int mutt_index_menu (void)
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 == MUTT_FLAGS)
mutt_message _("Mailbox was externally modified.");
......@@ -662,6 +668,12 @@ int mutt_index_menu (void)
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
......
......@@ -115,6 +115,7 @@ WHERE char *Postponed;
WHERE char *PostponeEncryptAs;
WHERE char *Prefix;
WHERE char *PrintCmd;
WHERE char *NewMailCmd;
WHERE char *QueryCmd;
WHERE char *QueryFormat;
WHERE char *Realname;
......
......@@ -1800,6 +1800,13 @@ struct option_t MuttVars[] = {
** See also $$read_inc, $$write_inc and $$net_inc.
*/
#endif
{ "new_mail_command", DT_PATH, R_NONE, UL &NewMailCmd, UL NULL },
/*
** .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.
*/
{ "pager", DT_PATH, R_NONE, UL &Pager, UL "builtin" },
/*
** .pp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment