Go to the documentation of this file.
39 #ifndef MUTT_PATTERN_LIB_H
40 #define MUTT_PATTERN_LIB_H
58 #define MUTT_ALIAS_SIMPLESEARCH "~f %s | ~t %s | ~c %s"
64 #define MUTT_PC_NO_FLAGS 0
65 #define MUTT_PC_FULL_MSG (1<<0)
66 #define MUTT_PC_PATTERN_DYNAMIC (1<<1)
67 #define MUTT_PC_SEND_MODE_SEARCH (1<<2)
98 #define MUTT_PAT_EXEC_NO_FLAGS 0
99 #define MUTT_MATCH_FULL_ADDRESS (1 << 0)
@ MUTT_PAT_PARENT
Pattern matches parent.
int mutt_search_command(struct Context *ctx, struct Mailbox *m, int cur, int op)
Perform a search.
@ MUTT_PAT_CRYPT_ENCRYPT
Message is encrypted.
@ MUTT_PAT_DATE
Pattern matches 'Date:' field.
regex_t * regex
Compiled regex, for non-pattern matching.
@ MUTT_PAT_PERSONAL_RECIP
Email is addressed to the user.
@ MUTT_PAT_SCORE
Pattern matches email's score.
@ MUTT_PAT_LIST
Email is on mailing list.
int mutt_is_list_recipient(bool all_addr, struct Envelope *e)
Matches known mailing lists.
bool is_multi
Multiple case (only for ~I pattern now)
String manipulation buffer.
@ MUTT_PAT_TO
Pattern matches 'To:' field.
@ MUTT_PAT_HORMEL
Pattern matches email's spam score.
@ MUTT_PAT_COLLAPSED
Thread is collapsed.
@ MUTT_PAT_OR
Either pattern can match.
int mutt_pattern_func(struct Context *ctx, int op, char *prompt)
Perform some Pattern matching.
@ MUTT_PAT_PERSONAL_FROM
Email is from the user.
@ MUTT_PAT_MIMETYPE
Pattern matches MIME type.
SLIST_HEAD(PatternList, Pattern)
bool C_ThoroughSearch
Config: Decode headers and messages before searching them.
bool dynamic
Evaluate date ranges at run time.
@ MUTT_PAT_FROM
Pattern matches 'From:' field.
@ MUTT_PAT_PGP_KEY
Message has PGP key.
@ MUTT_PAT_SERVERSEARCH
Server-side pattern matches.
uint8_t PatternCompFlags
Flags for mutt_pattern_comp(), e.g. MUTT_PC_FULL_MSG.
@ MUTT_PAT_SUBJECT
Pattern matches 'Subject:' field.
@ MUTT_PAT_SUBSCRIBED_LIST
Email is on subscribed mailing list.
A set of email addresses.
int mutt_is_subscribed_list_recipient(bool all_addr, struct Envelope *e)
Matches subscribed mailing lists.
GUI data wrapping an Alias.
PatternType
Types of pattern to match.
@ MUTT_PAT_BODY
Pattern matches email's body.
@ MUTT_PAT_DRIVER_TAGS
Pattern matches message tags.
int min
Minimum for range checks.
bool ign_case
Ignore case for local string_match searches.
@ MUTT_PAT_DATE_RECEIVED
Pattern matches date received.
@ MUTT_PAT_ID
Pattern matches email's Message-Id.
bool mutt_limit_current_thread(struct Context *ctx, struct Email *e)
Limit the email view to the current thread.
@ MUTT_PAT_HEADER
Pattern matches email's header.
bool is_alias
Is there an alias for this Address?
@ MUTT_PAT_REFERENCE
Pattern matches 'References:' or 'In-Reply-To:' field.
@ MUTT_PAT_CC
Pattern matches 'Cc:' field.
bool all_addr
All Addresses in the list must match.
@ MUTT_PAT_ID_EXTERNAL
Message-Id is among results from an external query.
@ MUTT_PAT_AND
Both patterns must match.
@ MUTT_PAT_BROKEN
Message is part of a broken thread.
@ MUTT_PAT_WHOLE_MSG
Pattern matches raw email text.
@ MUTT_PAT_SENDER
Pattern matches sender.
bool string_match
Check a string for a match.
bool pat_not
Pattern should be inverted (not)
@ MUTT_PAT_THREAD
Pattern matches email thread.
@ MUTT_PAT_CHILDREN
Pattern matches a child email.
uint8_t PatternExecFlags
Flags for mutt_pattern_exec(), e.g. MUTT_MATCH_FULL_ADDRESS.
@ MUTT_PAT_DUPLICATED
Duplicate message.
int mutt_search_alias_command(struct Context *ctx, struct Menu *menu, int cur, int op)
Perform a search.
struct PatternList * mutt_pattern_comp(struct Context *ctx, const char *s, PatternCompFlags flags, struct Buffer *err)
Create a Pattern.
@ MUTT_PAT_NEWSGROUPS
Pattern matches newsgroup.
void mutt_check_simple(struct Buffer *s, const char *simple)
Convert a simple search into a real request.
short op
Operation, e.g. MUTT_PAT_SCORE.
bool dlg_select_pattern(char *buf, size_t buflen)
Show menu to select a Pattern.
int mutt_pattern_exec(struct Pattern *pat, PatternExecFlags flags, struct Mailbox *m, struct Email *e, struct PatternCache *cache)
Match a pattern against an email header.
@ MUTT_PAT_CRYPT_SIGN
Message is signed.
void mutt_pattern_free(struct PatternList **pat)
Free a Pattern.
@ MUTT_PAT_ADDRESS
Pattern matches any address field.
@ MUTT_PAT_UNREFERENCED
Message is unreferenced in the thread.
@ MUTT_PAT_SIZE
Pattern matches email's size.
int mutt_pattern_alias_exec(struct Pattern *pat, PatternExecFlags flags, struct AliasView *av, struct PatternCache *cache)
Match a pattern against an alias.
@ MUTT_PAT_XLABEL
Pattern matches keyword/label.
struct Group * group
Address group if group_match is set.
@ MUTT_PAT_MESSAGE
Pattern matches message number.
int mutt_pattern_alias_func(int op, char *prompt, char *title, struct AliasMenuData *mdata, struct Context *ctx, struct Menu *menu)
Perform some Pattern matching for Alias.
Container for lots of config items.
int max
Maximum for range checks.
@ MUTT_PAT_MIMEATTACH
Pattern matches number of attachments.
struct ListHead multi_cases
Multiple strings for ~I pattern.
char * str
String, if string_match is set.
bool sendmode
Evaluate searches in send-mode.
The envelope/body of an email.
@ MUTT_PAT_CRYPT_VERIFIED
Message is crypographically verified.
SLIST_ENTRY(Pattern) entries
Linked list.
int mutt_which_case(const char *s)
bool group_match
Check a group of Addresses.
A simple (non-regex) pattern.
@ MUTT_PAT_RECIPIENT
User is a recipient of the email.
Cache commonly-used patterns.
struct PatternList * child
Arguments to logical operation.