David -- ...and then David Collantes said... % % On 04-03-2002 at 08:27 EST, Ralf Hildebrandt <[EMAIL PROTECTED]> wrote: % % > > Does anyone knows a grepmail alike tool that will work on Maildirs? Thanks! % > % > grep -r expression Maildir/* % % Hmmm, that I knew. I was looking for a way to get a nicer printout. Grepmail % will allow to print the results back into Mutt in a very organized way, with % a list of the emails containing the expression.
The whole reason for grepmail is because it's challenging to pull a
single message out of an entire mbox; that's a piece of cake in a Maildir,
since every message is in its own file.
A quickie script that you might call grepmaildir that looks about like
#!/bin/sh
FILES=`grep -lr $1 $*`
if [ -n $FILES ]
then
mkdir -p /tmp/grepmaildir.temp.$$/cur
cp -p $FILES /tmp/grepmaildir.temp.$$/cur
mutt -R /tmp/grepmaildir.temp.$$
rm -r /tmp/grepmaildir.temp.$$
fi
but which in reality should be much prettier (and, unlike this, would be
even rudimentarily tested :-) would do the same thing as grepmail + grepm;
alternatively, you could skip the whole temp Maildir bit and just pump the
resultant files through formail to generate ^From_ headers and then have
a drop-in replacement for grepmail (to then be called by grepm or such).
%
% Cheers,
HTH & HAND
%
% --
% David Collantes - http://www.bus.ucf.edu/david/
% College of Business Administration, University of Central Florida
% "The only source of knowledge is experience."
:-D
--
David T-G * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
msg26596/pgp00000.pgp
Description: PGP signature
