<<< Date Index >>>     <<< Thread Index >>>

Re: mutt in command-line mode



On Thu, Jun 24, 2004 at 09:40:41PM +0200, Ren Clerc wrote:
> Supply '-e "push l~f$username\n"' when you invoke mutt.

Ah, thank you!

This has led to a much better shell function:
interesting_mail () { 
        FOO=/tmp/int_$$
        let curCounter=1
        for fi in `grep -l $1 /home/rsr/mail/archives/*`; do
                if [ $curCounter -eq 1 ]; then
                        mutt -f $fi -e "push 
T~f$1\n<tag-prefix>s/tmp/interesting_$1\nyqn"
                else
                        mutt -f $fi -e "push 
T~f$1\n<tag-prefix>s/tmp/interesting_$1\nqn"
                fi
                let curCounter+=1       
        done
        mutt -f /tmp/interesting_$1
        echo "Mail archives that included $1 are in /tmp/interesting_$1"
}

This means that instead of creating a temporary file that contains far more
messages than I need, I invoke mutt on each of the files that has a hit and
tell it to automatically save matches to my /tmp/interesting_$1 file, which
I then read with mutt.  It's faster and means I don't run out of space when
I'm looking for someone who, for example, has sent me one message per week 
for the last two years.

-roy