~sircmpwn/aerc

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH] filters: allow matching any email header

Robin Jarry <robin@jarry.cc>
Details
Message ID
<20211028143037.1636563-1-robin@jarry.cc>
DKIM signature
missing
Download raw message
Patch: +2 -0
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)
			default:
				header = msg.MessageInfo().RFC822Headers.Get(f.Header)
			}
			if f.Regex.Match([]byte(header)) {
				filter = exec.Command("sh", "-c", f.Command)
-- 
2.30.2
Reply to thread Export thread (mbox)