#include <stdbool.h>
Go to the source code of this file.
◆ MUTT_MAILBOX_CHECK_FORCE
#define MUTT_MAILBOX_CHECK_FORCE (1 << 0) |
◆ MUTT_MAILBOX_CHECK_FORCE_STATS
#define MUTT_MAILBOX_CHECK_FORCE_STATS (1 << 1) |
◆ mutt_mailbox_check()
int mutt_mailbox_check |
( |
struct Mailbox * |
m_cur, |
|
|
int |
force |
|
) |
| |
Check all all Mailboxes for new mail.
- Parameters
-
m_cur | Current Mailbox |
force | Force flags, see below |
- Return values
-
num | Number of mailboxes with new mail |
The force argument may be any combination of the following values:
- MUTT_MAILBOX_CHECK_FORCE ignore MailboxTime and check for new mail
- MUTT_MAILBOX_CHECK_FORCE_STATS ignore MailboxTime and calculate statistics
Check all all Mailboxes for new mail and total/new/flagged messages
Definition at line 141 of file mutt_mailbox.c.
143 struct stat contex_sb;
145 bool check_stats =
false;
146 contex_sb.st_dev = 0;
147 contex_sb.st_ino = 0;
181 contex_sb.st_dev = 0;
182 contex_sb.st_ino = 0;
◆ mutt_mailbox_cleanup()
void mutt_mailbox_cleanup |
( |
const char * |
path, |
|
|
struct stat * |
st |
|
) |
| |
Restore the timestamp of a mailbox.
- Parameters
-
path | Path to the mailbox |
st | Timestamp info from stat() |
Fix up the atime and mtime after mbox/mmdf mailbox was modified according to stat() info taken before a modification.
Definition at line 358 of file mutt_mailbox.c.
360 #ifdef HAVE_UTIMENSAT
375 if (st->st_mtime > st->st_atime)
377 #ifdef HAVE_UTIMENSAT
379 ts[0].tv_nsec = UTIME_OMIT;
381 ts[1].tv_nsec = UTIME_NOW;
382 utimensat(AT_FDCWD, buf, ts, 0);
384 ut.actime = st->st_atime;
391 #ifdef HAVE_UTIMENSAT
393 ts[0].tv_nsec = UTIME_NOW;
395 ts[1].tv_nsec = UTIME_NOW;
396 utimensat(AT_FDCWD, buf, ts, 0);
◆ mutt_mailbox_list()
bool mutt_mailbox_list |
( |
void |
| ) |
|
List the mailboxes with new mail.
- Return values
-
Definition at line 220 of file mutt_mailbox.c.
222 char mailboxlist[512];
230 mailboxlist[0] =
'\0';
231 pos += strlen(strncat(mailboxlist,
_(
"New mail in "),
sizeof(mailboxlist) - 1 - pos));
251 pos += strlen(strncat(mailboxlist + pos,
", ",
sizeof(mailboxlist) - 1 - pos));
261 sizeof(mailboxlist) - 1 - pos));
268 strncat(mailboxlist + pos,
", ...",
sizeof(mailboxlist) - 1 - pos);
◆ mutt_mailbox_next()
incoming folders completion routine
- Parameters
-
- Return values
-
Given a folder name, find the next incoming folder with new mail. The Mailbox will be returned and a pretty version of the path put into s.
Definition at line 312 of file mutt_mailbox.c.
319 for (
int pass = 0; pass < 2; pass++)
◆ mutt_mailbox_notify()
bool mutt_mailbox_notify |
( |
struct Mailbox * |
m_cur | ) |
|
◆ mutt_mailbox_set_notified()
void mutt_mailbox_set_notified |
( |
struct Mailbox * |
m | ) |
|
Note when the user was last notified of new mail.
- Parameters
-
Definition at line 289 of file mutt_mailbox.c.
295 #ifdef HAVE_CLOCK_GETTIME
◆ C_MailCheck
◆ C_MailCheckStats
Config: Periodically check for new mail.
Definition at line 52 of file mutt_mailbox.c.
◆ C_MailCheckStatsInterval
short C_MailCheckStatsInterval |
Config: How often to check for new mail.
Definition at line 53 of file mutt_mailbox.c.
struct AccountList accounts
List of all Accounts.
struct MuttWindow * MessageWindow
Message Window, ":set", etc.
bool mutt_mailbox_list(void)
List the mailboxes with new mail.
String manipulation buffer.
void mutt_buffer_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
@ MUTT_POP
'POP3' Mailbox type
#define TAILQ_EMPTY(head)
size_t neomutt_mailboxlist_get_all(struct MailboxList *head, struct NeoMutt *n, enum MailboxType type)
Get a List of all Mailboxes.
bool notified
User has been notified.
uint8_t flags
e.g. MB_NORMAL
bool has_new
Mailbox has new mail.
static time_t MailboxStatsTime
last time we check performed mail_check_stats
bool C_CheckMboxSize
Config: (mbox,mmdf) Use mailbox size as an indicator of new mail.
struct Mailbox * mailbox
Mailbox in the list.
void mutt_buffer_reset(struct Buffer *buf)
Reset an existing Buffer.
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
static void mailbox_check(struct Mailbox *m_cur, struct Mailbox *m_check, struct stat *ctx_sb, bool check_stats)
Check a mailbox for new mail.
#define STAILQ_FOREACH(var, head, field)
bool first_check_stats_done
True when the check have been done at least on time.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
static short MailboxCount
how many boxes with new mail
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
enum MailboxType type
Mailbox type.
short C_MailCheckStatsInterval
Config: How often to check for new mail.
int mutt_mailbox_check(struct Mailbox *m_cur, int force)
Check all all Mailboxes for new mail.
@ MUTT_MAILBOX_ANY
Match any Mailbox type.
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
@ MUTT_IMAP
'IMAP' Mailbox type
void mutt_update_num_postponed(void)
Force the update of the number of postponed messages.
void mailbox_update(struct Mailbox *m)
Get the mailbox's current size.
static short MailboxNotify
void mutt_buffer_expand_path(struct Buffer *buf)
Create the canonical path.
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
time_t mutt_date_epoch(void)
Return the number of seconds since the Unix epoch.
struct WindowState state
Current state of the Window.
#define STAILQ_HEAD_INITIALIZER(head)
static time_t MailboxTime
last time we started checking for mail
short C_MailCheck
Config: Number of seconds before NeoMutt checks for new mail.
#define MUTT_MAILBOX_CHECK_FORCE
struct timespec last_visited
Time of last exit from this mailbox.
Container for Accounts, Notifications.
size_t mutt_buffer_len(const struct Buffer *buf)
Calculate the length of a Buffer.
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
Time value with nanosecond precision.
#define mutt_message(...)
bool C_MailCheckStats
Config: Periodically check for new mail.
#define MUTT_MAILBOX_CHECK_FORCE_STATS
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
void neomutt_mailboxlist_clear(struct MailboxList *ml)
Free a Mailbox List.
struct Mailbox * mailbox_find(const char *path)
Find the mailbox with a given path.