From 105994a8817e4d4618aad762506f8bba11b8ab18 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johannes=20Wei=C3=9Fl?= Date: Sun, 5 Dec 2010 04:29:50 +0100 Subject: [PATCH 1/1] 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. --- muttjump | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 "^\*\*") -- 2.30.2