From 970ad63c574405c1d31aade44081611047343c77 Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Sun, 16 Apr 2017 19:53:22 +0100 Subject: [PATCH] fix #6 --- maildir.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/maildir.go b/maildir.go index 5f09ffb..d102549 100644 --- a/maildir.go +++ b/maildir.go @@ -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 @@ -95,7 +95,7 @@ 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 @@ -103,7 +103,7 @@ func (maildir *Maildir) Search(kind, query string, start, limit int) (*data.Mess 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