From fea57839fbc7154c498a725f777c7fa0ab6a5e2a Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Mon, 25 Oct 2021 18:13:24 +0200 Subject: 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 --- widgets/msgviewer.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'widgets/msgviewer.go') diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go index 216a8c5e..5e887902 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) -- cgit