83 if (!adata || (adata->
mailbox != m))
111 if (!e || !adata || (adata->
mailbox != m))
132 if (!e || !adata || (adata->
mailbox != m))
153 if (!e || !adata || (adata->
mailbox != m))
173 if (sscanf(
id,
"%u-%u", &uv, &uid) != 2)
213 edata->deleted =
false;
214 edata->flagged =
false;
215 edata->replied =
false;
220 while (*s && (*s !=
')'))
225 edata->deleted =
true;
230 edata->flagged =
true;
235 edata->replied =
true;
257 while (*s && !
IS_SPACE(*s) && (*s !=
')'))
264 if (is_system_keyword)
300 char tmp[128] = { 0 };
334 while (*s && (*s !=
'\"') && (ptmp != (tmp +
sizeof(tmp) - 1)))
347 while (isdigit((
unsigned char) *s) && (ptmp != (tmp +
sizeof(tmp) - 1)))
368 while (*s && (*s !=
')'))
433 if ((parse_rc != -2) || !fp)
436 unsigned int bytes = 0;
512 if (!
mdata->uid_hash)
534 bool evalhc,
unsigned int msn_begin,
535 unsigned int msn_end,
unsigned int *fetch_msn_end)
538 unsigned int max_headers_per_fetch = UINT_MAX;
539 bool first_chunk =
true;
542 unsigned int range_begin = 0;
543 unsigned int range_end = 0;
544 unsigned int msn_count = 0;
547 if (msn_end < msn_begin)
551 if (c_imap_fetch_chunk_size > 0)
552 max_headers_per_fetch = c_imap_fetch_chunk_size;
556 if (msn_end - msn_begin + 1 <= max_headers_per_fetch)
557 *fetch_msn_end = msn_end;
559 *fetch_msn_end = msn_begin + max_headers_per_fetch - 1;
561 return (*fetch_msn_end - msn_begin + 1);
564 for (msn = msn_begin; msn <= (msn_end + 1); msn++)
566 if (msn_count < max_headers_per_fetch && msn <= msn_end &&
598 if ((
mutt_buffer_len(buf) > 500) || (msn_count >= max_headers_per_fetch))
604 *fetch_msn_end = msn - 1;
626 bool old_hd_flag,
bool new_hd_flag,
bool h_flag)
632 if ((old_hd_flag == new_hd_flag) && (local_changes != 0))
635 if (new_hd_flag == h_flag)
639 *server_changes =
true;
642 if (local_changes == 0)
665 unsigned int msn_end,
unsigned int uid_next,
666 bool store_flag_updates,
bool eval_condstore)
668 struct Progress *progress = NULL;
669 char buf[1024] = { 0 };
685 snprintf(buf,
sizeof(buf),
"UID FETCH 1:%u (UID%s)",
uid_next - 1,
686 eval_condstore ?
"" :
" FLAGS");
701 memset(&h, 0,
sizeof(h));
715 mutt_debug(
LL_DEBUG2,
"skipping hcache FETCH response for message number %d missing a UID\n",
777 if (!eval_condstore && store_flag_updates)
783 }
while (mfhrc == -1);
812 unsigned int uid = 0;
817 unsigned int msn = 1;
897 unsigned int msn_end,
unsigned int uid_next,
898 unsigned long long hc_modseq,
bool eval_qresync)
900 struct Progress *progress = NULL;
901 char buf[1024] = { 0 };
902 unsigned int header_msn = 0;
913 snprintf(buf,
sizeof(buf),
"UID FETCH 1:%u (FLAGS) (CHANGEDSINCE %llu%s)",
914 uid_next - 1, hc_modseq, eval_qresync ?
" VANISHED" :
"");
934 char *fetch_buf = adata->
buf;
935 if (fetch_buf[0] !=
'*')
939 if (!isdigit((
unsigned char) *fetch_buf) || !
mutt_str_atoui(fetch_buf, &header_msn))
942 if ((header_msn < 1) || (header_msn > msn_end) ||
958 mdata->check_status &= ~IMAP_FLAGS_PENDING;
968 mdata->reopen &= ~IMAP_EXPUNGE_PENDING;
1000 if (!adata || (adata->
mailbox != m))
1007 struct Email *e = NULL;
1008 struct Email *uidh = NULL;
1054 mutt_error(
_(
"QRESYNC failed. Reopening mailbox."));
1073 unsigned int msn_end,
bool evalhc,
1074 unsigned int *maxuid,
bool initial_download)
1077 unsigned int fetch_msn_end = 0;
1078 struct Progress *progress = NULL;
1079 char *hdrreq = NULL;
1080 struct Buffer *tempfile = NULL;
1083 struct Buffer *buf = NULL;
1084 static const char *
const want_headers =
"DATE FROM SENDER SUBJECT TO CC MESSAGE-ID REFERENCES "
1085 "CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO "
1086 "LINES LIST-POST LIST-SUBSCRIBE LIST-UNSUBSCRIBE X-LABEL "
1092 if (!adata || (adata->
mailbox != m))
1122 mutt_error(
_(
"Unable to fetch headers from this IMAP server version"));
1159 while ((fetch_msn_end < msn_end) &&
1168 int msgno = msn_begin;
1173 memset(&h, 0,
sizeof(h));
1261 if (*maxuid < h.edata->uid)
1284 mdata->
reopen &= ~IMAP_NEWMAIL_PENDING;
1297 msn_begin = fetch_msn_end + 1;
1328 unsigned int msn_end,
bool initial_download)
1331 unsigned int maxuid = 0;
1333 bool evalhc =
false;
1336 void *uidvalidity = NULL;
1337 void *puid_next = NULL;
1338 unsigned int uid_next = 0;
1339 bool has_condstore =
false;
1340 bool has_qresync =
false;
1341 bool eval_condstore =
false;
1342 bool eval_qresync =
false;
1343 unsigned long long hc_modseq = 0;
1344 char *uid_seqset = NULL;
1345 const unsigned int msn_begin_save = msn_begin;
1350 if (!adata || (adata->
mailbox != m))
1365 mdata->new_mail_count = 0;
1370 if (
mdata->hcache && initial_download)
1382 if (dlen >=
sizeof(
unsigned int))
1384 uid_next = *(
unsigned int *) puid_next;
1393 has_condstore =
true;
1406 "/MODSEQ", 7, &dlen2);
1409 if (dlen2 >=
sizeof(
unsigned long long))
1411 hc_modseq = *pmodseq;
1421 eval_qresync =
true;
1424 if (!eval_qresync && has_condstore)
1425 eval_condstore =
true;
1440 eval_condstore) < 0)
1444 if ((eval_condstore || eval_qresync) && (hc_modseq !=
mdata->modseq))
1447 hc_modseq, eval_qresync) < 0)
1454 while (msn_begin <= msn_end)
1467 if (eval_qresync && initial_download)
1471 eval_qresync =
false;
1472 eval_condstore =
false;
1479 msn_begin = msn_begin_save;
1486 if (maxuid && (
mdata->uid_next < maxuid + 1))
1487 mdata->uid_next = maxuid + 1;
1491 sizeof(
mdata->uidvalidity));
1492 if (maxuid && (
mdata->uid_next < maxuid + 1))
1495 mdata->uid_next = maxuid + 1;
1497 if (
mdata->uid_next > 1)
1500 sizeof(
mdata->uid_next));
1507 if (initial_download)
1509 if (has_condstore || has_qresync)
1512 sizeof(
mdata->modseq));
1559 char imap_flags[128] = { 0 };
1561 struct Progress *progress = NULL;
1569 fp = fopen(msg->
path,
"r");
1582 for (last = EOF, len = 0; (c = fgetc(fp)) != EOF; last = c)
1584 if ((c ==
'\n') && (last !=
'\r'))
1596 imap_flags[0] =
'\0';
1597 imap_flags[1] =
'\0';
1600 mutt_str_cat(imap_flags,
sizeof(imap_flags),
" \\Seen");
1602 mutt_str_cat(imap_flags,
sizeof(imap_flags),
" \\Answered");
1604 mutt_str_cat(imap_flags,
sizeof(imap_flags),
" \\Flagged");
1606 mutt_str_cat(imap_flags,
sizeof(imap_flags),
" \\Draft");
1608 snprintf(buf,
sizeof(buf),
"APPEND %s (%s) \"%s\" {%lu}",
mdata->munge_name,
1609 imap_flags + 1, internaldate, (
unsigned long) len);
1621 for (last = EOF, sent = len = 0; (c = fgetc(fp)) != EOF; last = c)
1623 if ((c ==
'\n') && (last !=
'\r'))
1628 if (len >
sizeof(buf) - 3)
1686 if (!m || !el || !dest)
1689 struct Buffer cmd, sync_cmd;
1697 int triedcreate = 0;
1770 mutt_message(ngettext(
"Copying %d message to %s...",
"Copying %d messages to %s...", rc),
1809 snprintf(prompt,
sizeof(prompt),
_(
"Create %s?"), mbox);
1847 return (rc < 0) ? -1 : rc;
1862 if (!e || !adata || (adata->
mailbox != m))
1866 char id[64] = { 0 };
1881 if (!adata || (adata->
mailbox != m))
1916 int local_changes = e->
changed;
1954 if (local_changes == 0)
1968 char buf[1024] = { 0 };
1972 bool retried =
false;
1978 bool fetched =
false;
1999 bool output_progress = !isendwin() && m->
verbose;
2000 if (output_progress)
2022 snprintf(buf,
sizeof(buf),
"UID FETCH %u %s",
imap_edata_get(e)->uid,
2024 (c_imap_peek ?
"BODY.PEEK[]" :
"BODY[]") :
2052 mutt_error(
_(
"The message index is incorrect. Try reopening the mailbox."));
2099 if (ferror(msg->
fp))
2125 if (read != e->
read)
2132 fgets(buf,
sizeof(buf), msg->
fp);
2133 while (!feof(msg->
fp))
2136 fgets(buf,
sizeof(buf), msg->
fp);
2193 bool close_hc =
true;
2196 if (!
mdata || !adata)
const char * mutt_str_atol(const char *str, long *dst)
Convert ASCII string to a long.
const char * mutt_str_atoui(const char *str, unsigned int *dst)
Convert ASCII string to an unsigned integer.
Body Caching (local copies of email bodies)
int mutt_bcache_commit(struct BodyCache *bcache, const char *id)
Move a temporary file into the Body Cache.
struct BodyCache * mutt_bcache_open(struct ConnAccount *account, const char *mailbox)
Open an Email-Body Cache.
int mutt_bcache_list(struct BodyCache *bcache, bcache_list_t want_id, void *data)
Find matching entries in the Body Cache.
FILE * mutt_bcache_get(struct BodyCache *bcache, const char *id)
Open a file in the Body Cache.
int mutt_bcache_del(struct BodyCache *bcache, const char *id)
Delete a file from the Body Cache.
FILE * mutt_bcache_put(struct BodyCache *bcache, const char *id)
Create a file in the Body Cache.
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.
struct Buffer * mutt_buffer_init(struct Buffer *buf)
Initialise a new Buffer.
size_t mutt_buffer_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
size_t mutt_buffer_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
int mutt_buffer_add_printf(struct Buffer *buf, const char *fmt,...)
Format a string appending a Buffer.
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting 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".
Manage where the email is piped to external commands.
MessageSaveOpt
Message save option.
@ SAVE_MOVE
Move message to another mailbox, removing the original.
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
long cs_subset_long(const struct ConfigSubset *sub, const char *name)
Get a long 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.
void mutt_flushinp(void)
Empty all the keyboard buffers.
int mutt_date_make_imap(char *buf, size_t buflen, time_t timestamp)
Format date in IMAP style: DD-MMM-YYYY HH:MM:SS +ZZzz.
time_t mutt_date_parse_imap(const char *s)
Parse date of the form: DD-MMM-YYYY HH:MM:SS +ZZzz.
struct Email * email_new(void)
Create a new Email.
void email_free(struct Email **ptr)
Free an Email.
Structs that make up an email.
void mutt_env_merge(struct Envelope *base, struct Envelope **extra)
Merge the headers of two Envelopes.
FILE * mutt_file_fopen(const char *path, const char *mode)
Call fopen() safely.
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
static int msg_cache_clean_cb(const char *id, struct BodyCache *bcache, void *data)
Delete an entry from the message cache - Implements bcache_list_t -.
#define mutt_message(...)
#define mutt_debug(LEVEL,...)
int imap_msg_close(struct Mailbox *m, struct Message *msg)
Close an email - Implements MxOps::msg_close() -.
int imap_msg_commit(struct Mailbox *m, struct Message *msg)
Save changes to an email - Implements MxOps::msg_commit() -.
bool imap_msg_open(struct Mailbox *m, struct Message *msg, int msgno)
Open an email message in a Mailbox - Implements MxOps::msg_open() -.
int imap_msg_save_hcache(struct Mailbox *m, struct Email *e)
Save message to the header cache - Implements MxOps::msg_save_hcache() -.
Convenience wrapper for the gui headers.
struct HashTable * mutt_hash_int_new(size_t num_elems, HashFlags flags)
Create a new Hash Table (with integer keys)
void * mutt_hash_int_find(const struct HashTable *table, unsigned int intkey)
Find the HashElem data in a Hash Table element using a key.
struct HashElem * mutt_hash_int_insert(struct HashTable *table, unsigned int intkey, void *data)
Add a new element to the Hash Table (with integer keys)
void mutt_hash_free(struct HashTable **ptr)
Free a hash table.
#define MUTT_HASH_NO_FLAGS
No flags are set.
Header cache multiplexor.
void * mutt_hcache_fetch_raw(struct HeaderCache *hc, const char *key, size_t keylen, size_t *dlen)
Fetch a message's header from the cache.
int mutt_hcache_delete_record(struct HeaderCache *hc, const char *key, size_t keylen)
Multiplexor for StoreOps::delete_record.
int mutt_hcache_store_raw(struct HeaderCache *hc, const char *key, size_t keylen, void *data, size_t dlen)
Store a key / data pair.
void mutt_hcache_free_raw(struct HeaderCache *hc, void **data)
Multiplexor for StoreOps::free.
struct ImapAccountData * imap_adata_get(struct Mailbox *m)
Get the Account data for this mailbox.
int imap_cmd_start(struct ImapAccountData *adata, const char *cmdstr)
Given an IMAP command, send it to the server.
int imap_cmd_step(struct ImapAccountData *adata)
Reads server responses from an IMAP command.
bool imap_code(const char *s)
Was the command successful.
int imap_exec(struct ImapAccountData *adata, const char *cmdstr, ImapCmdFlags flags)
Execute a command and wait for the response from the server.
struct ImapEmailData * imap_edata_new(void)
Create a new ImapEmailData.
struct ImapEmailData * imap_edata_clone(struct ImapEmailData *src)
Clone an ImapEmailData.
struct ImapEmailData * imap_edata_get(struct Email *e)
Get the private data for this Email.
void imap_edata_free(void **ptr)
Free the private Email data - Implements Email::edata_free()
int imap_parse_path(const char *path, struct ConnAccount *cac, char *mailbox, size_t mailboxlen)
Parse an IMAP mailbox name into ConnAccount, name.
struct ImapMboxData * imap_mdata_get(struct Mailbox *m)
Get the Mailbox data for this mailbox.
int imap_cache_clean(struct Mailbox *m)
Delete all the entries in the message cache.
static FILE * msg_cache_put(struct Mailbox *m, struct Email *e)
Put an email into the message cache.
char * imap_set_flags(struct Mailbox *m, struct Email *e, char *s, bool *server_changes)
Fill the message header according to the server flags.
static unsigned int imap_fetch_msn_seqset(struct Buffer *buf, struct ImapAccountData *adata, bool evalhc, unsigned int msn_begin, unsigned int msn_end, unsigned int *fetch_msn_end)
Generate a sequence set.
static int msg_parse_fetch(struct ImapHeader *h, char *s)
Handle headers returned from header fetch.
static struct BodyCache * msg_cache_open(struct Mailbox *m)
Open a message cache.
static int imap_verify_qresync(struct Mailbox *m)
Check to see if QRESYNC got jumbled.
static int flush_buffer(char *buf, size_t *len, struct Connection *conn)
Write data to a connection.
int imap_append_message(struct Mailbox *m, struct Message *msg)
Write an email back to the server.
int imap_copy_messages(struct Mailbox *m, struct EmailList *el, const char *dest, enum MessageSaveOpt save_opt)
Server COPY messages to another folder.
static int msg_fetch_header(struct Mailbox *m, struct ImapHeader *ih, char *buf, FILE *fp)
Import IMAP FETCH response into an ImapHeader.
static int read_headers_condstore_qresync_updates(struct ImapAccountData *adata, unsigned int msn_end, unsigned int uid_next, unsigned long long hc_modseq, bool eval_qresync)
Retrieve updates from the server.
static FILE * msg_cache_get(struct Mailbox *m, struct Email *e)
Get the message cache entry for an email.
static bool query_abort_header_download(struct ImapAccountData *adata)
Ask the user whether to abort the download.
int imap_cache_del(struct Mailbox *m, struct Email *e)
Delete an email from the body cache.
static void set_changed_flag(struct Mailbox *m, struct Email *e, int local_changes, bool *server_changes, enum MessageType flag_name, bool old_hd_flag, bool new_hd_flag, bool h_flag)
Have the flags of an email changed.
static int read_headers_fetch_new(struct Mailbox *m, unsigned int msn_begin, unsigned int msn_end, bool evalhc, unsigned int *maxuid, bool initial_download)
Retrieve new messages from the server.
int imap_read_headers(struct Mailbox *m, unsigned int msn_begin, unsigned int msn_end, bool initial_download)
Read headers from the server.
static int msg_cache_commit(struct Mailbox *m, struct Email *e)
Add to the message cache.
static int read_headers_normal_eval_cache(struct ImapAccountData *adata, unsigned int msn_end, unsigned int uid_next, bool store_flag_updates, bool eval_condstore)
Retrieve data from the header cache.
static char * msg_parse_flags(struct ImapHeader *h, char *s)
Read a FLAGS token into an ImapHeader.
static int read_headers_qresync_eval_cache(struct ImapAccountData *adata, char *uid_seqset)
Retrieve data from the header cache.
static void imap_alloc_uid_hash(struct ImapAccountData *adata, unsigned int msn_count)
Create a Hash Table for the UIDs.
#define IMAP_CMD_NO_FLAGS
No flags are set.
#define IMAP_RES_RESPOND
+
#define IMAP_EXPUNGE_PENDING
Messages on the server have been expunged.
int imap_get_literal_count(const char *buf, unsigned int *bytes)
Write number of bytes in an IMAP literal into bytes.
#define IMAP_RES_OK
<tag> OK ...
int imap_hcache_store_uid_seqset(struct ImapMboxData *mdata)
Store a UID Sequence Set in the header cache.
int imap_hcache_put(struct ImapMboxData *mdata, struct Email *e)
Add an entry to the header cache.
#define IMAP_REOPEN_ALLOW
Allow re-opening a folder upon expunge.
#define IMAP_CAP_IMAP4
Server supports IMAP4.
struct SeqsetIterator * mutt_seqset_iterator_new(const char *seqset)
Create a new Sequence Set Iterator.
#define IMAP_CAP_IMAP4REV1
Server supports IMAP4rev1.
char * imap_hcache_get_uid_seqset(struct ImapMboxData *mdata)
Get a UID Sequence Set from the header cache.
struct Email * imap_hcache_get(struct ImapMboxData *mdata, unsigned int uid)
Get a header cache entry by its UID.
int mutt_seqset_iterator_next(struct SeqsetIterator *iter, unsigned int *next)
Get the next UID from a Sequence Set.
@ IMAP_EXEC_SUCCESS
Imap command executed or queued successfully.
@ IMAP_EXEC_ERROR
Imap command failure.
void mutt_seqset_iterator_free(struct SeqsetIterator **ptr)
Free a Sequence Set Iterator.
char * imap_fix_path(char delim, const char *mailbox, char *path, size_t plen)
Fix up the imap path.
#define IMAP_NEWMAIL_PENDING
New mail is waiting on the server.
void imap_cachepath(char delim, const char *mailbox, struct Buffer *dest)
Generate a cache path for a mailbox.
void imap_error(const char *where, const char *msg)
Show an error and abort.
void imap_hcache_close(struct ImapMboxData *mdata)
Close the header cache.
int imap_hcache_clear_uid_seqset(struct ImapMboxData *mdata)
Delete a UID Sequence Set from the header cache.
bool imap_account_match(const struct ConnAccount *a1, const struct ConnAccount *a2)
Compare two Accounts.
void imap_munge_mbox_name(bool unicode, char *dest, size_t dlen, const char *src)
Quote awkward characters in a mailbox name.
void imap_hcache_open(struct ImapAccountData *adata, struct ImapMboxData *mdata)
Open a header cache.
#define IMAP_RES_CONTINUE
* ...
char * imap_next_word(char *s)
Find where the next IMAP word begins.
#define IMAP_RES_BAD
<tag> BAD ...
#define IMAP_CAP_CONDSTORE
RFC7162.
#define IMAP_CMD_QUEUE
Queue a command, do not execute.
char * imap_get_qualifier(char *buf)
Get the qualifier from a tagged response.
void imap_close_connection(struct ImapAccountData *adata)
Close an IMAP connection.
int imap_exec_msgset(struct Mailbox *m, const char *pre, const char *post, enum MessageType flag, bool changed, bool invert)
Prepare commands for all messages matching conditions.
void imap_expunge_mailbox(struct Mailbox *m, bool resort)
Purge messages from the server.
int imap_create_mailbox(struct ImapAccountData *adata, const char *mailbox)
Create a new mailbox.
int imap_sync_message_for_copy(struct Mailbox *m, struct Email *e, struct Buffer *cmd, enum QuadOption *err_continue)
Update server to reflect the flags of a single message.
int imap_read_literal(FILE *fp, struct ImapAccountData *adata, unsigned long bytes, struct Progress *progress)
Read bytes bytes from server into file.
@ LL_DEBUG3
Log at debug level 3.
@ LL_DEBUG2
Log at debug level 2.
@ LL_DEBUG1
Log at debug level 1.
void mailbox_size_add(struct Mailbox *m, const struct Email *e)
Add an email's size to the total size of a Mailbox.
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
void imap_msn_set(struct MSN *msn, size_t idx, struct Email *e)
Cache an Email into a given position.
void imap_msn_free(struct MSN *msn)
Free the cache.
void imap_msn_reserve(struct MSN *msn, size_t num)
Create / reallocate the cache.
size_t imap_msn_highest(const struct MSN *msn)
Return the highest MSN in use.
struct Email * imap_msn_get(const struct MSN *msn, size_t idx)
Return the Email associated with an msn.
IMAP MSN helper functions.
Convenience wrapper for the library headers.
char * mutt_str_dup(const char *str)
Copy a string, safely.
int mutt_str_asprintf(char **strp, const char *fmt,...)
void mutt_str_append_item(char **str, const char *item, char sep)
Add string to another separated by sep.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
size_t mutt_istr_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix, ignoring case.
char * mutt_str_cat(char *buf, size_t buflen, const char *s)
Concatenate two strings.
Many unsorted constants and some structs.
MessageType
To set flags or match patterns.
@ MUTT_READ
Messages that have been read.
@ MUTT_PURGE
Messages to be purged (bypass trash)
@ MUTT_TAG
Tagged messages.
@ MUTT_FLAG
Flagged messages.
@ MUTT_DELETE
Messages to be deleted.
@ MUTT_REPLIED
Messages that have been replied to.
Hundreds of global variables to back the user variables.
SIG_ATOMIC_VOLATILE_T SigInt
true after SIGINT is received
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
Some miscellaneous functions.
#define mutt_buffer_mktemp(buf)
void mx_alloc_memory(struct Mailbox *m)
Create storage for the emails.
Notmuch-specific Mailbox data.
struct Envelope * mutt_rfc822_read_header(FILE *fp, struct Email *e, bool user_hdrs, bool weed)
Parses an RFC822 header.
static size_t plen
Length of cached packet.
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.
Pop-specific Account data.
@ MUTT_PROGRESS_NET
Progress tracks bytes, according to $net_inc
@ MUTT_PROGRESS_READ
Progress tracks elements, according to $read_inc
void progress_free(struct Progress **ptr)
Free a Progress Bar.
bool progress_update(struct Progress *progress, size_t pos, int percent)
Update the state of the progress bar.
struct Progress * progress_new(const char *msg, enum ProgressType type, size_t size)
Create a new Progress Bar.
Prototypes for many functions.
#define mutt_set_flag(m, e, flag, bf)
QuadOption
Possible values for a quad-option.
@ MUTT_NO
User answered 'No', or assume 'No'.
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
enum QuadOption mutt_yesorno(const char *msg, enum QuadOption def)
Ask the user a Yes/No question.
#define STAILQ_INIT(head)
#define STAILQ_FIRST(head)
#define STAILQ_FOREACH(var, head, field)
#define STAILQ_NEXT(elm, field)
#define mutt_socket_write_n(conn, buf, len)
#define mutt_socket_send(conn, buf)
void * adata
Private data (for Mailbox backends)
Local cache of email bodies.
LOFF_T offset
offset where the actual data begins
LOFF_T length
length (in bytes) of attachment
String manipulation buffer.
char * data
Pointer to data.
Login details for a remote server.
struct ConnAccount account
Account details: username, password, etc.
struct Email * email
Email in the list.
The envelope/body of an email.
struct Envelope * env
Envelope information.
void * edata
Driver-specific data.
int lines
How many lines in the body of this message?
struct Body * body
List of MIME parts.
bool active
Message is not to be removed.
bool old
Email is seen, but unread.
void(* edata_free)(void **ptr)
Free the private data attached to the Email.
bool changed
Email has been edited.
bool attach_del
Has an attachment marked for deletion.
bool flagged
Marked important?
bool replied
Email has been replied to.
struct TagList tags
For drivers that support server tagging.
int msgno
Number displayed to the user.
bool deleted
Email is deleted.
int index
The absolute (unsorted) message number.
time_t received
Time when the message was placed in the mailbox.
IMAP-specific Account data -.
char delim
Path delimiter.
bool qresync
true, if QRESYNC is successfully ENABLE'd
ImapCapFlags capabilities
Capability flags.
struct Mailbox * mailbox
Current selected mailbox.
struct Connection * conn
Connection to IMAP server.
IMAP-specific Email data -.
unsigned int uid
32-bit Message UID
unsigned int msn
Message Sequence Number.
bool deleted
Email has been deleted.
bool old
Email has been seen.
bool read
Email has been read.
bool flagged
Email has been flagged.
bool replied
Email has been replied to.
IMAP-specific Mailbox data -.
ImapOpenFlags reopen
Flags, e.g. IMAP_REOPEN_ALLOW.
struct HeaderCache * hcache
Email header cache.
struct BodyCache * bcache
Email body cache.
unsigned int new_mail_count
Set when EXISTS notifies of new mail.
struct HashTable * uid_hash
int vcount
The number of virtual messages.
bool changed
Mailbox has been modified.
int msg_new
Number of new messages.
int msg_count
Total number of messages.
int email_max
Number of pointers in emails.
void * mdata
Driver specific data.
struct HashTable * subj_hash
Hash Table by subject.
struct Email ** emails
Array of Emails.
struct HashTable * id_hash
Hash Table by msg id.
int msg_deleted
Number of deleted messages.
off_t size
Size of the Mailbox.
struct HashTable * label_hash
Hash Table for x-labels.
int msg_flagged
Number of flagged messages.
bool readonly
Don't allow changes to the mailbox.
int msg_tagged
How many messages are tagged?
bool verbose
Display status messages?
int msg_unread
Number of unread messages.
A local copy of an email.
FILE * fp
pointer to the message data
char * path
path to temp file
bool draft
Message has been read.
bool replied
Message has been replied to.
time_t received
Time at which this message was received.
bool flagged
Message is flagged.
bool read
Message has been read.
struct Message::@0 flags
Flags for the Message.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
UID Sequence Set Iterator.