return 0;
}
-/* returns 1 if maildir has new mail */
-static int buffy_maildir_hasnew (BUFFY* mailbox)
+/* returns 1 if the specified dir (cur or new) has new mail */
+static int buffy_maildir_dir_hasnew(BUFFY* mailbox, const char *dir_name)
{
char path[_POSIX_PATH_MAX];
DIR *dirp;
int rc = 0;
struct stat sb;
- snprintf (path, sizeof (path), "%s/new", mailbox->path);
+ snprintf (path, sizeof (path), "%s/%s", mailbox->path, dir_name);
/* when $mail_check_recent is set, if the new/ directory hasn't been modified since
* the user last exited the mailbox, then we know there is no recent mail.
if (*de->d_name == '.')
continue;
- if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T'))
+ if (!(p = strstr (de->d_name, ":2,")) || !(strchr (p + 3, 'T') || strchr(p + 3, 'S')))
{
if (option(OPTMAILCHECKRECENT))
{
return rc;
}
+/* returns 1 if maildir has new mail */
+static int buffy_maildir_hasnew (BUFFY* mailbox)
+{
+ if (buffy_maildir_dir_hasnew(mailbox, "new")) {
+ return 1;
+ }
+
+ if (!option(OPTMAILDIRCHECKCUR)) {
+ return 0;
+ }
+
+ if (buffy_maildir_dir_hasnew(mailbox, "cur")) {
+ return 1;
+ }
+
+ return 0;
+}
/* returns 1 if mailbox has new mail */
static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
{
** to maildir-style mailboxes. Setting it will have no effect on other
** mailbox types.
*/
+ { "maildir_check_cur", DT_BOOL, R_NONE, OPTMAILDIRCHECKCUR, 0 },
+ /*
+ ** .pp
+ ** If \fIset\fP, mutt will poll both the new and cur directories of
+ ** a maildir folder for new messages. This might be useful if other
+ ** programs interacting with the folder (e.g. dovecot) are moving new
+ ** messages to the cur directory. Note that setting this option may
+ ** slow down polling for new messages in large folders, since mutt has
+ ** to scan all cur messages.
+ */
{ "mark_old", DT_BOOL, R_BOTH, OPTMARKOLD, 1 },
/*
** .pp