83 if (!adata || (adata->
mailbox != m))
110 if (!e || !adata || (adata->
mailbox != m))
131 if (!e || !adata || (adata->
mailbox != m))
152 if (!e || !adata || (adata->
mailbox != m))
172 if (sscanf(
id,
"%u-%u", &uv, &uid) != 2)
212 edata->deleted =
false;
213 edata->flagged =
false;
214 edata->replied =
false;
219 while (*s && (*s !=
')'))
224 edata->deleted =
true;
229 edata->flagged =
true;
234 edata->replied =
true;
256 while (*s && !isspace(*s) && (*s !=
')'))
262 if (is_system_keyword)
305 char tmp[128] = { 0 };
339 while (*s && (*s !=
'\"') && (ptmp != (tmp +
sizeof(tmp) - 1)))
352 while (isdigit((
unsigned char) *s) && (ptmp != (tmp +
sizeof(tmp) - 1)))
373 while (*s && (*s !=
')'))
442 if ((parse_rc != -2) || !fp)
445 unsigned int bytes = 0;
521 if (!
mdata->uid_hash)
543 bool evalhc,
unsigned int msn_begin,
544 unsigned int msn_end,
unsigned int *fetch_msn_end)
547 unsigned int max_headers_per_fetch = UINT_MAX;
548 bool first_chunk =
true;
551 unsigned int range_begin = 0;
552 unsigned int range_end = 0;
553 unsigned int msn_count = 0;
556 if (msn_end < msn_begin)
560 if (c_imap_fetch_chunk_size > 0)
561 max_headers_per_fetch = c_imap_fetch_chunk_size;
565 if (msn_end - msn_begin + 1 <= max_headers_per_fetch)
566 *fetch_msn_end = msn_end;
568 *fetch_msn_end = msn_begin + max_headers_per_fetch - 1;
569 buf_printf(buf,
"%u:%u", msn_begin, *fetch_msn_end);
570 return (*fetch_msn_end - msn_begin + 1);
573 for (msn = msn_begin; msn <= (msn_end + 1); msn++)
575 if (msn_count < max_headers_per_fetch && msn <= msn_end &&
607 if ((
buf_len(buf) > 500) || (msn_count >= max_headers_per_fetch))
613 *fetch_msn_end = msn - 1;
635 bool old_hd_flag,
bool new_hd_flag,
bool h_flag)
641 if ((old_hd_flag == new_hd_flag) && (local_changes != 0))
644 if (new_hd_flag == h_flag)
648 *server_changes =
true;
651 if (local_changes == 0)
674 unsigned int msn_end,
unsigned int uid_next,
675 bool store_flag_updates,
bool eval_condstore)
677 struct Progress *progress = NULL;
678 char buf[1024] = { 0 };
694 snprintf(buf,
sizeof(buf),
"UID FETCH 1:%u (UID%s)",
uid_next - 1,
695 eval_condstore ?
"" :
" FLAGS");
710 memset(&h, 0,
sizeof(h));
724 mutt_debug(
LL_DEBUG2,
"skipping hcache FETCH response for message number %d missing a UID\n",
786 if (!eval_condstore && store_flag_updates)
792 }
while (mfhrc == -1);
821 unsigned int uid = 0;
826 unsigned int msn = 1;
906 unsigned int msn_end,
unsigned int uid_next,
907 unsigned long long hc_modseq,
bool eval_qresync)
909 struct Progress *progress = NULL;
910 char buf[1024] = { 0 };
911 unsigned int header_msn = 0;
922 snprintf(buf,
sizeof(buf),
"UID FETCH 1:%u (FLAGS) (CHANGEDSINCE %llu%s)",
923 uid_next - 1, hc_modseq, eval_qresync ?
" VANISHED" :
"");
943 char *fetch_buf = adata->
buf;
944 if (fetch_buf[0] !=
'*')
948 if (!isdigit((
unsigned char) *fetch_buf) || !
mutt_str_atoui(fetch_buf, &header_msn))
951 if ((header_msn < 1) || (header_msn > msn_end) ||
967 mdata->check_status &= ~IMAP_FLAGS_PENDING;
977 mdata->reopen &= ~IMAP_EXPUNGE_PENDING;
1009 if (!adata || (adata->
mailbox != m))
1016 struct Email *e = NULL;
1017 struct Email *uidh = NULL;
1063 mutt_error(
_(
"QRESYNC failed. Reopening mailbox."));
1082 unsigned int msn_end,
bool evalhc,
1083 unsigned int *maxuid,
bool initial_download)
1086 unsigned int fetch_msn_end = 0;
1087 struct Progress *progress = NULL;
1088 char *hdrreq = NULL;
1089 struct Buffer *tempfile = NULL;
1092 struct Buffer *buf = NULL;
1093 static const char *
const want_headers =
"DATE FROM SENDER SUBJECT TO CC MESSAGE-ID REFERENCES "
1094 "CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO "
1095 "LINES LIST-POST LIST-SUBSCRIBE LIST-UNSUBSCRIBE X-LABEL "
1101 if (!adata || (adata->
mailbox != m))
1131 mutt_error(
_(
"Unable to fetch headers from this IMAP server version"));
1168 while ((fetch_msn_end < msn_end) &&
1177 int msgno = msn_begin;
1182 memset(&h, 0,
sizeof(h));
1270 if (*maxuid < h.edata->uid)
1293 mdata->
reopen &= ~IMAP_NEWMAIL_PENDING;
1306 msn_begin = fetch_msn_end + 1;
1337 unsigned int msn_end,
bool initial_download)
1340 unsigned int maxuid = 0;
1342 bool evalhc =
false;
1345 uint32_t uidvalidity = 0;
1346 unsigned int uid_next = 0;
1347 unsigned long long modseq = 0;
1348 bool has_condstore =
false;
1349 bool has_qresync =
false;
1350 bool eval_condstore =
false;
1351 bool eval_qresync =
false;
1352 char *uid_seqset = NULL;
1353 const unsigned int msn_begin_save = msn_begin;
1358 if (!adata || (adata->
mailbox != m))
1373 mdata->new_mail_count = 0;
1378 if (
mdata->hcache && initial_download)
1386 has_condstore =
true;
1403 eval_qresync =
true;
1406 if (!eval_qresync && has_condstore)
1407 eval_condstore =
true;
1421 eval_condstore) < 0)
1425 if ((eval_condstore || eval_qresync) && (
modseq !=
mdata->modseq))
1428 modseq, eval_qresync) < 0)
1435 while (msn_begin <= msn_end)
1448 if (eval_qresync && initial_download)
1452 eval_qresync =
false;
1453 eval_condstore =
false;
1460 msn_begin = msn_begin_save;
1467 if (maxuid && (
mdata->uid_next < maxuid + 1))
1468 mdata->uid_next = maxuid + 1;
1472 sizeof(
mdata->uidvalidity));
1473 if (maxuid && (
mdata->uid_next < maxuid + 1))
1476 mdata->uid_next = maxuid + 1;
1478 if (
mdata->uid_next > 1)
1481 sizeof(
mdata->uid_next));
1488 if (initial_download)
1490 if (has_condstore || has_qresync)
1493 sizeof(
mdata->modseq));
1542 char imap_flags[128] = { 0 };
1544 struct Progress *progress = NULL;
1552 fp = fopen(msg->
path,
"r");
1565 for (last = EOF, len = 0; (c = fgetc(fp)) != EOF; last = c)
1567 if ((c ==
'\n') && (last !=
'\r'))
1579 imap_flags[0] =
'\0';
1580 imap_flags[1] =
'\0';
1583 mutt_str_cat(imap_flags,
sizeof(imap_flags),
" \\Seen");
1585 mutt_str_cat(imap_flags,
sizeof(imap_flags),
" \\Answered");
1587 mutt_str_cat(imap_flags,
sizeof(imap_flags),
" \\Flagged");
1589 mutt_str_cat(imap_flags,
sizeof(imap_flags),
" \\Draft");
1591 snprintf(buf,
sizeof(buf),
"APPEND %s (%s) \"%s\" {%lu}",
mdata->munge_name,
1592 imap_flags + 1, internaldate, (
unsigned long) len);
1604 for (last = EOF, sent = len = 0; (c = fgetc(fp)) != EOF; last = c)
1606 if ((c ==
'\n') && (last !=
'\r'))
1611 if (len >
sizeof(buf) - 3)
1672 struct Buffer cmd, sync_cmd;
1680 int triedcreate = 0;
1741 struct Email **ep = NULL;
1744 struct Email *e = *ep;
1776 mutt_message(ngettext(
"Copying %d message to %s...",
"Copying %d messages to %s...", rc),
1794 snprintf(prompt,
sizeof(prompt),
_(
"Create %s?"), mbox);
1816 struct Email **ep = NULL;
1819 struct Email *e = *ep;
1831 return (rc < 0) ? -1 : rc;
1846 if (!e || !adata || (adata->
mailbox != m))
1850 char id[64] = { 0 };
1865 if (!adata || (adata->
mailbox != m))
1900 int local_changes = e->
changed;
1938 if (local_changes == 0)
1952 char buf[1024] = { 0 };
1956 bool retried =
false;
1962 bool fetched =
false;
1979 bool output_progress = !isendwin() && m->
verbose;
1980 if (output_progress)
2002 snprintf(buf,
sizeof(buf),
"UID FETCH %u %s",
imap_edata_get(e)->uid,
2004 (c_imap_peek ?
"BODY.PEEK[]" :
"BODY[]") :
2032 mutt_error(
_(
"The message index is incorrect. Try reopening the mailbox."));
2075 if (ferror(msg->
fp))
2101 if (read != e->
read)
2108 while (fgets(buf,
sizeof(buf), msg->
fp) && !feof(msg->
fp))
2167 bool close_hc =
true;
2170 if (!
mdata || !adata)
#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_GET(head, idx)
Return the element at index.
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.
struct Buffer * buf_init(struct Buffer *buf)
Initialise a new 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.
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
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 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.
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.
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)
void mutt_set_flag(struct Mailbox *m, struct Email *e, enum MessageType flag, bool bf, bool upd_mbox)
Set a flag on an email.
SIG_ATOMIC_VOLATILE_T SigInt
true after SIGINT is received
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, 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() -.
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.
#define mutt_hcache_fetch_obj(hc, key, keylen, dst)
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.
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.
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.
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.
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.
int imap_exec_msg_set(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_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.
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.
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.
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
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.
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
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.
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 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)
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
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.
int email_max
Number of pointers in emails.
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.