Automated subscribe/from/record setup script help
I'm currently using a script to set my folder-hooks and subscribe
statements for mailing lists.
Here's the script:
#v+
#!/bin/sh
# $HOME/.muttrc.mailinglists
cd "$HOME"
MDIRS=`echo Maildir/.lists.*`
for DIR in $MDIRS
do
unset LIST
FILE=`echo "$DIR"/cur/* |sed 's/.\+ //'`
for PAT in "^delivered-to: mailing list " "^x-beenthere: "
"^list-unsubscribe: <mailto:" "^sender: "
do
LIST=${LIST:=`sed -n "/$PAT/Ip" ${FILE}`}
done
if [ "$LIST" != "" ]
then
MLST=`echo "$LIST" |sed -r 's/.+(<)?.+[: ](owner-)?//;
s/-request(@.+)\?.+/\1/'`
echo "subscribe $MLST"
fi
DIR=`echo "$DIR" | sed 's/.\+\/\.//'`
echo "folder-hook +$DIR set from=dave-`echo ${DIR} |sed
's/\./-/g'`@weller-fahy.com"
echo "folder-hook +$DIR set record=imaps://imaps/INBOX/$DIR"
done
#v-
When I start mutt there's a significant lag (mostly because I couldn't
figure out how to select only one file from a given maildir). Can
anyone suggest a better (faster, more efficient) way to achieve the same
results?
Regards,
--
dave [ please don't CC me ]