Skip to content

Commit

Permalink
Support BODY and TEXT in search
Browse files Browse the repository at this point in the history
  • Loading branch information
toluschr authored and emersion committed Jun 29, 2024
1 parent d682121 commit c964219
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion imap/mailbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,17 @@ func (mbox *mailbox) matchMessage(seqNum, uid uint32, msg *protonmail.Message, c
}
}

// TODO: c.Body, c.Text
for _, e := range c.Body {
if !matchString(msg.Body, e) {
return false
}
}

for _, e := range c.Text {
if !matchString(msg.Body, e) && !matchString(msg.Header, e) {
return false
}
}

for _, e := range c.Or {
if !mbox.matchMessage(seqNum, uid, msg, e[0]) && !mbox.matchMessage(seqNum, uid, msg, e[1]) {
Expand Down

0 comments on commit c964219

Please sign in to comment.