aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-01-25 00:34:59 +0100
committerRobin Jarry <robin@jarry.cc>2023-01-26 00:21:14 +0100
commit63f0e0cbc9a5f072d8915717c89d7ab4f4ff94af (patch)
treeb1940dd2d2a07960786b35f51a7278b326a44179 /config
parent402a634937573b86694b372cf76ce375df51f79d (diff)
downloadaerc-63f0e0cbc9a5f072d8915717c89d7ab4f4ff94af.tar.gz
viewer: allow piping full headers in a filter
Allow defining a .headers special filter command that will be used only to process email headers (when [viewer].show-headers=true). Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Kt Programs <ktprograms@gmail.com>
Diffstat (limited to 'config')
-rw-r--r--config/aerc.conf6
-rw-r--r--config/filters.go3
2 files changed, 9 insertions, 0 deletions
diff --git a/config/aerc.conf b/config/aerc.conf
index 1ce4810e..b09a7ab7 100644
--- a/config/aerc.conf
+++ b/config/aerc.conf
@@ -437,6 +437,12 @@ message/rfc822=colorize
#subject,~Git(hub|lab)=lolcat -f
#from,thatguywhodoesnothardwraphismessages=wrap -w 100 | colorize
+# This special filter is only used to post-process email headers when
+# [viewer].show-headers=true
+# By default, headers are piped directly into the pager.
+#
+#.headers=colorize
+
[openers]
#
# Openers allow you to specify the command to use for the :open action on a
diff --git a/config/filters.go b/config/filters.go
index 0b7a1cb2..113a6de6 100644
--- a/config/filters.go
+++ b/config/filters.go
@@ -13,6 +13,7 @@ type FilterType int
const (
FILTER_MIMETYPE FilterType = iota
FILTER_HEADER
+ FILTER_HEADERS
)
type FilterConfig struct {
@@ -57,6 +58,8 @@ func parseFilters(file *ini.File) error {
if err != nil {
return err
}
+ case filter.Filter == ".headers":
+ filter.Type = FILTER_HEADERS
default:
filter.Type = FILTER_MIMETYPE
}