summary refs log tree commit diff stats
path: root/widgets
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2021-10-25 18:13:24 +0200
committerRobin Jarry <robin@jarry.cc>2021-10-28 16:22:33 +0200
commitfea57839fbc7154c498a725f777c7fa0ab6a5e2a (patch)
tree18b94c69d031e14fba71cdc8edce4d56f71480e5 /widgets
parent1a75906bcbc1915a696259f20373a5a78d4ef8a3 (diff)
downloadaerc-fea57839fbc7154c498a725f777c7fa0ab6a5e2a.tar.gz
filters: allow matching any email header
In addition of the common headers (subject, to, from, cc), allow
matching arbitrary email headers in filters. E.g.:

  x-bugzilla-severity,critical=tput setaf 1; cat;tput sgr0

Signed-off-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets')
-rw-r--r--widgets/msgviewer.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index 216a8c5..5e88790 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -502,6 +502,8 @@ func NewPartViewer(acct *AccountView, conf *config.AercConfig,
 				header = format.FormatAddresses(info.Envelope.To)
 			case "cc":
 				header = format.FormatAddresses(info.Envelope.Cc)
+			default:
+				header = msg.MessageInfo().RFC822Headers.Get(f.Header)
 			}
 			if f.Regex.Match([]byte(header)) {
 				filter = exec.Command("sh", "-c", f.Command)