69static void add_folder(
char delim,
char *folder,
bool noselect,
bool noinferiors,
75 char mailbox[1024] = { 0 };
109 if (!isparent && !noinferiors && (strlen(relpath) <
sizeof(relpath) - 1))
111 relpath[strlen(relpath) + 1] =
'\0';
112 relpath[strlen(relpath)] = delim;
119 if (folder[0] ==
'\0')
205 const char *list_cmd = NULL;
208 bool showparents =
false;
237 if (c_imap_list_subscribed)
242 list_cmd =
"LIST (SUBSCRIBED RECURSIVEMATCH)";
273 len = snprintf(buf,
sizeof(buf),
"%s \"\" %s", list_cmd, munged_mbox);
275 snprintf(buf + len,
sizeof(buf) - len,
" RETURN (CHILDREN)");
287 mbox[n++] = list.
delim;
295 if (mbox[n - 1] == list.
delim)
309 for (n--; n >= 0 && mbox[n] != list.
delim; n--)
340 char relpath[2] = { 0 };
342 snprintf(relpath,
sizeof(relpath),
"%c", (n < 0) ?
'\0' : adata->
delim);
361 snprintf(buf,
sizeof(buf),
"%s%%", mbox);
364 len = snprintf(buf,
sizeof(buf),
"%s \"\" %s", list_cmd, munged_mbox);
366 snprintf(buf + len,
sizeof(buf) - len,
" RETURN (CHILDREN)");
382 c_imap_check_subscribed, NULL);
409 if ((n != 0) && (name->
data[n - 1] != adata->
delim))
453 struct Buffer *buf = NULL;
454 struct Buffer *newname = NULL;
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
#define ARRAY_EMPTY(head)
Check if an array is empty.
int imap_browse(const char *path, struct BrowserState *state)
IMAP hook into the folder browser.
static int browse_add_list_result(struct ImapAccountData *adata, const char *cmd, struct BrowserState *bstate, bool isparent)
Add entries to the folder browser.
static void add_folder(char delim, char *folder, bool noselect, bool noinferiors, struct BrowserState *state, bool isparent)
Format and add an IMAP folder to the browser.
int imap_mailbox_create(const char *path)
Create a new IMAP mailbox.
int imap_mailbox_rename(const char *path)
Rename a mailbox.
const struct CompleteOps CompleteMailboxOps
Auto-Completion of Files / Mailboxes.
Select a Mailbox from a list.
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t buf_addch(struct Buffer *buf, char c)
Add a single character 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 struct Regex * cs_subset_regex(const struct ConfigSubset *sub, const char *name)
Get a regex 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.
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
@ MUTT_IMAP
'IMAP' Mailbox type
@ MUTT_MAILBOX_ANY
Match any Mailbox type.
Structs that make up an email.
int mw_get_field(const char *prompt, struct Buffer *buf, CompletionFlags complete, enum HistoryClass hclass, const struct CompleteOps *comp_api, void *cdata)
Ask the user for a string -.
#define mutt_message(...)
#define mutt_debug(LEVEL,...)
void imap_mdata_free(void **ptr)
Free the private Mailbox data - Implements Mailbox::mdata_free() -.
Convenience wrapper for the gui headers.
Read/write command history from/to a file.
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.
int imap_parse_path(const char *path, struct ConnAccount *cac, char *mailbox, size_t mailboxlen)
Parse an IMAP mailbox name into ConnAccount, name.
int imap_mxcmp(const char *mx1, const char *mx2)
Compare mailbox names, giving priority to INBOX.
void imap_qualify_path(char *buf, size_t buflen, struct ConnAccount *conn_account, char *path)
Make an absolute IMAP folder target.
#define IMAP_RES_OK
<tag> OK ...
char * imap_fix_path_with_delim(char delim, const char *mailbox, char *path, size_t plen)
Fix up the imap path.
#define IMAP_CAP_LIST_EXTENDED
RFC5258: IMAP4 LIST Command Extensions.
int imap_adata_find(const char *path, struct ImapAccountData **adata, struct ImapMboxData **mdata)
Find the Account data for this path.
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_get_qualifier(char *buf)
Get the qualifier from a tagged response.
int imap_rename_mailbox(struct ImapAccountData *adata, char *oldname, const char *newname)
Rename a mailbox.
int imap_create_mailbox(struct ImapAccountData *adata, const char *mailbox)
Create a new mailbox.
@ LL_DEBUG3
Log at debug level 3.
@ LL_DEBUG1
Log at debug level 1.
Convenience wrapper for the library headers.
bool mutt_regex_match(const struct Regex *regex, const char *str)
Shorthand to mutt_regex_capture()
char * mutt_str_dup(const char *str)
Copy a string, safely.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Many unsorted constants and some structs.
#define MUTT_COMP_NO_FLAGS
No flags are set.
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
void mutt_sleep(short s)
Sleep for a while.
Some miscellaneous functions.
void neomutt_mailboxlist_clear(struct MailboxList *ml)
Free a Mailbox List.
size_t neomutt_mailboxlist_get_all(struct MailboxList *head, struct NeoMutt *n, enum MailboxType type)
Get a List of all Mailboxes.
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.
#define STAILQ_HEAD_INITIALIZER(head)
#define STAILQ_FOREACH(var, head, field)
void * adata
Private data (for Mailbox backends)
State of the file/mailbox browser.
char * folder
Folder name.
struct BrowserEntryArray entry
Array of files / dirs / mailboxes.
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
Login details for a remote server.
struct ConnAccount account
Account details: username, password, etc.
Input for the file completion function.
Browser entry representing a folder/dir.
bool selectable
Folder can be selected.
char delim
Path delimiter.
bool imap
This is an IMAP folder.
bool has_mailbox
This is a mailbox.
char * name
Name of file/dir/mailbox.
bool has_new_mail
true if mailbox has "new mail"
char * desc
Description of mailbox.
int msg_count
total number of messages
bool inferiors
Folder has children.
int msg_unread
number of unread messages
IMAP-specific Account data -.
char delim
Path delimiter.
struct ImapList * cmdresult
bool unicode
If true, we can send UTF-8, and the server will use UTF8 rather than mUTF7.
ImapCapFlags capabilities
Capability flags.
struct Connection * conn
Connection to IMAP server.
Items in an IMAP browser.
IMAP-specific Mailbox data -.
char * real_name
Original Mailbox name, e.g.: INBOX can be just \0.
struct Mailbox * mailbox
Mailbox in the list.
bool has_new
Mailbox has new mail.
int msg_count
Total number of messages.
void * mdata
Driver specific data.
int msg_unread
Number of unread messages.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
Cached regular expression.
A parsed URL proto://user:password@host:port/path?a=1&b=2
int cs_subset_str_native_set(const struct ConfigSubset *sub, const char *name, intptr_t value, struct Buffer *err)
Natively set the value of a string config item.
struct Url * url_parse(const char *src)
Fill in Url.
void url_free(struct Url **ptr)
Free the contents of a URL.