aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/msgviewer.go
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/msgviewer.go')
-rw-r--r--widgets/msgviewer.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index 70c079a3..a32e0399 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -541,8 +541,9 @@ func NewPartViewer(acct *AccountView, conf *config.AercConfig,
pager = exec.Command(cmd[0], cmd[1:]...)
info := msg.MessageInfo()
+ mime := part.FullMIMEType()
+
for _, f := range conf.Filters {
- mime := part.FullMIMEType()
switch f.FilterType {
case config.FILTER_MIMETYPE:
if fnmatch.Match(f.Filter, mime, 0) {
@@ -577,6 +578,10 @@ func NewPartViewer(acct *AccountView, conf *config.AercConfig,
}
filter.Env = os.Environ()
filter.Env = append(filter.Env, fmt.Sprintf("PATH=%s", path))
+ filter.Env = append(filter.Env,
+ fmt.Sprintf("AERC_MIME_TYPE=%s", mime))
+ filter.Env = append(filter.Env,
+ fmt.Sprintf("AERC_FILENAME=%s", part.FileName()))
if pipe, err = filter.StdinPipe(); err != nil {
return nil, err
}