diff options
author | Robin Jarry <robin@jarry.cc> | 2023-01-25 00:34:59 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-01-26 00:21:14 +0100 |
commit | 63f0e0cbc9a5f072d8915717c89d7ab4f4ff94af (patch) | |
tree | b1940dd2d2a07960786b35f51a7278b326a44179 /config | |
parent | 402a634937573b86694b372cf76ce375df51f79d (diff) | |
download | aerc-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.conf | 6 | ||||
-rw-r--r-- | config/filters.go | 3 |
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 } |