grepmail - search mailboxes for a particular email

Grepmail searches a normal, gzip'd, bzip'd, or tzip'd mailbox for a given
regular expression, and returns those emails that match it. Piped input is
allowed, and date and size restrictions are supported.

New in version 4.60:

- Removed -B flag and added -S flag. -B is now performed using -bS.
- Added installation flags to suppress interactive installation. (Thanks to
  Joey Hess for the problem report. He had to patch Makefile.PL for his Debian
  packaging.)
- Fixed a slow implementation of searching for signatures that would cause
  grepmail to crawl for very large emails. Thanks to Joey Hess for discovering
  the inefficiency.
- Fixed a short-circuit which should have bypassed the search for signatures
  if -B was not specified. Thanks to Joey Hess for finding the bug.
- Implemented a new Perl parser which is 5% to 50% faster depending on how
  I/O-bound your system is.
- Restructured the code a bit and improved detection of invalid arguments.


MODULE DEPENDENCIES

grepmail, by itself, can search mailboxes based on regular expression
patterns. However, if you want to search based on date, the
Date::Parse module is required. If you want to use more complex date
specifications, then Date::Manip should be installed as well.

Starting with version 4.44, an additional module is distributed with
grepmail, called Mail::Folder::FastReader. It implements the email
reading capability in C for 10-20% faster execution, depending on your
system. This module is compiled and installed during the installation
of grepmail (see below). You will need Inline version 0.41 or better.

The Date::Parse module is part of the TimeDate distribution, which can be
downloaded from:

  http://www.perl.com/CPAN/authors/id/GBARR/

Date::Manip is at:

  http://www.perl.com/CPAN/authors/id/SBECK/

Alternatively, installation can be done automatically using the CPAN module:

  perl -MCPAN -e 'install Date::Parse'
  perl -MCPAN -e 'install Date::Manip'


INSTALLATION

=> On Non-Windows systems:

  % perl Makefile.PL
  % make
  % make test
  % make install

By default, "perl Makefile.PL" does an interactive installation. You can avoid
the question about installing Mail::Folder::FastReader by specifying either
"FASTREADER=0" or "FASTREADER=1". You can avoid the question about the
installation location by specifying either "PREFIX=/installation/path" (for
installation into a custom location), "INSTALLDIRS=site" (for installation
into site-specific Perl directories), or "INSTALLDIRS=perl" (for installation
into standard Perl directories).

If make test fails, please see the INSTALLATION PROBLEMS section below.

=> On Windows systems:

- Just copy "grepmail" to a place in your path. You may want to rename it
  "grepmail.pl" if you've associated .pl files with perl.exe.


INSTALLATION PROBLEMS

If "make test" fails, run

  make testfunc

and see which test(s) are failing. Please email, to the address below, the
test##.stderr and test##.stdout files for the test, which are located in
t/results. Also email the output of running the test with the -D flag. e.g.:

  blib/script/grepmail library -D -d "before July 9 1998" t/mailarc-1.txt \
    > test##.debug

If you see errors about your timezone, and you are in an uncommon timezone, it
may be the case that Date::Manip does not support your timezone yet. Try this:

  perl -MDate::Manip -e 'print "TIMEZONE: ".&Date::Manip::Date_TimeZone."\n"'

If you get an error, contact the author of Date::Manip.


DOCUMENTATION

Just "perldoc grepmail". After installation on Unix systems, you can also do
"man grepmail".


HOMEPAGE

Visit http://grepmail.sourceforge.net/ for the latest version, mailing lists,
discussion forums, CVS access, and more.


REPORTING BUGS

You can report bugs at http://sourceforge.net/bugs/?group_id=2207. If the test
suite is failing, please attach the .stdout and .stderr files for the test
case(s), which are located in t/results. If this is a bug not in the test
suite, please attach the output of running grepmail with the -D switch.

NOTE: If you get a warning which says "Use of uninitialized value in pattern
match (m//)", check your version of Perl (perl -v). If you're using version
5.6.0, you will need to upgrade.


PRIMARY AUTHOR

Written by David Coppit (david@coppit.org, http://coppit.org/)


LICENSE

This code is distributed under the GNU General Public License (GPL). See
http://www.opensource.org/gpl-license.html and http://www.opensource.org/.
