#!/bin/sh
# searching in Mutt, (C) M. Andreoli, for muLinux
# Is called within a mutt macro
TMP=/tmp/search$$

echo -n "Filter b)ody h)eaders s)ubject k)ripted m)ailing-lists :"
read type

case $type in
b)      F="~b";;
h)      F="~h";;
s)      F="~s";;
m)      F="~l";;
k)      F="~k";;
*)      F="~h";;
esac

case $type in
m|k)
	;;
*)
	echo -n "Enter (rustic) filter: "
	read filter
	;;
esac

cat > /tmp/mutt.rc <<END
set auto_tag
push "T${F}${filter}\nC${TMP}\ny^T~A\n!mutt -f ${TMP};rm ${TMP}\n"
END
