Re: grepmail problem (resend)

Dan Pritts <[email protected]> Fri, 23 Jan 2009 19:37:40 -0500
Newsgroups gmane.mail.grepmail.general
Message-ID <[email protected]>
On Fri, Jan 23, 2009 at 11:32:03AM -0700, Robert Holtzman wrote:
> On Fri, 23 Jan 2009, Dan Pritts wrote:
> 
> > The syntax you are using searches the file saved-mutt
> > for the string mutt.
> >
> > You probably want something like
> >
> > grepmail -b mutt /var/spool/mail/holtzman > saved-mutt
> >
> > Substitute the actual location of your inbox folder for the /var/spool/mail
> > file i mention.

a clarification, when i said "folder" i meant mbox file, sometimes called
a mail folder.  I didn't mean a directory on the filesystem.

> That's a little confusing because one of the examples in the man page is
> 
> grepmail -hb "Pilot" saved-mail*

that will search all files  beginning with "saved-mail" for the string
"Pilot" in the header.  It will output the results to standard output
(which is what your original command did, too, but since it was searching
an empty file it didn't find anything).

> subject is in before I search? I was under the impression the entire 
> contents of the /mail directory would be searched. Could you please 
> clarify this?

It'll search whatever file(s) you tell it to.  If you want multiple files
you just specify that; or you can use the -r option to do it recursively on a
directory and all the files and directories in it.

e.g.:

  grepmail -b mutt /home/holtzm/mail/* > saved-mutt

  grepmail -br mutt /home/holtzm/mail > saved-mutt

The previous two are not identical; the first will only search files
in /home/holtzm/mail, whereas the second will recurse subdirectories.

  cd /home/holtzm/mail
  grepmail -b mutt foo bar ack baz > saved-mutt

Note that if you do:

  cd /home/holtzm/mail
  grepmail -b mutt * > saved-mutt

You may hit an infinite recursion; your shell may create "saved-mutt"
before it expands the *.  This is a shell issue, not a grepmail issue.

danno

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword