57 struct stat *st1,
struct stat *st2)
71 return ((st1->st_dev == st2->st_dev) && (st1->st_ino == st2->st_ino));
84 struct stat st = { 0 };
89 if ((m_cur == m_check) && c_mail_check_recent)
98 m_check->
type = mb_type;
102 ((m_check->
type ==
MUTT_UNKNOWN) && S_ISREG(st.st_mode) && (st.st_size == 0)) ||
121 switch (m_check->
type)
140 m_check->
size = (off_t) st.st_size;
158 struct stat st_ctx = { 0 };
181 (c_mail_check_stats && ((t -
MailboxStatsTime) >= c_mail_check_stats_interval)))
245 char mailboxlist[512] = { 0 };
253 mailboxlist[0] =
'\0';
254 pos += strlen(strncat(mailboxlist,
_(
"New mail in "),
sizeof(mailboxlist) - 1 - pos));
268 if (!first && (width >= 7) && ((pos +
mutt_buffer_len(path)) >= (width - 7)))
274 pos += strlen(strncat(mailboxlist + pos,
", ",
sizeof(mailboxlist) - 1 - pos));
284 sizeof(mailboxlist) - 1 - pos));
291 strncat(mailboxlist + pos,
", ...",
sizeof(mailboxlist) - 1 - pos);
318#ifdef HAVE_CLOCK_GETTIME
338 for (
int pass = 0; pass < 2; pass++)
352 if ((found || (pass > 0)) && (find_new ? m_cur->
has_new : m_cur->
msg_unread > 0))
433 if (c_check_mbox_size)
442 if (st->st_mtime > st->st_atime)
449 utimensat(AT_FDCWD, buf, ts, 0);
451 ut.actime = st->st_atime;
463 utimensat(AT_FDCWD, buf, ts, 0);
bool mutt_buffer_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
size_t mutt_buffer_len(const struct Buffer *buf)
Calculate the length of a Buffer.
void mutt_buffer_reset(struct Buffer *buf)
Reset an existing Buffer.
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
short cs_subset_number(const struct ConfigSubset *sub, const char *name)
Get a number config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
time_t mutt_date_now(void)
Return the number of seconds since the Unix epoch.
#define mutt_message(...)
Convenience wrapper for the gui headers.
void mailbox_update(struct Mailbox *m)
Get the mailbox's current size.
struct Mailbox * mailbox_find(const char *path)
Find the mailbox with a given path.
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
MailboxType
Supported mailbox formats.
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
@ MUTT_MMDF
'mmdf' Mailbox type
@ MUTT_POP
'POP3' Mailbox type
@ MUTT_MH
'MH' Mailbox type
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
@ MUTT_IMAP
'IMAP' Mailbox type
@ MUTT_MBOX
'mbox' Mailbox type
@ MUTT_MAILBOX_ANY
Match any Mailbox type.
@ MUTT_UNKNOWN
Mailbox wasn't recognised.
@ MUTT_MAILDIR
'Maildir' Mailbox type
size_t msgwin_get_width(void)
Get the width of the Message Window.
Convenience wrapper for the library headers.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
static time_t MailboxStatsTime
last time we check performed mail_check_stats
static short MailboxCount
how many boxes with new mail
static short MailboxNotify
int mutt_mailbox_check(struct Mailbox *m_cur, CheckStatsFlags flags)
Check all all Mailboxes for new mail.
static void mailbox_check(struct Mailbox *m_cur, struct Mailbox *m_check, struct stat *st_ctx, CheckStatsFlags flags)
Check a mailbox for new mail.
void mutt_mailbox_set_notified(struct Mailbox *m)
Note when the user was last notified of new mail.
struct Mailbox * mutt_mailbox_next_unread(struct Mailbox *m_cur, struct Buffer *s)
Find next mailbox with unread mail.
bool mutt_mailbox_notify(struct Mailbox *m_cur)
Notify the user if there's new mail.
struct Mailbox * mutt_mailbox_next(struct Mailbox *m_cur, struct Buffer *s)
Incoming folders completion routine.
bool mutt_mailbox_list(void)
List the mailboxes with new mail.
void mutt_mailbox_cleanup(const char *path, struct stat *st)
Restore the timestamp of a mailbox.
static bool is_same_mailbox(struct Mailbox *m1, struct Mailbox *m2, struct stat *st1, struct stat *st2)
Compare two Mailboxes to see if they're equal.
static struct Mailbox * find_next_mailbox(struct Buffer *s, bool find_new)
Find the next mailbox with new or unread mail.
static time_t MailboxTime
last time we started checking for mail
Mailbox helper functions.
void mutt_buffer_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
void mutt_buffer_expand_path(struct Buffer *buf)
Create the canonical path.
Some miscellaneous functions.
enum MxStatus mx_mbox_check_stats(struct Mailbox *m, uint8_t flags)
Check the statistics for a mailbox - Wrapper for MxOps::mbox_check_stats()
enum MailboxType mx_path_probe(const char *path)
Find a mailbox that understands a path.
#define MUTT_MAILBOX_CHECK_NO_FLAGS
No flags are set.
#define MUTT_MAILBOX_CHECK_FORCE_STATS
Ignore MailboxType and calculate statistics.
#define MUTT_MAILBOX_CHECK_FORCE
Ignore MailboxTime and check for new mail.
uint8_t CheckStatsFlags
Flags for mutt_mailbox_check.
void neomutt_mailboxlist_clear(struct MailboxList *ml)
Free a Mailbox List.
size_t neomutt_mailboxlist_get_all(struct MailboxList *head, struct NeoMutt *n, enum MailboxType type)
Get a List of all Mailboxes.
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
void mutt_update_num_postponed(void)
Force the update of the number of postponed messages.
#define STAILQ_HEAD_INITIALIZER(head)
#define STAILQ_FOREACH(var, head, field)
#define TAILQ_EMPTY(head)
String manipulation buffer.
struct Mailbox * mailbox
Mailbox in the list.
bool has_new
Mailbox has new mail.
bool first_check_stats_done
True when the check have been done at least on time.
enum MailboxType type
Mailbox type.
bool newly_created
Mbox or mmdf just popped into existence.
struct Buffer pathbuf
Path of the Mailbox.
bool notified
User has been notified.
off_t size
Size of the Mailbox.
bool visible
True if a result of "mailboxes".
struct timespec last_visited
Time of last exit from this mailbox.
int msg_unread
Number of unread messages.
Container for Accounts, Notifications.
struct AccountList accounts
List of all Accounts.
struct ConfigSubset * sub
Inherited config items.
Time value with nanosecond precision.
long tv_nsec
Number of nanosecond, on top.
time_t tv_sec
Number of seconds since the epoch.