85 if (!adata || (adata->
mailbox != m))
112 if (!e || !adata || (adata->
mailbox != m))
133 if (!e || !adata || (adata->
mailbox != m))
154 if (!e || !adata || (adata->
mailbox != m))
171 unsigned int uid = 0;
174 if (sscanf(
id,
"%u-%u", &uv, &uid) != 2)
214 edata->deleted =
false;
215 edata->flagged =
false;
216 edata->replied =
false;
221 while (*s && (*s !=
')'))
226 edata->deleted =
true;
231 edata->flagged =
true;
236 edata->replied =
true;
265 if (is_system_keyword)
313 char tmp[128] = { 0 };
347 while (*s && (*s !=
'\"') && (ptmp != (tmp +
sizeof(tmp) - 1)))
360 while (
mutt_isdigit(*s) && (ptmp != (tmp +
sizeof(tmp) - 1)))
381 while (*s && (*s !=
')'))
450 if ((parse_rc != -2) || !fp)
453 unsigned int bytes = 0;
529 if (!
mdata->uid_hash)
551 bool evalhc,
unsigned int msn_begin,
552 unsigned int msn_end,
unsigned int *fetch_msn_end)
555 unsigned int max_headers_per_fetch = UINT_MAX;
556 bool first_chunk =
true;
559 unsigned int range_begin = 0;
560 unsigned int range_end = 0;
561 unsigned int msn_count = 0;
564 if (msn_end < msn_begin)
568 if (c_imap_fetch_chunk_size > 0)
569 max_headers_per_fetch = c_imap_fetch_chunk_size;
573 if ((msn_end - msn_begin + 1) <= max_headers_per_fetch)
574 *fetch_msn_end = msn_end;
576 *fetch_msn_end = msn_begin + max_headers_per_fetch - 1;
577 buf_printf(buf,
"%u:%u", msn_begin, *fetch_msn_end);
578 return (*fetch_msn_end - msn_begin + 1);
581 for (msn = msn_begin; msn <= (msn_end + 1); msn++)
583 if ((msn_count < max_headers_per_fetch) && (msn <= msn_end) &&
616 if ((
buf_len(buf) > 500) || (msn_count >= max_headers_per_fetch))
622 *fetch_msn_end = msn - 1;
644 bool old_hd_flag,
bool new_hd_flag,
bool h_flag)
650 if ((old_hd_flag == new_hd_flag) && (local_changes != 0))
653 if (new_hd_flag == h_flag)
657 *server_changes =
true;
660 if (local_changes == 0)
683 unsigned int msn_end,
unsigned int uid_next,
684 bool store_flag_updates,
bool eval_condstore)
686 struct Progress *progress = NULL;
687 char buf[1024] = { 0 };
704 snprintf(buf,
sizeof(buf),
"UID FETCH 1:%u (UID%s)",
uid_next - 1,
705 eval_condstore ?
"" :
" FLAGS");
719 memset(&h, 0,
sizeof(h));
733 mutt_debug(
LL_DEBUG2,
"skipping hcache FETCH response for message number %d missing a UID\n",
795 if (!eval_condstore && store_flag_updates)
801 }
while (mfhrc == -1);
830 unsigned int uid = 0;
835 unsigned int msn = 1;
914 unsigned int msn_end,
unsigned int uid_next,
915 unsigned long long hc_modseq,
bool eval_qresync)
917 struct Progress *progress = NULL;
918 char buf[1024] = { 0 };
919 unsigned int header_msn = 0;
931 snprintf(buf,
sizeof(buf),
"UID FETCH 1:%u (FLAGS) (CHANGEDSINCE %llu%s)",
932 uid_next - 1, hc_modseq, eval_qresync ?
" VANISHED" :
"");
951 char *fetch_buf = adata->
buf;
952 if (fetch_buf[0] !=
'*')
959 if ((header_msn < 1) || (header_msn > msn_end) ||
975 mdata->check_status &= ~IMAP_FLAGS_PENDING;
985 mdata->reopen &= ~IMAP_EXPUNGE_PENDING;
1017 if (!adata || (adata->
mailbox != m))
1024 struct Email *e = NULL;
1025 struct Email *uidh = NULL;
1071 mutt_error(
_(
"QRESYNC failed. Reopening mailbox."));
1090 unsigned int msn_end,
bool evalhc,
1091 unsigned int *maxuid,
bool initial_download)
1094 unsigned int fetch_msn_end = 0;
1095 struct Progress *progress = NULL;
1096 char *hdrreq = NULL;
1097 struct Buffer *tempfile = NULL;
1100 struct Buffer *buf = NULL;
1101 static const char *
const want_headers =
"DATE FROM SENDER SUBJECT TO CC MESSAGE-ID REFERENCES "
1102 "CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO "
1103 "LINES LIST-POST LIST-SUBSCRIBE LIST-UNSUBSCRIBE X-LABEL "
1110 if (!adata || (adata->
mailbox != m))
1140 mutt_error(
_(
"Unable to fetch headers from this IMAP server version"));
1178 while ((fetch_msn_end < msn_end) &&
1187 int msgno = msn_begin;
1192 memset(&h, 0,
sizeof(h));
1274 if (*maxuid < h.edata->uid)
1296 mdata->
reopen &= ~IMAP_NEWMAIL_PENDING;
1309 msn_begin = fetch_msn_end + 1;
1340 unsigned int msn_end,
bool initial_download)
1342 unsigned int maxuid = 0;
1344 bool evalhc =
false;
1347 uint32_t uidvalidity = 0;
1348 unsigned int uid_next = 0;
1349 unsigned long long modseq = 0;
1350 bool has_condstore =
false;
1351 bool has_qresync =
false;
1352 bool eval_condstore =
false;
1353 bool eval_qresync =
false;
1354 char *uid_seqset = NULL;
1355 const unsigned int msn_begin_save = msn_begin;
1360 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)
1487 if (initial_download)
1489 if (has_condstore || has_qresync)
1534 char buf[2048] = { 0 };
1535 struct Buffer *internaldate = NULL;
1536 struct Buffer *imap_flags = NULL;
1538 struct Progress *progress = NULL;
1559 for (last = EOF, len = 0; (c = fgetc(fp)) != EOF; last = c)
1561 if ((c ==
'\n') && (last !=
'\r'))
1588 snprintf(buf,
sizeof(buf),
"APPEND %s (%s) \"%s\" {%lu}",
mdata->munge_name,
1589 imap_flags->
data + 1,
buf_string(internaldate), (
unsigned long) len);
1602 for (last = EOF, sent = len = 0; (c = fgetc(fp)) != EOF; last = c)
1604 if ((c ==
'\n') && (last !=
'\r'))
1609 if (len >
sizeof(buf) - 3)
1663 struct Email **ep = NULL;
1666 struct Email *e = *ep;
1699 int triedcreate = 0;
1762 struct Email **ep = NULL;
1765 struct Email *e = *ep;
1802 mutt_message(ngettext(
"Copying %d message to %s...",
"Copying %d messages to %s...", rc),
1820 snprintf(prompt,
sizeof(prompt),
_(
"Create %s?"), mbox);
1822 if (c_confirm_create &&
1843 struct Email **ep = NULL;
1846 struct Email *e = *ep;
1858 return (rc < 0) ? -1 : rc;
1873 if (!e || !adata || (adata->
mailbox != m))
1877 char id[64] = { 0 };
1892 if (!adata || (adata->
mailbox != m))
1927 int local_changes = e->
changed;
1965 if (local_changes == 0)
1979 char buf[1024] = { 0 };
1983 bool retried =
false;
1989 bool fetched =
false;
2006 bool output_progress = !isendwin() && m->
verbose;
2007 if (output_progress)
2029 snprintf(buf,
sizeof(buf),
"UID FETCH %u %s",
imap_edata_get(e)->uid,
2031 (c_imap_peek ?
"BODY.PEEK[]" :
"BODY[]") :
2059 mutt_error(
_(
"The message index is incorrect. Try reopening the mailbox."));
2102 if (ferror(msg->
fp))
2129 if (read != e->
read)
2136 while (fgets(buf,
sizeof(buf), msg->
fp) && !feof(msg->
fp))
2195 bool close_hc =
true;
2198 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.
bool mutt_isspace(int arg)
Wrapper for isspace(3)
bool mutt_isdigit(int arg)
Wrapper for isdigit(3)
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.
struct Email * imap_msn_get(const struct MSNArray *msn, int idx)
Return the Email associated with an msn.
size_t imap_msn_highest(const struct MSNArray *msn)
Return the highest MSN in use.
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.