filters: allow matching any email header v1 PROPOSED

Robin Jarry: 1
 filters: allow matching any email header

 1 files changed, 2 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/aerc/patches/26010/mbox | git am -3
Learn more about email & git

[PATCH] filters: allow matching any email header Export this patch

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>
 widgets/msgviewer.go | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index 216a8c5e0209..5e8879026111 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)
				header = msg.MessageInfo().RFC822Headers.Get(f.Header)
			if f.Regex.Match([]byte(header)) {
				filter = exec.Command("sh", "-c", f.Command)