86 if (!adata || (adata->
mailbox != m))
113 if (!e || !adata || (adata->
mailbox != m))
134 if (!e || !adata || (adata->
mailbox != m))
155 if (!e || !adata || (adata->
mailbox != m))
172 unsigned int uid = 0;
175 if (sscanf(
id,
"%u-%u", &uv, &uid) != 2)
215 edata->deleted =
false;
216 edata->flagged =
false;
217 edata->replied =
false;
222 while (*s && (*s !=
')'))
227 edata->deleted =
true;
232 edata->flagged =
true;
237 edata->replied =
true;
259 while (*s && !isspace(*s) && (*s !=
')'))
266 if (is_system_keyword)
314 char tmp[128] = { 0 };
348 while (*s && (*s !=
'\"') && (ptmp != (tmp +
sizeof(tmp) - 1)))
361 while (isdigit((
unsigned char) *s) && (ptmp != (tmp +
sizeof(tmp) - 1)))
382 while (*s && (*s !=
')'))
451 if ((parse_rc != -2) || !fp)
454 unsigned int bytes = 0;
530 if (!
mdata->uid_hash)
552 bool evalhc,
unsigned int msn_begin,
553 unsigned int msn_end,
unsigned int *fetch_msn_end)
556 unsigned int max_headers_per_fetch = UINT_MAX;
557 bool first_chunk =
true;
560 unsigned int range_begin = 0;
561 unsigned int range_end = 0;
562 unsigned int msn_count = 0;
565 if (msn_end < msn_begin)
569 if (c_imap_fetch_chunk_size > 0)
570 max_headers_per_fetch = c_imap_fetch_chunk_size;
574 if ((msn_end - msn_begin + 1) <= max_headers_per_fetch)
575 *fetch_msn_end = msn_end;
577 *fetch_msn_end = msn_begin + max_headers_per_fetch - 1;
578 buf_printf(buf,
"%u:%u", msn_begin, *fetch_msn_end);
579 return (*fetch_msn_end - msn_begin + 1);
582 for (msn = msn_begin; msn <= (msn_end + 1); msn++)
584 if ((msn_count < max_headers_per_fetch) && (msn <= msn_end) &&
617 if ((
buf_len(buf) > 500) || (msn_count >= max_headers_per_fetch))
623 *fetch_msn_end = msn - 1;
645 bool old_hd_flag,
bool new_hd_flag,
bool h_flag)
651 if ((old_hd_flag == new_hd_flag) && (local_changes != 0))
654 if (new_hd_flag == h_flag)
658 *server_changes =
true;
661 if (local_changes == 0)
684 unsigned int msn_end,
unsigned int uid_next,
685 bool store_flag_updates,
bool eval_condstore)
687 struct Progress *progress = NULL;
688 char buf[1024] = { 0 };
705 snprintf(buf,
sizeof(buf),
"UID FETCH 1:%u (UID%s)",
uid_next - 1,
706 eval_condstore ?
"" :
" FLAGS");
720 memset(&h, 0,
sizeof(h));
734 mutt_debug(
LL_DEBUG2,
"skipping hcache FETCH response for message number %d missing a UID\n",
796 if (!eval_condstore && store_flag_updates)
802 }
while (mfhrc == -1);
831 unsigned int uid = 0;
836 unsigned int msn = 1;
915 unsigned int msn_end,
unsigned int uid_next,
916 unsigned long long hc_modseq,
bool eval_qresync)
918 struct Progress *progress = NULL;
919 char buf[1024] = { 0 };
920 unsigned int header_msn = 0;
932 snprintf(buf,
sizeof(buf),
"UID FETCH 1:%u (FLAGS) (CHANGEDSINCE %llu%s)",
933 uid_next - 1, hc_modseq, eval_qresync ?
" VANISHED" :
"");
952 char *fetch_buf = adata->
buf;
953 if (fetch_buf[0] !=
'*')
957 if (!isdigit((
unsigned char) *fetch_buf) || !
mutt_str_atoui(fetch_buf, &header_msn))
960 if ((header_msn < 1) || (header_msn > msn_end) ||
976 mdata->check_status &= ~IMAP_FLAGS_PENDING;
986 mdata->reopen &= ~IMAP_EXPUNGE_PENDING;
1018 if (!adata || (adata->
mailbox != m))
1025 struct Email *e = NULL;
1026 struct Email *uidh = NULL;
1072 mutt_error(
_(
"QRESYNC failed. Reopening mailbox."));
1091 unsigned int msn_end,
bool evalhc,
1092 unsigned int *maxuid,
bool initial_download)
1095 unsigned int fetch_msn_end = 0;
1096 struct Progress *progress = NULL;
1097 char *hdrreq = NULL;
1098 struct Buffer *tempfile = NULL;
1101 struct Buffer *buf = NULL;
1102 static const char *
const want_headers =
"DATE FROM SENDER SUBJECT TO CC MESSAGE-ID REFERENCES "
1103 "CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO "
1104 "LINES LIST-POST LIST-SUBSCRIBE LIST-UNSUBSCRIBE X-LABEL "
1111 if (!adata || (adata->
mailbox != m))
1141 mutt_error(
_(
"Unable to fetch headers from this IMAP server version"));
1179 while ((fetch_msn_end < msn_end) &&
1188 int msgno = msn_begin;
1193 memset(&h, 0,
sizeof(h));
1275 if (*maxuid < h.edata->uid)
1297 mdata->
reopen &= ~IMAP_NEWMAIL_PENDING;
1310 msn_begin = fetch_msn_end + 1;
1341 unsigned int msn_end,
bool initial_download)
1343 unsigned int maxuid = 0;
1345 bool evalhc =
false;
1348 uint32_t uidvalidity = 0;
1349 unsigned int uid_next = 0;
1350 unsigned long long modseq = 0;
1351 bool has_condstore =
false;
1352 bool has_qresync =
false;
1353 bool eval_condstore =
false;
1354 bool eval_qresync =
false;
1355 char *uid_seqset = NULL;
1356 const unsigned int msn_begin_save = msn_begin;
1361 if (!adata || (adata->
mailbox != m))
1374 mdata->new_mail_count = 0;
1379 if (
mdata->hcache && initial_download)
1387 has_condstore =
true;
1404 eval_qresync =
true;
1407 if (!eval_qresync && has_condstore)
1408 eval_condstore =
true;
1422 eval_condstore) < 0)
1426 if ((eval_condstore || eval_qresync) && (
modseq !=
mdata->modseq))
1429 modseq, eval_qresync) < 0)
1436 while (msn_begin <= msn_end)
1449 if (eval_qresync && initial_download)
1453 eval_qresync =
false;
1454 eval_condstore =
false;
1461 msn_begin = msn_begin_save;
1468 if (maxuid && (
mdata->uid_next < maxuid + 1))
1469 mdata->uid_next = maxuid + 1;
1473 sizeof(
mdata->uidvalidity));
1474 if (maxuid && (
mdata->uid_next < maxuid + 1))
1477 mdata->uid_next = maxuid + 1;
1479 if (
mdata->uid_next > 1)
1488 if (initial_download)
1490 if (has_condstore || has_qresync)
1535 char buf[2048] = { 0 };
1536 struct Buffer *internaldate = NULL;
1537 struct Buffer *imap_flags = NULL;
1539 struct Progress *progress = NULL;
1560 for (last = EOF, len = 0; (c = fgetc(fp)) != EOF; last = c)
1562 if ((c ==
'\n') && (last !=
'\r'))
1589 snprintf(buf,
sizeof(buf),
"APPEND %s (%s) \"%s\" {%lu}",
mdata->munge_name,
1590 imap_flags->
data + 1,
buf_string(internaldate), (
unsigned long) len);
1603 for (last = EOF, sent = len = 0; (c = fgetc(fp)) != EOF; last = c)
1605 if ((c ==
'\n') && (last !=
'\r'))
1610 if (len >
sizeof(buf) - 3)
1664 struct Email **ep = NULL;
1667 struct Email *e = *ep;
1700 int triedcreate = 0;
1763 struct Email **ep = NULL;
1766 struct Email *e = *ep;
1803 mutt_message(ngettext(
"Copying %d message to %s...",
"Copying %d messages to %s...", rc),
1821 snprintf(prompt,
sizeof(prompt),
_(
"Create %s?"), mbox);
1823 if (c_confirm_create &&
1844 struct Email **ep = NULL;
1847 struct Email *e = *ep;
1859 return (rc < 0) ? -1 : rc;
1874 if (!e || !adata || (adata->
mailbox != m))
1878 char id[64] = { 0 };
1893 if (!adata || (adata->
mailbox != m))
1928 int local_changes = e->
changed;
1966 if (local_changes == 0)
1980 char buf[1024] = { 0 };
1984 bool retried =
false;
1990 bool fetched =
false;
2007 bool output_progress = !isendwin() && m->
verbose;
2008 if (output_progress)
2030 snprintf(buf,
sizeof(buf),
"UID FETCH %u %s",
imap_edata_get(e)->uid,
2032 (c_imap_peek ?
"BODY.PEEK[]" :
"BODY[]") :
2060 mutt_error(
_(
"The message index is incorrect. Try reopening the mailbox."));
2103 if (ferror(msg->
fp))
2130 if (read != e->
read)
2137 while (fgets(buf,
sizeof(buf), msg->
fp) && !feof(msg->
fp))
2196 bool close_hc =
true;
2199 if (!
mdata || !adata)
#define ARRAY_SORT(head, fn, sdata)
Sort an array.
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_EMPTY(head)
Check if an array is empty.
#define ARRAY_SIZE(head)
The number of elements stored.
#define ARRAY_FREE(head)
Release all memory.
#define ARRAY_GET(head, idx)
Return the element at index.
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
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.
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
int buf_add_printf(struct Buffer *buf, const char *fmt,...)
Format a string appending a Buffer.
size_t buf_len(const struct Buffer *buf)
Calculate the length of a Buffer.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
size_t buf_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
void buf_join_str(struct Buffer *buf, const char *str, char sep)
Join a buffer with a string separated by sep.
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
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 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 mutt_flushinp(void)
Empty all the keyboard buffers.
struct Email * email_new(void)
Create a new Email.
void email_free(struct Email **ptr)
Free an Email.
Structs that make up an email.
struct Envelope * mutt_rfc822_read_header(FILE *fp, struct Email *e, bool user_hdrs, bool weed)
Parses an RFC822 header.
void mutt_env_merge(struct Envelope *base, struct Envelope **extra)
Merge the headers of two Envelopes.
Manage where the email is piped to external commands.
MessageSaveOpt
Message save option.
@ SAVE_MOVE
Move message to another mailbox, removing the original.
#define mutt_file_fclose(FP)
#define mutt_file_fopen(PATH, MODE)
void mutt_set_flag(struct Mailbox *m, struct Email *e, enum MessageType flag, bool bf, bool upd_mbox)
Set a flag on an email.
static int imap_bcache_delete(const char *id, struct BodyCache *bcache, void *data)
Delete an entry from the message cache - Implements bcache_list_t -.
void imap_edata_free(void **ptr)
Free the private Email data - Implements Email::edata_free() -.
#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, struct Email *e)
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() -.
int imap_sort_uid(const void *a, const void *b, void *sdata)
Compare two UIDs - Implements sort_t -.
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.
int hcache_delete_raw(struct HeaderCache *hc, const char *key, size_t keylen)
Multiplexor for StoreOps::delete_record.
int hcache_store_raw(struct HeaderCache *hc, const char *key, size_t keylen, void *data, size_t dlen)
Store a key / data pair.
Header cache multiplexor.
#define hcache_fetch_raw_obj(hc, key, keylen, dst)
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.
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 struct BodyCache * imap_bcache_open(struct Mailbox *m)
Open a 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 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.
static int emails_to_uid_array(struct EmailArray *ea, struct UidArray *uida)
Extract IMAP UIDs from Emails.
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.
int imap_copy_messages(struct Mailbox *m, struct EmailArray *ea, const char *dest, enum MessageSaveOpt save_opt)
Server COPY messages to another folder.
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.
void imap_hcache_open(struct ImapAccountData *adata, struct ImapMboxData *mdata, bool create)
Open a header cache.
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.
#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.
char * imap_fix_path_with_delim(char delim, const char *mailbox, char *path, size_t plen)
Fix up the imap path.
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.
#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.
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.
int imap_exec_msg_set(struct ImapAccountData *adata, const char *pre, const char *post, struct UidArray *uida)
Execute a command using a set of UIDs.
void imap_msn_free(struct MSNArray *msn)
Free the cache.
size_t imap_msn_highest(const struct MSNArray *msn)
Return the highest MSN in use.
struct Email * imap_msn_get(const struct MSNArray *msn, size_t idx)
Return the Email associated with an msn.
void imap_msn_set(struct MSNArray *msn, size_t idx, struct Email *e)
Cache an Email into a given position.
void imap_msn_reserve(struct MSNArray *msn, size_t num)
Create / reallocate the cache.
IMAP MSN helper functions.
int mutt_date_make_imap(struct Buffer *buf, 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.
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,...)
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.
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_FLAG
Flagged messages.
@ MUTT_DELETE
Messages to be deleted.
@ MUTT_REPLIED
Messages that have been replied to.
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
void mx_alloc_memory(struct Mailbox *m, int req_size)
Create storage for the emails.
Notmuch-specific Mailbox data.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to 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
struct Progress * progress_new(enum ProgressType type, size_t size)
Create a new Progress Bar.
void progress_free(struct Progress **ptr)
Free a Progress Bar.
void progress_set_message(struct Progress *progress, const char *fmt,...) __attribute__((__format__(__printf__
bool progress_update(struct Progress *progress, size_t pos, int percent)
Update the state of the progress bar.
Prototypes for many functions.
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 query_yesorno_help(const char *prompt, enum QuadOption def, struct ConfigSubset *sub, const char *name)
Ask the user a Yes/No question offering help.
enum QuadOption query_yesorno(const char *prompt, enum QuadOption def)
Ask the user a Yes/No question.
#define STAILQ_INIT(head)
volatile sig_atomic_t SigInt
true after SIGINT is received
#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.
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)
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.
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
Hash Table: "uid" -> Email.
unsigned long long modseq
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.
void * mdata
Driver specific data.
struct HashTable * subj_hash
Hash Table: "subject" -> Email.
struct Email ** emails
Array of Emails.
struct HashTable * id_hash
Hash Table: "message-id" -> Email.
int msg_deleted
Number of deleted messages.
off_t size
Size of the Mailbox.
struct HashTable * label_hash
Hash Table: "x-labels" -> Email.
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.