85 const struct Pattern *pat = NULL;
144 char term[256] = { 0 };
153 delim = strchr(pat->
p.
str,
':');
184 mutt_error(
_(
"Server-side custom search not supported: %s"), pat->
p.
str);
259 struct Email *e = NULL;
const char * mutt_str_atoui(const char *str, unsigned int *dst)
Convert ASCII string to an unsigned integer.
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.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Convenience wrapper for the core headers.
Structs that make up an email.
#define mutt_debug(LEVEL,...)
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 ImapAccountData * imap_adata_get(struct Mailbox *m)
Get the Account data for this mailbox.
int imap_exec(struct ImapAccountData *adata, const char *cmdstr, ImapCmdFlags flags)
Execute a command and wait for the response from the server.
#define IMAP_CMD_NO_FLAGS
No flags are set.
#define IMAP_CAP_X_GM_EXT_1
https://developers.google.com/gmail/imap/imap-extensions
void imap_quote_string(char *dest, size_t dlen, const char *src, bool quote_backtick)
Quote string according to IMAP rules.
@ IMAP_EXEC_SUCCESS
Imap command executed or queued successfully.
char * imap_next_word(char *s)
Find where the next IMAP word begins.
@ LL_DEBUG2
Log at debug level 2.
Convenience wrapper for the library headers.
Notmuch-specific Mailbox data.
Match patterns to emails.
@ MUTT_PAT_HEADER
Pattern matches email's header.
@ MUTT_PAT_WHOLE_MSG
Pattern matches raw email text.
@ MUTT_PAT_OR
Either pattern can match.
@ MUTT_PAT_SERVERSEARCH
Server-side pattern matches.
@ MUTT_PAT_BODY
Pattern matches email's body.
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 SLIST_FOREACH(var, head, field)
#define SLIST_FIRST(head)
static bool compile_search(const struct ImapAccountData *adata, const struct Pattern *pat, struct Buffer *buf)
Convert NeoMutt pattern to IMAP search.
static int check_pattern_list(const struct PatternList *patterns)
Check how many patterns in a list can be searched server-side.
static bool compile_search_children(const struct ImapAccountData *adata, const struct Pattern *pat, struct Buffer *buf)
Compile a search command for a pattern's children.
static bool compile_search_self(const struct ImapAccountData *adata, const struct Pattern *pat, struct Buffer *buf)
Compile a search command for a pattern.
static bool check_pattern(const struct Pattern *pat)
Check whether a pattern can be searched server-side.
bool imap_search(struct Mailbox *m, const struct PatternList *pat)
Find messages in mailbox matching a pattern.
void cmd_parse_search(struct ImapAccountData *adata, const char *s)
Store SEARCH response for later use.
void * adata
Private data (for Mailbox backends)
String manipulation buffer.
The envelope/body of an email.
bool matched
Search matches this Email.
IMAP-specific Account data -.
ImapCapFlags capabilities
Capability flags.
struct Mailbox * mailbox
Current selected mailbox.
IMAP-specific Mailbox data -.
int msg_count
Total number of messages.
void * mdata
Driver specific data.
struct Email ** emails
Array of Emails.
A simple (non-regex) pattern.
struct PatternList * child
Arguments to logical operation.
bool string_match
Check a string for a match.
char * str
String, if string_match is set.
short op
Operation, e.g. MUTT_PAT_SCORE.
bool pat_not
Pattern should be inverted (not)