From 85ea4e44f7807d1387ce5696e8a4474f8b2f93bc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johannes=20Wei=C3=9Fl?= Date: Mon, 6 Dec 2010 08:43:14 +0100 Subject: [PATCH] only quote mairix Message-ID when necessary --- muttjump | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/muttjump b/muttjump index 9cb34b1..3cdb6ed 100755 --- a/muttjump +++ b/muttjump @@ -150,12 +150,15 @@ msgid_clean=$(echo "$msgid" | sed -e 's/^$//') # try to locate path of message using a mail search engine case $MUTTJUMP_INDEXER in mairix) + msgid_mairix=$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/ *$/=/g' \ - -e 's/ /=,/g') + if echo "$msgid_clean" | grep -q '[~,/=^]' ; then + msgid_mairix=$(echo "$msgid_clean" | sed -e 's/[~,/=^]\+/ /g' \ + -e 's/[^ ]\{31\}/& /g' -e 's/^ \+//g' -e 's/ *$/=/g' \ + -e 's/ /=,/g') + fi orig_msgfiles=$($MAIRIX -r "m:$msgid_mairix") ;; mu) -- 2.39.5