Match a pattern against an email header.
flags: MUTT_MATCH_FULL_ADDRESS: match both personal and machine address cache: For repeated matches against the same Header, passing in non-NULL will store some of the cacheable pattern matches in this structure.
847{
849 {
898 {
900 return false;
902 }
903
904
905
906 if (!m)
907 return false;
908
913 if (!m)
914 return false;
916 {
918 }
919 mutt_error(
_(
"error: server custom search only supported with IMAP"));
920 return false;
923 return false;
928 return false;
933 return false;
938 return false;
943 return false;
948 return false;
953 return false;
963 return false;
968 return false;
974 return false;
978 {
980 return false;
981
982 bool result;
983 if (cache)
984 {
987 {
990 }
992 }
993 else
994 {
996 }
998 }
1000 {
1002 return false;
1003
1004 bool result;
1005 if (cache)
1006 {
1009 {
1012 }
1014 }
1015 else
1016 {
1018 }
1020 }
1022 {
1024 return false;
1025
1026 bool result;
1027 if (cache)
1028 {
1031 {
1035 }
1037 }
1038 else
1039 {
1041 }
1043 }
1045 {
1047 return false;
1048
1049 bool result;
1050 if (cache)
1051 {
1054 {
1057 }
1059 }
1060 else
1061 {
1063 }
1065 }
1070 {
1072 return false;
1073 }
1077 {
1079 return false;
1080 }
1084 {
1086 return false;
1087 }
1091 {
1093 return false;
1094 }
1098 return false;
1101 {
1103 }
1106 return false;
1111 {
1115 }
1117 if (!m || !msg)
1118 return false;
1126 return false;
1128 }
1129 mutt_error(
_(
"error: unknown op %d (report this error)"), pat->
op);
1130 return false;
1131}
int mutt_count_body_parts(struct Email *e, FILE *fp)
Count the MIME Body parts.
@ MUTT_IMAP
'IMAP' Mailbox type
static bool msg_search(struct Pattern *pat, struct Email *e, struct Message *msg)
Search an email.
static int match_user(bool all_addr, int n,...)
Matches the user's email Address.
static int match_threadcomplete(struct PatternList *pat, PatternExecFlags flags, struct Mailbox *m, struct MuttThread *t, int left, int up, int right, int down)
Match a Pattern against an email thread.
static void print_crypt_pattern_op_error(int op)
Print an error for a disabled crypto pattern.
static int match_threadparent(struct PatternList *pat, PatternExecFlags flags, struct Mailbox *m, struct MuttThread *t)
Match Pattern against an email's parent.
static bool match_mime_content_type(const struct Pattern *pat, struct Email *e, FILE *fp)
Match a Pattern against an email's Content-Type.
static int match_threadchildren(struct PatternList *pat, PatternExecFlags flags, struct Mailbox *m, struct MuttThread *t)
Match Pattern against an email's children.
static bool match_reference(struct Pattern *pat, struct ListHead *refs)
Match references against a Pattern.
static int match_addrlist(struct Pattern *pat, bool match_personal, int n,...)
match a pattern against an address list
static bool patmatch(const struct Pattern *pat, const char *buf)
Compare a string to a Pattern.
static int is_pattern_cache_set(int cache_entry)
Is a given Pattern cached?
static bool match_tags(struct Pattern *pat, struct TagList *tags)
match a pattern against a tags list
bool mutt_is_subscribed_list_recipient(bool all_addr, struct Envelope *env)
Matches subscribed mailing lists.
static int perform_or(struct PatternList *pat, PatternExecFlags flags, struct Mailbox *m, struct Email *e, struct Message *msg, struct PatternCache *cache)
Perform a logical OR on a set of Patterns.
bool mutt_is_list_recipient(bool all_addr, struct Envelope *env)
Matches known mailing lists.
static bool match_update_dynamic_date(struct Pattern *pat)
Update a dynamic date pattern.
static bool perform_and(struct PatternList *pat, PatternExecFlags flags, struct Mailbox *m, struct Email *e, struct Message *msg, struct PatternCache *cache)
Perform a logical AND on a set of Patterns.
static bool get_pattern_cache_value(int cache_entry)
Get pattern cache value.
static void set_pattern_cache_value(int *cache_entry, int value)
Sets a value in the PatternCache cache entry.
static int msg_search_sendmode(struct Email *e, struct Pattern *pat)
Search in send-mode.
@ MUTT_SUPERSEDED
Superseded messages.
@ MUTT_EXPIRED
Expired messages.
@ MUTT_READ
Messages that have been read.
@ MUTT_TAG
Tagged messages.
@ MUTT_FLAG
Flagged messages.
@ MUTT_DELETED
Deleted messages.
@ MUTT_UNREAD
Unread messages.
@ MUTT_REPLIED
Messages that have been replied to.
#define SEC_GOODSIGN
Email has a valid signature.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
#define SEC_ENCRYPT
Email is encrypted.
#define SEC_SIGN
Email is signed.
@ MUTT_PAT_HEADER
Pattern matches email's header.
@ MUTT_PAT_WHOLE_MSG
Pattern matches raw email text.
@ MUTT_PAT_BROKEN
Message is part of a broken thread.
@ MUTT_PAT_ID_EXTERNAL
Message-Id is among results from an external query.
@ MUTT_PAT_OR
Either pattern can match.
@ MUTT_PAT_CHILDREN
Pattern matches a child email.
@ MUTT_PAT_PARENT
Pattern matches parent.
@ MUTT_PAT_REFERENCE
Pattern matches 'References:' or 'In-Reply-To:' field.
@ MUTT_PAT_FROM
Pattern matches 'From:' field.
@ MUTT_PAT_DRIVER_TAGS
Pattern matches message tags.
@ MUTT_PAT_COLLAPSED
Thread is collapsed.
@ MUTT_PAT_CRYPT_VERIFIED
Message is crypographically verified.
@ MUTT_PAT_HORMEL
Pattern matches email's spam score.
@ MUTT_PAT_SUBJECT
Pattern matches 'Subject:' field.
@ MUTT_PAT_LIST
Email is on mailing list.
@ MUTT_PAT_NEWSGROUPS
Pattern matches newsgroup.
@ MUTT_PAT_PERSONAL_RECIP
Email is addressed to the user.
@ MUTT_PAT_CC
Pattern matches 'Cc:' field.
@ MUTT_PAT_SUBSCRIBED_LIST
Email is on subscribed mailing list.
@ MUTT_PAT_SERVERSEARCH
Server-side pattern matches.
@ MUTT_PAT_RECIPIENT
User is a recipient of the email.
@ MUTT_PAT_CRYPT_ENCRYPT
Message is encrypted.
@ MUTT_PAT_UNREFERENCED
Message is unreferenced in the thread.
@ MUTT_PAT_CRYPT_SIGN
Message is signed.
@ MUTT_PAT_MESSAGE
Pattern matches message number.
@ MUTT_PAT_AND
Both patterns must match.
@ MUTT_PAT_DATE
Pattern matches 'Date:' field.
@ MUTT_PAT_XLABEL
Pattern matches keyword/label.
@ MUTT_PAT_SCORE
Pattern matches email's score.
@ MUTT_PAT_MIMEATTACH
Pattern matches number of attachments.
@ MUTT_PAT_DUPLICATED
Duplicate message.
@ MUTT_PAT_PERSONAL_FROM
Email is from the user.
@ MUTT_PAT_TO
Pattern matches 'To:' field.
@ MUTT_PAT_BCC
Pattern matches 'Bcc:' field.
@ MUTT_PAT_SENDER
Pattern matches sender.
@ MUTT_PAT_DATE_RECEIVED
Pattern matches date received.
@ MUTT_PAT_ADDRESS
Pattern matches any address field.
@ MUTT_PAT_MIMETYPE
Pattern matches MIME type.
@ MUTT_PAT_PGP_KEY
Message has PGP key.
@ MUTT_PAT_ID
Pattern matches email's Message-Id.
@ MUTT_PAT_THREAD
Pattern matches email thread.
@ MUTT_PAT_SIZE
Pattern matches email's size.
@ MUTT_PAT_BODY
Pattern matches email's body.
#define MUTT_MATCH_FULL_ADDRESS
Match the full address.
static int email_msgno(struct Email *e)
Helper to get the Email's message number.
LOFF_T length
length (in bytes) of attachment
char * filename
When sending a message, this is the file to which this structure refers.
char * data
Pointer to data.
bool matched
Search matches this Email.
struct Envelope * env
Envelope information.
bool collapsed
Is this message part of a collapsed thread?
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
struct Body * body
List of MIME parts.
bool old
Email is seen, but unread.
size_t num_hidden
Number of hidden messages in this view (only valid when collapsed is set)
bool flagged
Marked important?
time_t date_sent
Time when the message was sent (UTC)
bool replied
Email has been replied to.
bool expired
Already expired?
struct TagList tags
For drivers that support server tagging.
bool deleted
Email is deleted.
bool tagged
Email is tagged.
bool superseded
Got superseded?
time_t received
Time when the message was placed in the mailbox.
struct MuttThread * thread
Thread of Emails.
char *const subject
Email's subject.
struct AddressList to
Email's 'To' list.
char * message_id
Message ID.
char * newsgroups
List of newsgroups.
struct AddressList cc
Email's 'Cc' list.
struct AddressList sender
Email's sender.
struct ListHead references
message references (in reverse order)
struct Buffer spam
Spam header.
struct ListHead in_reply_to
in-reply-to header content
struct AddressList bcc
Email's 'Bcc' list.
struct AddressList from
Email's 'From' list.
enum MailboxType type
Mailbox type.
FILE * fp
pointer to the message data
bool fake_thread
Emails grouped by Subject.
struct MuttThread * child
Child of this Thread.
bool duplicate_thread
Duplicated Email in Thread.
bool all_addr
All Addresses in the list must match.
struct PatternList * child
Arguments to logical operation.
long min
Minimum for range checks.
bool string_match
Check a string for a match.
long max
Maximum for range checks.
bool dynamic
Evaluate date ranges at run time.
short op
Operation, e.g. MUTT_PAT_SCORE.
bool sendmode
Evaluate searches in send-mode.
bool pat_not
Pattern should be inverted (not)