Skip to content

Commit

Permalink
fix #6
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-kent committed Apr 16, 2017
1 parent 4266627 commit 970ad63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions maildir.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (maildir *Maildir) Search(kind, query string, start, limit int) (*data.Mess
switch kind {
case "to":
for _, t := range msg.To {
if strings.Contains(t.Mailbox+"@"+t.Domain, query) {
if strings.Contains(strings.ToLower(t.Mailbox+"@"+t.Domain), query) {
if start > matched {
matched++
break
Expand All @@ -95,15 +95,15 @@ func (maildir *Maildir) Search(kind, query string, start, limit int) (*data.Mess
}
}
case "from":
if strings.Contains(msg.From.Mailbox+"@"+msg.From.Domain, query) {
if strings.Contains(strings.ToLower(msg.From.Mailbox+"@"+msg.From.Domain), query) {
if start > matched {
matched++
break
}
filteredMessages = append(filteredMessages, *msg)
}
case "containing":
if strings.Contains(msg.Raw.Data, query) {
if strings.Contains(strings.ToLower(msg.Raw.Data), query) {
if start > matched {
matched++
break
Expand Down

0 comments on commit 970ad63

Please sign in to comment.