diff options
author | Gokberk Yaltirakli <leo@gkbrk.com> | 2019-04-07 15:34:38 +0100 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-04-07 14:12:19 -0400 |
commit | ec09ec8b0e70dabe216c2109e52fd21ef7fcae2b (patch) | |
tree | 62210cedb7cc8cedf12ec95933d13e89df2600e8 | |
parent | 4bc8ea34bcfb697394b11996945e02ea0c4f6199 (diff) | |
download | aerc-ec09ec8b0e70dabe216c2109e52fd21ef7fcae2b.tar.gz |
Lowercase MIME types while matching filters
-rw-r--r-- | widgets/msgviewer.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go index 8cd176c..711879b 100644 --- a/widgets/msgviewer.go +++ b/widgets/msgviewer.go @@ -5,6 +5,7 @@ import ( "fmt" "io" "os/exec" + "strings" "github.com/danwakefield/fnmatch" "github.com/emersion/go-imap" @@ -108,7 +109,7 @@ func NewMessageViewer(conf *config.AercConfig, store *lib.MessageStore, pager = exec.Command(cmd[0], cmd[1:]...) for _, f := range conf.Filters { - mime := msg.BodyStructure.MIMEType + "/" + msg.BodyStructure.MIMESubType + mime := strings.ToLower(msg.BodyStructure.MIMEType) + "/" + strings.ToLower(msg.BodyStructure.MIMESubType) switch f.FilterType { case config.FILTER_MIMETYPE: if fnmatch.Match(f.Filter, mime, 0) { |