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 "$*"