aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2024-03-13 13:48:38 +0100
committerRobin Jarry <robin@jarry.cc>2024-03-25 23:11:22 +0100
commit6ffc0ed5991bef69a50cbc22647af0a6a0e0a895 (patch)
tree268c12d3a9104ae5b5580eda15488914a8abcd6b /doc
parent523ca15a3b4882a4e49eb4736cc2d5d11b8df9a7 (diff)
downloadaerc-6ffc0ed5991bef69a50cbc22647af0a6a0e0a895.tar.gz
aerc-6ffc0ed5991bef69a50cbc22647af0a6a0e0a895.zip
filters: add matching against attachment filename
The mimetype of attachments are set by the sender, which can results in attachments getting not so useful mimetypes (e.g. application/octet-stream for a csv). Allow matching filter against filenames directly, by adding the `.filename,` and `.filename,~` syntax, similarly to headers. Changelog-added: Match filters on filename via `.filename,~<regexp> =`. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'doc')
-rw-r--r--doc/aerc-config.5.scd11
1 files changed, 10 insertions, 1 deletions
diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd
index b26d7695..60fc5b7f 100644
--- a/doc/aerc-config.5.scd
+++ b/doc/aerc-config.5.scd
@@ -906,7 +906,8 @@ filter which matches the part's MIME type will be used, so order them from most
to least specific. You can also match on non-MIME types, by prefixing with the
header to match against (non-case-sensitive) and a comma, e.g. _subject,text_
will match a subject which contains _text_. Use _header,~regex_ to match
-against a _regex_.
+against a _regex_. Using _.filename_ instead of a header will match against the
+filename of an attachment.
Note that aerc will pipe the content into the configured filter program, so
filters need to be able to read from standard input. Many programs support
@@ -1080,6 +1081,14 @@ _image/\*_
image/\*=catimg -w$(tput cols) -
```
+_.filename,~<regexp>_
+ Match <regexp> against the filename of an attachment, e.g. to split
+ csv-s into columns:
+
+ ```
+ .filename,~.*\.csv=column -t --separator=","
+ ```
+
See the wiki at https://man.sr.ht/~rjarry/aerc/ for more examples and possible
customizations of the built-in filters.