]> granicus.if.org Git - neomutt/commitdiff
feature: new-mail
authorYoshiki Vázquez Baeza <yoshiki89@gmail.com>
Sat, 23 Apr 2016 20:33:50 +0000 (13:33 -0700)
committerRichard Russon <rich@flatcap.org>
Thu, 18 Aug 2016 15:15:27 +0000 (16:15 +0100)
This setting executes a command when new mail is received.

curs_main.c
globals.h
init.h

index 8e0f52ad837eadbee37601851c2626956f4e9e01..e06901c71af5ab023b1df986830bf4758c459f3c 100644 (file)
@@ -577,6 +577,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.");
 
@@ -603,6 +609,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
index 95a6869baa03b4a01336947a34a64df1cb773807..2a0d13738167d41fc7c3f17db12c8f942ea2007f 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -111,6 +111,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;
diff --git a/init.h b/init.h
index 3f3f96d9dd57e3d12e609bd9e3c01f8cc3fd7d93..11bfa9c83d48fa665185ad967c87070cdf54e130 100644 (file)
--- a/init.h
+++ b/init.h
@@ -293,6 +293,13 @@ struct option_t MuttVars[] = {
   { "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 },