NeoMutt  2020-08-21-74-g346364
Teaching an old dog new tricks
DOXYGEN
private.h
Go to the documentation of this file.
1 
25 #ifndef MUTT_IMAP_PRIVATE_H
26 #define MUTT_IMAP_PRIVATE_H
27 
28 #include "config.h"
29 #include <stdbool.h>
30 #include <stdint.h>
31 #include <stdio.h>
32 #include <time.h>
33 #include "mutt/lib.h"
34 #include "config/lib.h"
35 #include "hcache/lib.h"
36 
37 struct Account;
38 struct ConnAccount;
39 struct Email;
40 struct Mailbox;
41 struct Message;
42 struct MSN;
43 struct Progress;
44 
45 #define IMAP_PORT 143
46 #define IMAP_SSL_PORT 993
47 
48 /* logging levels */
49 #define IMAP_LOG_CMD 2
50 #define IMAP_LOG_LTRL 3
51 #define IMAP_LOG_PASS 5
52 
53 /* IMAP command responses. Used in ImapCommand.state too */
54 #define IMAP_RES_NO -2
55 #define IMAP_RES_BAD -1
56 #define IMAP_RES_OK 0
57 #define IMAP_RES_CONTINUE 1
58 #define IMAP_RES_RESPOND 2
59 #define IMAP_RES_NEW 3
60 
61 #define SEQ_LEN 16
62 #define IMAP_MAX_CMDLEN 1024
63 
64 typedef uint8_t ImapOpenFlags;
65 #define IMAP_OPEN_NO_FLAGS 0
66 #define IMAP_REOPEN_ALLOW (1 << 0)
67 #define IMAP_EXPUNGE_EXPECTED (1 << 1)
68 #define IMAP_EXPUNGE_PENDING (1 << 2)
69 #define IMAP_NEWMAIL_PENDING (1 << 3)
70 #define IMAP_FLAGS_PENDING (1 << 4)
71 
72 typedef uint8_t ImapCmdFlags;
73 #define IMAP_CMD_NO_FLAGS 0
74 #define IMAP_CMD_PASS (1 << 0)
75 #define IMAP_CMD_QUEUE (1 << 1)
76 #define IMAP_CMD_POLL (1 << 2)
77 #define IMAP_CMD_SINGLE (1 << 3)
78 
79 
83 {
87 };
88 
89 /* length of "DD-MMM-YYYY HH:MM:SS +ZZzz" (null-terminated) */
90 #define IMAP_DATELEN 27
91 
96 {
97  IMAP_FATAL = 1,
99 };
100 
105 {
106  /* States */
111 
112  /* and pseudo-states */
114 };
115 
121 typedef uint32_t ImapCapFlags;
122 #define IMAP_CAP_NO_FLAGS 0
123 #define IMAP_CAP_IMAP4 (1 << 0)
124 #define IMAP_CAP_IMAP4REV1 (1 << 1)
125 #define IMAP_CAP_STATUS (1 << 2)
126 #define IMAP_CAP_ACL (1 << 3)
127 #define IMAP_CAP_NAMESPACE (1 << 4)
128 #define IMAP_CAP_AUTH_CRAM_MD5 (1 << 5)
129 #define IMAP_CAP_AUTH_GSSAPI (1 << 6)
130 #define IMAP_CAP_AUTH_ANONYMOUS (1 << 7)
131 #define IMAP_CAP_AUTH_OAUTHBEARER (1 << 8)
132 #define IMAP_CAP_STARTTLS (1 << 9)
133 #define IMAP_CAP_LOGINDISABLED (1 << 10)
134 #define IMAP_CAP_IDLE (1 << 11)
135 #define IMAP_CAP_SASL_IR (1 << 12)
136 #define IMAP_CAP_ENABLE (1 << 13)
137 #define IMAP_CAP_CONDSTORE (1 << 14)
138 #define IMAP_CAP_QRESYNC (1 << 15)
139 #define IMAP_CAP_LIST_EXTENDED (1 << 16)
140 #define IMAP_CAP_COMPRESS (1 << 17)
141 #define IMAP_CAP_X_GM_EXT_1 (1 << 18)
142 
143 #define IMAP_CAP_ALL ((1 << 19) - 1)
144 
148 struct ImapList
149 {
150  char *name;
151  char delim;
152  bool noselect;
154 };
155 
160 {
161  char seq[SEQ_LEN + 1];
162  int state;
163 };
164 
171 {
172  struct Connection *conn;
174  bool closing;
175  unsigned char state;
176  unsigned char status;
177  /* let me explain capstr: SASL needs the capability string (not bits).
178  * we have 3 options:
179  * 1. rerun CAPABILITY inside SASL function.
180  * 2. build appropriate CAPABILITY string by reverse-engineering from bits.
181  * 3. keep a copy until after authentication.
182  * I've chosen (3) for now. (2) might not be too bad, but it involves
183  * tracking all possible capabilities. bah. (1) I don't like because
184  * it's just no fun to get the same information twice */
185  char *capstr;
187  unsigned char seqid;
188  unsigned int seqno;
189  time_t lastread;
190  char *buf;
191  size_t blen;
192 
193  bool unicode;
194  bool qresync;
195 
196  // if set, the response parser will store results for complicated commands here
198 
199  /* command queue */
200  struct ImapCommand *cmds;
201  int cmdslots;
202  int nextcmd;
203  int lastcmd;
204  struct Buffer cmdbuf;
205 
206  char delim;
207  struct Mailbox *mailbox;
209  struct Account *account;
210 };
211 
218 {
219  char *name;
220  char *munge_name;
221  char *real_name;
222 
225  unsigned int new_mail_count;
226 
227  // IMAP STATUS information
228  struct ListHead flags;
229  uint32_t uidvalidity;
230  unsigned int uid_next;
231  unsigned long long modseq;
232  unsigned int messages;
233  unsigned int recent;
234  unsigned int unseen;
235 
236  // Cached data used only when the mailbox is opened
238  ARRAY_HEAD(MSN, struct Email *) msn;
239  struct BodyCache *bcache;
240 
242 };
243 
248 {
249  char *full_seqset;
250  char *eostr;
251  int in_range;
252  int down;
253  unsigned int range_cur;
254  unsigned int range_end;
255  char *substr_cur;
256  char *substr_end;
257 };
258 
259 extern struct Slist *C_ImapAuthenticators;
260 extern bool C_ImapCheckSubscribed;
261 extern bool C_ImapCondstore;
262 #ifdef USE_ZLIB
263 extern bool C_ImapDeflate;
264 #endif
265 extern char * C_ImapDelimChars;
266 extern long C_ImapFetchChunkSize;
267 extern char * C_ImapHeaders;
268 extern bool C_ImapIdle;
269 extern char * C_ImapLogin;
270 extern char * C_ImapOauthRefreshCommand;
271 extern char * C_ImapPass;
272 extern short C_ImapPipelineDepth;
273 extern short C_ImapPollTimeout;
274 extern bool C_ImapQresync;
275 extern bool C_ImapRfc5161;
276 extern bool C_ImapServernoise;
277 extern char * C_ImapUser;
278 
279 /* -- private IMAP functions -- */
280 /* imap.c */
281 int imap_create_mailbox(struct ImapAccountData *adata, char *mailbox);
282 int imap_rename_mailbox(struct ImapAccountData *adata, char *oldname, const char *newname);
283 int imap_exec_msgset(struct Mailbox *m, const char *pre, const char *post,
284  int flag, bool changed, bool invert);
285 int imap_open_connection(struct ImapAccountData *adata);
286 void imap_close_connection(struct ImapAccountData *adata);
287 int imap_read_literal(FILE *fp, struct ImapAccountData *adata, unsigned long bytes, struct Progress *pbar);
288 void imap_expunge_mailbox(struct Mailbox *m);
289 int imap_login(struct ImapAccountData *adata);
290 int imap_sync_message_for_copy(struct Mailbox *m, struct Email *e, struct Buffer *cmd, enum QuadOption *err_continue);
291 bool imap_has_flag(struct ListHead *flag_list, const char *flag);
292 int imap_adata_find(const char *path, struct ImapAccountData **adata, struct ImapMboxData **mdata);
293 
294 /* auth.c */
295 int imap_authenticate(struct ImapAccountData *adata);
296 
297 /* command.c */
298 int imap_cmd_start(struct ImapAccountData *adata, const char *cmdstr);
299 int imap_cmd_step(struct ImapAccountData *adata);
300 void imap_cmd_finish(struct ImapAccountData *adata);
301 bool imap_code(const char *s);
302 const char *imap_cmd_trailer(struct ImapAccountData *adata);
303 int imap_exec(struct ImapAccountData *adata, const char *cmdstr, ImapCmdFlags flags);
304 int imap_cmd_idle(struct ImapAccountData *adata);
305 
306 /* message.c */
307 void imap_edata_free(void **ptr);
308 struct ImapEmailData *imap_edata_get(struct Email *e);
309 int imap_read_headers(struct Mailbox *m, unsigned int msn_begin, unsigned int msn_end, bool initial_download);
310 char *imap_set_flags(struct Mailbox *m, struct Email *e, char *s, bool *server_changes);
311 int imap_cache_del(struct Mailbox *m, struct Email *e);
312 int imap_cache_clean(struct Mailbox *m);
313 int imap_append_message(struct Mailbox *m, struct Message *msg);
314 
315 int imap_msg_open(struct Mailbox *m, struct Message *msg, int msgno);
316 int imap_msg_close(struct Mailbox *m, struct Message *msg);
317 int imap_msg_commit(struct Mailbox *m, struct Message *msg);
318 int imap_msg_save_hcache(struct Mailbox *m, struct Email *e);
319 
320 /* util.c */
321 struct ImapAccountData *imap_adata_get(struct Mailbox *m);
322 struct ImapMboxData *imap_mdata_get(struct Mailbox *m);
323 #ifdef USE_HCACHE
324 void imap_hcache_open(struct ImapAccountData *adata, struct ImapMboxData *mdata);
325 void imap_hcache_close(struct ImapMboxData *mdata);
326 struct Email *imap_hcache_get(struct ImapMboxData *mdata, unsigned int uid);
327 int imap_hcache_put(struct ImapMboxData *mdata, struct Email *e);
328 int imap_hcache_del(struct ImapMboxData *mdata, unsigned int uid);
329 int imap_hcache_store_uid_seqset(struct ImapMboxData *mdata);
330 int imap_hcache_clear_uid_seqset(struct ImapMboxData *mdata);
331 char *imap_hcache_get_uid_seqset(struct ImapMboxData *mdata);
332 #endif
333 
334 enum QuadOption imap_continue(const char *msg, const char *resp);
335 void imap_error(const char *where, const char *msg);
336 struct ImapAccountData *imap_adata_new(struct Account *a);
337 void imap_adata_free(void **ptr);
338 struct ImapMboxData *imap_mdata_new(struct ImapAccountData *adata, const char* name);
339 void imap_mdata_free(void **ptr);
341 char *imap_fix_path(char delim, const char *mailbox, char *path, size_t plen);
342 void imap_cachepath(char delim, const char *mailbox, struct Buffer *dest);
343 int imap_get_literal_count(const char *buf, unsigned int *bytes);
344 char *imap_get_qualifier(char *buf);
345 char *imap_next_word(char *s);
346 void imap_qualify_path(char *buf, size_t buflen, struct ConnAccount *conn_account, char *path);
347 void imap_quote_string(char *dest, size_t dlen, const char *src, bool quote_backtick);
348 void imap_unquote_string(char *s);
349 void imap_munge_mbox_name(bool unicode, char *dest, size_t dlen, const char *src);
350 void imap_unmunge_mbox_name(bool unicode, char *s);
351 struct SeqsetIterator *mutt_seqset_iterator_new(const char *seqset);
352 int mutt_seqset_iterator_next(struct SeqsetIterator *iter, unsigned int *next);
353 void mutt_seqset_iterator_free(struct SeqsetIterator **ptr);
354 bool imap_account_match(const struct ConnAccount *a1, const struct ConnAccount *a2);
355 void imap_get_parent(const char *mbox, char delim, char *buf, size_t buflen);
356 bool mutt_account_match(const struct ConnAccount *a1, const struct ConnAccount *a2);
357 
358 /* utf7.c */
359 void imap_utf_encode(bool unicode, char **s);
360 void imap_utf_decode(bool unicode, char **s);
361 void imap_allow_reopen(struct Mailbox *m);
362 void imap_disallow_reopen(struct Mailbox *m);
363 
364 /* search.c */
365 void cmd_parse_search(struct ImapAccountData *adata, const char *s);
366 
367 #endif /* MUTT_IMAP_PRIVATE_H */
int imap_cmd_idle(struct ImapAccountData *adata)
Enter the IDLE state.
Definition: command.c:1373
void imap_mdata_free(void **ptr)
Free the private Mailbox data - Implements Mailbox::mdata_free()
Definition: util.c:225
void imap_adata_free(void **ptr)
Free the private Account data - Implements Account::adata_free()
Definition: util.c:66
enum QuadOption imap_continue(const char *msg, const char *resp)
display a message and ask the user if they want to go on
Definition: util.c:787
char * eostr
Definition: private.h:250
void imap_edata_free(void **ptr)
Free the private Email data - Implements Email::edata_free()
Definition: message.c:72
struct ImapCommand * cmds
Definition: private.h:200
void imap_qualify_path(char *buf, size_t buflen, struct ConnAccount *conn_account, char *path)
Make an absolute IMAP folder target.
Definition: util.c:954
void imap_disallow_reopen(struct Mailbox *m)
Disallow re-opening a folder upon expunge.
Definition: util.c:1163
void imap_get_parent(const char *mbox, char delim, char *buf, size_t buflen)
Get an IMAP folder&#39;s parent.
Definition: util.c:258
The envelope/body of an email.
Definition: email.h:37
A Hash Table.
Definition: hash.h:84
void imap_mdata_cache_reset(struct ImapMboxData *mdata)
Release and clear cache data of ImapMboxData structure.
Definition: util.c:215
Logged out from server.
Definition: private.h:98
int imap_rename_mailbox(struct ImapAccountData *adata, char *oldname, const char *newname)
Rename a mailbox.
Definition: imap.c:466
uint32_t uidvalidity
Definition: private.h:229
Imap connection failure.
Definition: private.h:86
Connection is authenticated.
Definition: private.h:109
unsigned int seqno
tag sequence number, e.g. &#39;{seqid}0001&#39;
Definition: private.h:188
Unrecoverable error occurred.
Definition: private.h:97
int imap_hcache_put(struct ImapMboxData *mdata, struct Email *e)
Add an entry to the header cache.
Definition: util.c:516
static size_t plen
Length of cached packet.
Definition: pgppacket.c:39
int imap_hcache_del(struct ImapMboxData *mdata, unsigned int uid)
Delete an item from the header cache.
Definition: util.c:534
void imap_munge_mbox_name(bool unicode, char *dest, size_t dlen, const char *src)
Quote awkward characters in a mailbox name.
Definition: util.c:1045
unsigned char state
ImapState, e.g. IMAP_AUTHENTICATED.
Definition: private.h:175
struct ImapAccountData * imap_adata_new(struct Account *a)
Allocate and initialise a new ImapAccountData structure.
Definition: util.c:92
int imap_hcache_store_uid_seqset(struct ImapMboxData *mdata)
Store a UID Sequence Set in the header cache.
Definition: util.c:551
void imap_utf_decode(bool unicode, char **s)
Decode email from UTF-8 to local charset.
Definition: utf7.c:345
ImapOpenFlags reopen
Flags, e.g. IMAP_REOPEN_ALLOW.
Definition: private.h:223
A group of associated Mailboxes.
Definition: account.h:36
header cache structure
Definition: lib.h:85
struct SeqsetIterator * mutt_seqset_iterator_new(const char *seqset)
Create a new Sequence Set Iterator.
Definition: util.c:1209
An open network connection (socket)
Definition: connection.h:34
String manipulation buffer.
Definition: buffer.h:33
unsigned int flags
Definition: slist.h:49
struct Mailbox * mailbox
Current selected mailbox.
Definition: private.h:207
int imap_cmd_start(struct ImapAccountData *adata, const char *cmdstr)
Given an IMAP command, send it to the server.
Definition: command.c:1057
char * capstr
Definition: private.h:185
struct ImapMboxData * imap_mdata_get(struct Mailbox *m)
Get the Mailbox data for this mailbox.
Definition: util.c:244
Items in an IMAP browser.
Definition: private.h:148
struct HeaderCache * hcache
Definition: private.h:241
ImapExecResult
imap_exec return code
Definition: private.h:82
bool imap_account_match(const struct ConnAccount *a1, const struct ConnAccount *a2)
Compare two Accounts.
Definition: util.c:1178
size_t blen
Definition: private.h:191
char * C_ImapLogin
Config: (imap) Login name for the IMAP server (defaults to C_ImapUser)
Definition: config.c:49
String list.
Definition: slist.h:45
void imap_cmd_finish(struct ImapAccountData *adata)
Attempt to perform cleanup.
Definition: command.c:1306
char * imap_hcache_get_uid_seqset(struct ImapMboxData *mdata)
Get a UID Sequence Set from the header cache.
Definition: util.c:587
#define ARRAY_HEAD(name, type)
Define a named struct for arrays of elements of a certain type.
Definition: array.h:43
char delim
Definition: private.h:151
uint8_t ImapOpenFlags
Flags, e.g. MUTT_THREAD_COLLAPSE.
Definition: private.h:64
A progress bar.
Definition: progress.h:50
int imap_create_mailbox(struct ImapAccountData *adata, char *mailbox)
Create a new mailbox.
Definition: imap.c:425
void cmd_parse_search(struct ImapAccountData *adata, const char *s)
store SEARCH response for later use
Definition: search.c:258
char * C_ImapOauthRefreshCommand
Config: (imap) External command to generate OAUTH refresh token.
Definition: config.c:50
char * imap_set_flags(struct Mailbox *m, struct Email *e, char *s, bool *server_changes)
fill the message header according to the server flags
Definition: message.c:1783
Imap command executed or queued successfully.
Definition: private.h:84
QuadOption
Possible values for a quad-option.
Definition: quad.h:36
Convenience wrapper for the config headers.
int imap_login(struct ImapAccountData *adata)
Open an IMAP connection.
Definition: imap.c:1817
unsigned char seqid
tag sequence prefix
Definition: private.h:187
int imap_msg_commit(struct Mailbox *m, struct Message *msg)
Save changes to an email - Implements MxOps::msg_commit()
Definition: message.c:2044
unsigned int new_mail_count
Set when EXISTS notifies of new mail.
Definition: private.h:225
struct BodyCache * bcache
Definition: private.h:239
bool imap_code(const char *s)
Was the command successful.
Definition: command.c:1194
int imap_adata_find(const char *path, struct ImapAccountData **adata, struct ImapMboxData **mdata)
Find the Account data for this path.
Definition: util.c:129
char * imap_next_word(char *s)
Find where the next IMAP word begins.
Definition: util.c:923
int imap_cmd_step(struct ImapAccountData *adata)
Reads server responses from an IMAP command.
Definition: command.c:1071
int imap_msg_save_hcache(struct Mailbox *m, struct Email *e)
Save message to the header cache - Implements MxOps::msg_save_hcache()
Definition: message.c:2066
Disconnected from server.
Definition: private.h:107
Header cache multiplexor.
void imap_hcache_close(struct ImapMboxData *mdata)
Close the header cache.
Definition: util.c:475
int imap_msg_close(struct Mailbox *m, struct Message *msg)
Close an email - Implements MxOps::msg_close()
Definition: message.c:2058
unsigned int range_end
Definition: private.h:254
bool C_ImapRfc5161
Config: (imap) Use the IMAP ENABLE extension to select capabilities.
Definition: config.c:57
ImapOpenFlags check_status
Flags, e.g. IMAP_NEWMAIL_PENDING.
Definition: private.h:224
ImapFlags
IMAP server responses.
Definition: private.h:95
Mailbox is selected.
Definition: private.h:110
struct Mailbox * prev_mailbox
Previously selected mailbox.
Definition: private.h:208
Connected to server.
Definition: private.h:108
IMAP command structure.
Definition: private.h:159
struct ImapMboxData * imap_mdata_new(struct ImapAccountData *adata, const char *name)
Allocate and initialise a new ImapMboxData structure.
Definition: util.c:165
bool C_ImapCondstore
Config: (imap) Enable the CONDSTORE extension.
Definition: config.c:39
void * mdata
Driver specific data.
Definition: mailbox.h:136
bool imap_has_flag(struct ListHead *flag_list, const char *flag)
Does the flag exist in the list.
Definition: imap.c:850
void imap_unquote_string(char *s)
equally stupid unquoting routine
Definition: util.c:1008
unsigned long long modseq
Definition: private.h:231
bool C_ImapIdle
Config: (imap) Use the IMAP IDLE extension to check for new mail.
Definition: config.c:46
struct HashTable * uid_hash
Definition: private.h:237
bool closing
If true, we are waiting for CLOSE completion.
Definition: private.h:174
void imap_error(const char *where, const char *msg)
show an error and abort
Definition: util.c:798
void imap_utf_encode(bool unicode, char **s)
Encode email from local charset to UTF-8.
Definition: utf7.c:316
struct Account * account
Parent Account.
Definition: private.h:209
int imap_open_connection(struct ImapAccountData *adata)
Open an IMAP connection.
Definition: imap.c:719
A local copy of an email.
Definition: mx.h:82
int imap_msg_open(struct Mailbox *m, struct Message *msg, int msgno)
Open an email message in a Mailbox - Implements MxOps::msg_open()
Definition: message.c:1840
A mailbox.
Definition: mailbox.h:81
char * name
Definition: private.h:150
void mutt_seqset_iterator_free(struct SeqsetIterator **ptr)
Free a Sequence Set Iterator.
Definition: util.c:1289
unsigned char status
ImapFlags, e.g. IMAP_FATAL.
Definition: private.h:176
int imap_exec_msgset(struct Mailbox *m, const char *pre, const char *post, int flag, bool changed, bool invert)
Prepare commands for all messages matching conditions.
Definition: imap.c:899
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.
Definition: imap.c:977
#define SEQ_LEN
Definition: private.h:61
bool qresync
true, if QRESYNC is successfully ENABLE&#39;d
Definition: private.h:194
char * name
Mailbox name.
Definition: private.h:219
const char * imap_cmd_trailer(struct ImapAccountData *adata)
Extra information after tagged command response if any.
Definition: command.c:1205
void imap_allow_reopen(struct Mailbox *m)
Allow re-opening a folder upon expunge.
Definition: util.c:1150
void imap_expunge_mailbox(struct Mailbox *m)
Purge messages from the server.
Definition: imap.c:649
ImapCapFlags capabilities
Definition: private.h:186
bool C_ImapCheckSubscribed
Config: (imap) When opening a mailbox, ask the server for a list of subscribed folders.
Definition: config.c:38
time_t lastread
last time we read a command for the server
Definition: private.h:189
struct Slist * C_ImapAuthenticators
Config: (imap) List of allowed IMAP authentication methods.
Definition: config.c:37
Login details for a remote server.
Definition: connaccount.h:51
char * C_ImapPass
Config: (imap) Password for the IMAP server.
Definition: config.c:51
uint32_t ImapCapFlags
Capabilities we are interested in.
Definition: private.h:121
bool noinferiors
Definition: private.h:153
Connection is idle.
Definition: private.h:113
char * real_name
Original Mailbox name, e.g.: INBOX can be just \0.
Definition: private.h:221
Imap command failure.
Definition: private.h:85
char * substr_cur
Definition: private.h:255
Local cache of email bodies.
Definition: bcache.c:53
int imap_get_literal_count(const char *buf, unsigned int *bytes)
write number of bytes in an IMAP literal into bytes
Definition: util.c:879
IMAP-specific Account data -.
Definition: private.h:170
unsigned int uid_next
Definition: private.h:230
char * imap_get_qualifier(char *buf)
Get the qualifier from a tagged response.
Definition: util.c:906
int imap_authenticate(struct ImapAccountData *adata)
Authenticate to an IMAP server.
Definition: auth.c:82
struct Email * imap_hcache_get(struct ImapMboxData *mdata, unsigned int uid)
Get a header cache entry by its UID.
Definition: util.c:491
struct ImapAccountData * imap_adata_get(struct Mailbox *m)
Get the Account data for this mailbox.
Definition: util.c:114
char * imap_fix_path(char delim, const char *mailbox, char *path, size_t plen)
Fix up the imap path.
Definition: util.c:820
IMAP-specific Mailbox data -.
Definition: private.h:217
char * C_ImapHeaders
Config: (imap) Additional email headers to download when getting index.
Definition: config.c:45
bool mutt_account_match(const struct ConnAccount *a1, const struct ConnAccount *a2)
int state
Command state, e.g. IMAP_RES_NEW.
Definition: private.h:162
char * buf
Definition: private.h:190
uint8_t ImapCmdFlags
Flags for imap_exec(), e.g. IMAP_CMD_PASS.
Definition: private.h:72
short C_ImapPollTimeout
Config: (imap) Maximum time to wait for a server response.
Definition: config.c:55
bool recovering
Definition: private.h:173
void imap_cachepath(char delim, const char *mailbox, struct Buffer *dest)
Generate a cache path for a mailbox.
Definition: util.c:850
int imap_append_message(struct Mailbox *m, struct Message *msg)
Write an email back to the server.
Definition: message.c:1430
int imap_cache_clean(struct Mailbox *m)
Delete all the entries in the message cache.
Definition: message.c:1751
int imap_cache_del(struct Mailbox *m, struct Email *e)
Delete an email from the body cache.
Definition: message.c:1732
ImapState
IMAP connection state.
Definition: private.h:104
struct ImapList * cmdresult
Definition: private.h:197
int imap_read_literal(FILE *fp, struct ImapAccountData *adata, unsigned long bytes, struct Progress *pbar)
Read bytes bytes from server into file.
Definition: imap.c:574
IMAP-specific Email data -.
Definition: message.h:33
int imap_hcache_clear_uid_seqset(struct ImapMboxData *mdata)
Delete a UID Sequence Set from the header cache.
Definition: util.c:573
bool C_ImapDeflate
Config: (imap) Compress network traffic.
Definition: config.c:41
unsigned int unseen
Definition: private.h:234
unsigned int recent
Definition: private.h:233
short C_ImapPipelineDepth
Config: (imap) Number of IMAP commands that may be queued up.
Definition: config.c:54
Convenience wrapper for the library headers.
char * substr_end
Definition: private.h:256
int imap_exec(struct ImapAccountData *adata, const char *cmdstr, ImapCmdFlags flags)
Execute a command and wait for the response from the server.
Definition: command.c:1242
char * munge_name
Munged version of the mailbox name.
Definition: private.h:220
bool C_ImapQresync
Config: (imap) Enable the QRESYNC extension.
Definition: config.c:56
int imap_read_headers(struct Mailbox *m, unsigned int msn_begin, unsigned int msn_end, bool initial_download)
Read headers from the server.
Definition: message.c:1243
void imap_hcache_open(struct ImapAccountData *adata, struct ImapMboxData *mdata)
Open a header cache.
Definition: util.c:435
char * full_seqset
Definition: private.h:249
char * C_ImapUser
Config: (imap) Username for the IMAP server.
Definition: config.c:59
void imap_close_connection(struct ImapAccountData *adata)
Close an IMAP connection.
Definition: imap.c:825
int mutt_seqset_iterator_next(struct SeqsetIterator *iter, unsigned int *next)
Get the next UID from a Sequence Set.
Definition: util.c:1230
unsigned int range_cur
Definition: private.h:253
char * C_ImapDelimChars
Config: (imap) Characters that denote separators in IMAP folders.
Definition: config.c:43
void imap_unmunge_mbox_name(bool unicode, char *s)
Remove quoting from a mailbox name.
Definition: util.c:1062
bool noselect
Definition: private.h:152
unsigned int messages
Definition: private.h:232
void imap_quote_string(char *dest, size_t dlen, const char *src, bool quote_backtick)
quote string according to IMAP rules
Definition: util.c:971
bool unicode
If true, we can send UTF-8, and the server will use UTF8 rather than mUTF7.
Definition: private.h:193
UID Sequence Set Iterator.
Definition: private.h:247
int msgno
Number displayed to the user.
Definition: email.h:87
struct Connection * conn
Definition: private.h:172
long C_ImapFetchChunkSize
Config: (imap) Download headers in blocks of this size.
Definition: config.c:44
bool C_ImapServernoise
Config: (imap) Display server warnings as error messages.
Definition: config.c:58
struct ImapEmailData * imap_edata_get(struct Email *e)
Get the private data for this Email.
Definition: message.c:98