From 4048720e54b5bc5e6514844ef096beb59d5ff409 Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Fri, 19 May 2017 17:07:11 +0200 Subject: [PATCH] an address book is really useful --- config/alot/config | 13 +++++++++++++ local/bin/notmuch-abook.sh | 2 ++ 2 files changed, 15 insertions(+) create mode 100755 local/bin/notmuch-abook.sh diff --git a/config/alot/config b/config/alot/config index 8705b3e..322defc 100644 --- a/config/alot/config +++ b/config/alot/config @@ -17,6 +17,13 @@ prefer_plaintext = True sent_tags = inbox sign_by_default = True + [[[abook]]] + type = shellcommand + command = 'notmuch-abook.sh' + regexp = '\[?{"name": "(?P.*)", "address": "(?P.+)", "name-addr": ".*"}[,\]]?' + shellcommand_external_filtering = True + + [[ugent]] realname = Felix Van der Jeugt address = felix.vanderjeugt@ugent.be @@ -28,6 +35,12 @@ prefer_plaintext = True sent_tags = inbox sign_by_default = True + [[[abook]]] + type = shellcommand + command = 'notmuch-abook.sh' + regexp = '\[?{"name": "(?P.*)", "address": "(?P.+)", "name-addr": ".*"}[,\]]?' + shellcommand_external_filtering = True + [bindings] P = shellescape --thread True --refocus True notmuch\ new\ --quiet diff --git a/local/bin/notmuch-abook.sh b/local/bin/notmuch-abook.sh new file mode 100755 index 0000000..2b8e32e --- /dev/null +++ b/local/bin/notmuch-abook.sh @@ -0,0 +1,2 @@ +#!/bin/sh +notmuch address --format=json --output=recipients --output=sender --deduplicate=address from:"$*" OR to:"$*" | rg -i "$*"