From: Johannes Weißl Date: Sun, 5 Dec 2010 03:29:50 +0000 (+0100) Subject: work around mairix message-id quoting problem X-Git-Url: https://projects.mako.cc/source/muttjump/commitdiff_plain/105994a8817e4d4618aad762506f8bba11b8ab18 work around mairix message-id quoting problem mairix can't quote special characters (~,/=^) in search words. As a workaround, split Message-ID in 31-character long AND-linked substrings. --- diff --git a/muttjump b/muttjump index 5c7e15f..53a44bb 100755 --- a/muttjump +++ b/muttjump @@ -136,12 +136,19 @@ fi if [ -z "$msgid" ] ; then die "could not find $search_header header in standard input" fi +msgid_quoted=$(quote_regexp "$msgid") msgid_clean=$(echo "$msgid" | sed -e 's/^$//') # try to locate path of message using a mail search engine case $MUTTJUMP_INDEXER in mairix) - orig_msgfiles=$($MAIRIX -r "m:$msgid_clean") + # mairix can't quote special characters (~,/=^) in search words. As a + # workaround, split Message-ID in 31-character long AND-linked + # substrings. + msgid_mairix=$(echo "$msgid_clean" | sed -e 's/[~,/=^]/=,/g' \ + -e 's/.\{31\}/&=,/g' -e 's/^\(=,\)\+//g' -e 's/$/=/' \ + -e 's/\(=,\|=\)\+$/=/g') + orig_msgfiles=$($MAIRIX -r "m:$msgid_mairix") ;; mu) orig_msgfiles=$($MU find -f l "i:$msgid_clean" | grep -v "^\*\*")