172 unsigned int uid = 0;
177 if (sscanf(
id,
"%u-%u", &uv, &uid) != 2)
217 edata->deleted =
false;
218 edata->flagged =
false;
219 edata->replied =
false;
224 while (*s && (*s !=
')'))
229 edata->deleted =
true;
234 edata->flagged =
true;
239 edata->replied =
true;
268 if (is_system_keyword)
318 char tmp[128] = { 0 };
352 while (*s && (*s !=
'\"') && (ptmp != (tmp +
sizeof(tmp) - 1)))
365 while (
mutt_isdigit(*s) && (ptmp != (tmp +
sizeof(tmp) - 1)))
386 while (*s && (*s !=
')'))
457 if ((parse_rc != -2) || !fp)
460 unsigned int bytes = 0;
535 struct Mailbox *m,
unsigned int msn_count)
561 struct Mailbox *m,
bool evalhc,
562 unsigned int msn_begin,
unsigned int msn_end,
563 unsigned int *fetch_msn_end)
566 if (msn_end < msn_begin)
573 unsigned int max_headers_per_fetch = UINT_MAX;
574 bool first_chunk =
true;
577 unsigned int range_begin = 0;
578 unsigned int range_end = 0;
579 unsigned int msn_count = 0;
582 if (c_imap_fetch_chunk_size > 0)
583 max_headers_per_fetch = c_imap_fetch_chunk_size;
587 if ((msn_end - msn_begin + 1) <= max_headers_per_fetch)
588 *fetch_msn_end = msn_end;
590 *fetch_msn_end = msn_begin + max_headers_per_fetch - 1;
591 buf_printf(buf,
"%u:%u", msn_begin, *fetch_msn_end);
592 return (*fetch_msn_end - msn_begin + 1);
595 for (msn = msn_begin; msn <= (msn_end + 1); msn++)
597 if ((msn_count < max_headers_per_fetch) && (msn <= msn_end) &&
630 if ((
buf_len(buf) > 500) || (msn_count >= max_headers_per_fetch))
636 *fetch_msn_end = msn - 1;
658 bool old_hd_flag,
bool new_hd_flag,
bool h_flag)
664 if ((old_hd_flag == new_hd_flag) && (local_changes != 0))
667 if (new_hd_flag == h_flag)
671 *server_changes =
true;
674 if (local_changes == 0)
698 struct Mailbox *m,
unsigned int msn_end,
700 bool store_flag_updates,
bool eval_condstore)
702 struct Progress *progress = NULL;
703 char buf[1024] = { 0 };
722 snprintf(buf,
sizeof(buf),
"UID FETCH 1:%u (UID%s)",
uid_next - 1,
723 eval_condstore ?
"" :
" FLAGS");
737 memset(&h, 0,
sizeof(h));
751 mutt_debug(
LL_DEBUG2,
"skipping hcache FETCH response for message number %d missing a UID\n",
813 if (!eval_condstore && store_flag_updates)
819 }
while (mfhrc == -1);
847 struct Mailbox *m,
char *uid_seqset)
850 unsigned int uid = 0;
853 unsigned int msn = 1;
936 struct Mailbox *m,
unsigned int msn_end,
937 unsigned int uid_next,
938 unsigned long long hc_modseq,
bool eval_qresync)
940 struct Progress *progress = NULL;
941 char buf[1024] = { 0 };
942 unsigned int header_msn = 0;
955 snprintf(buf,
sizeof(buf),
"UID FETCH 1:%u (FLAGS) (CHANGEDSINCE %llu%s)",
956 uid_next - 1, hc_modseq, eval_qresync ?
" VANISHED" :
"");
975 char *fetch_buf = adata->
buf;
976 if (fetch_buf[0] !=
'*')
983 if ((header_msn < 1) || (header_msn > msn_end) ||
1048 struct Email *e = NULL;
1049 struct Email *uidh = NULL;
1095 mutt_error(
_(
"QRESYNC failed. Reopening mailbox."));
1114 unsigned int msn_end,
bool evalhc,
1115 unsigned int *maxuid,
bool initial_download)
1118 unsigned int fetch_msn_end = 0;
1119 struct Progress *progress = NULL;
1120 char *hdrreq = NULL;
1121 struct Buffer *tempfile = NULL;
1124 struct Buffer *buf = NULL;
1125 static const char *
const want_headers =
"DATE FROM SENDER SUBJECT TO CC MESSAGE-ID REFERENCES "
1126 "CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO "
1127 "LINES LIST-POST LIST-SUBSCRIBE LIST-UNSUBSCRIBE X-LABEL "
1134 if (!adata || (adata->
mailbox != m) || !mdata)
1164 mutt_error(
_(
"Unable to fetch headers from this IMAP server version"));
1202 while ((fetch_msn_end < msn_end) &&
1211 int msgno = msn_begin;
1216 memset(&h, 0,
sizeof(h));
1298 if (*maxuid < h.edata->uid)
1333 msn_begin = fetch_msn_end + 1;
1364 unsigned int msn_end,
bool initial_download)
1366 unsigned int maxuid = 0;
1368 bool evalhc =
false;
1371 uint32_t uidvalidity = 0;
1372 unsigned int uid_next = 0;
1373 unsigned long long modseq = 0;
1374 bool has_condstore =
false;
1375 bool has_qresync =
false;
1376 bool eval_condstore =
false;
1377 bool eval_qresync =
false;
1378 char *uid_seqset = NULL;
1379 const unsigned int msn_begin_save = msn_begin;
1397 mdata->new_mail_count = 0;
1402 if (
mdata->hcache && initial_download)
1410 has_condstore =
true;
1427 eval_qresync =
true;
1430 if (!eval_qresync && has_condstore)
1431 eval_condstore =
true;
1445 has_condstore || has_qresync, eval_condstore) < 0)
1449 if ((eval_condstore || eval_qresync) && (
modseq !=
mdata->modseq))
1452 modseq, eval_qresync) < 0)
1459 while (msn_begin <= msn_end)
1472 if (eval_qresync && initial_download)
1476 eval_qresync =
false;
1477 eval_condstore =
false;
1484 msn_begin = msn_begin_save;
1491 if (maxuid && (
mdata->uid_next < maxuid + 1))
1492 mdata->uid_next = maxuid + 1;
1496 sizeof(
mdata->uidvalidity));
1497 if (maxuid && (
mdata->uid_next < maxuid + 1))
1500 mdata->uid_next = maxuid + 1;
1502 if (
mdata->uid_next > 1)
1511 if (initial_download)
1513 if (has_condstore || has_qresync)
1559 if (!adata || !
mdata)
1563 char buf[2048] = { 0 };
1564 struct Buffer *internaldate = NULL;
1565 struct Buffer *imap_flags = NULL;
1567 struct Progress *progress = NULL;
1585 for (last = EOF, len = 0; (c = fgetc(fp)) != EOF; last = c)
1587 if ((c ==
'\n') && (last !=
'\r'))
1614 snprintf(buf,
sizeof(buf),
"APPEND %s (%s) \"%s\" {%lu}", mdata->
munge_name,
1615 imap_flags->
data + 1,
buf_string(internaldate), (
unsigned long) len);
1628 for (last = EOF, sent = len = 0; (c = fgetc(fp)) != EOF; last = c)
1630 if ((c ==
'\n') && (last !=
'\r'))
1635 if (len >
sizeof(buf) - 3)
1689 struct Email **ep = NULL;
1692 struct Email *e = *ep;
1729 int triedcreate = 0;
1791 struct Email **ep = NULL;
1794 struct Email *e = *ep;
1831 mutt_message(ngettext(
"Copying %d message to %s...",
"Copying %d messages to %s...", rc),
1849 snprintf(prompt,
sizeof(prompt),
_(
"Create %s?"), mbox);
1851 if (c_confirm_create &&
1872 struct Email **ep = NULL;
1875 struct Email *e = *ep;
1887 return (rc < 0) ? -1 : rc;
1906 char id[64] = { 0 };
1956 int local_changes = e->
changed;
1994 if (local_changes == 0)
2008 char buf[1024] = { 0 };
2012 bool retried =
false;
2018 bool fetched =
false;
2035 bool output_progress = !isendwin() && m->
verbose;
2036 if (output_progress)
2058 snprintf(buf,
sizeof(buf),
"UID FETCH %u %s",
imap_edata_get(e)->uid,
2060 (c_imap_peek ?
"BODY.PEEK[]" :
"BODY[]") :
2088 mutt_error(
_(
"The message index is incorrect. Try reopening the mailbox."));
2131 if (ferror(msg->
fp))
2158 if (read != e->
read)
2165 while (fgets(buf,
sizeof(buf), msg->
fp) && !feof(msg->
fp))
2224 bool close_hc =
true;
2227 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)
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.
void mutt_flushinp(void)
Empty all the keyboard buffers.
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.
Imap-specific Account data.
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.
Imap-specific Email data.
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.
Imap-specific Mailbox data.
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 int msg_parse_fetch(struct ImapHeader *h, char *s)
Handle headers returned from header fetch.
static int read_headers_normal_eval_cache(struct ImapAccountData *adata, struct Mailbox *m, unsigned int msn_end, unsigned int uid_next, bool store_flag_updates, bool eval_condstore)
Retrieve data from the header 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 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, struct Mailbox *m, unsigned int msn_end, unsigned int uid_next, unsigned long long hc_modseq, bool eval_qresync)
Retrieve updates from the server.
static void imap_alloc_uid_hash(struct ImapAccountData *adata, struct Mailbox *m, unsigned int msn_count)
Create a Hash Table for the UIDs.
static int read_headers_qresync_eval_cache(struct ImapAccountData *adata, struct Mailbox *m, char *uid_seqset)
Retrieve data from the header cache.
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 unsigned int imap_fetch_msn_seqset(struct Buffer *buf, struct ImapAccountData *adata, struct Mailbox *m, bool evalhc, unsigned int msn_begin, unsigned int msn_end, unsigned int *fetch_msn_end)
Generate a sequence set.
static char * msg_parse_flags(struct ImapHeader *h, char *s)
Read a FLAGS token into an ImapHeader.
Shared constants/structs that are private to IMAP.
#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.
#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.
int imap_get_literal_count(char *buf, unsigned int *bytes)
Write number of bytes in an IMAP literal into bytes.
#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.
#define IMAP_FLAGS_PENDING
Flags have changed on the server.
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.
#define FREE(x)
Free memory and set the pointer to NULL.
#define MAX(a, b)
Return the maximum of two values.
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.
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.
@ 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.
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
bool unicode
If true, we can send UTF-8, and the server will use UTF8 rather than mUTF7.
ImapCapFlags capabilities
Capability flags.
struct Mailbox * mailbox
Current selected mailbox.
char * buf
Command buffer.
struct Connection * conn
Connection to IMAP server.
IMAP-specific Email data -.
bool parsed
Email has been parsed.
unsigned int uid
32-bit Message UID
unsigned int msn
Message Sequence Number.
char * flags_remote
Remote flags.
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.
char * flags_system
System flags.
IMAP-specific Mailbox data -.
ImapOpenFlags reopen
Flags, e.g. IMAP_REOPEN_ALLOW.
unsigned int uid_next
Next UID for new message.
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
Modification sequence number.
char * munge_name
Munged version of the mailbox name.
uint32_t uidvalidity
UID validity.
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-Label" -> 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
struct Message::@264267271004327071125374067057142037276212342100 flags
Flags for the Message.
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.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
UID Sequence Set Iterator.