Skip to content

Commit c964219

Browse files
toluschremersion
authored andcommitted
Support BODY and TEXT in search
1 parent d682121 commit c964219

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

imap/mailbox.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,17 @@ func (mbox *mailbox) matchMessage(seqNum, uid uint32, msg *protonmail.Message, c
378378
}
379379
}
380380

381-
// TODO: c.Body, c.Text
381+
for _, e := range c.Body {
382+
if !matchString(msg.Body, e) {
383+
return false
384+
}
385+
}
386+
387+
for _, e := range c.Text {
388+
if !matchString(msg.Body, e) && !matchString(msg.Header, e) {
389+
return false
390+
}
391+
}
382392

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

0 commit comments

Comments
 (0)