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.45:
- Added -n and -V to usage message.
- Added workarounds to prevent warnings resulting from a bug in Perl 5.6
- A blank line before the start of an email is not required now. This
  allows broken folders created by Netscape to be read.

New in version 4.44:
- execution with -M flag now 35% faster
- Added a Mail::Folder::FastReader module which can cause grepmail to
  run 10-50% faster, depending on your system. Since this module is
  experimental, the installation script will allow you to not install
  the module. A C compiler is required.
- "-----Original Message-----" now recognized as beginning an included
  message
- Fixed a bug where errors would not be displayed if compressed data
  was piped to grepmail
- Date::Parse is now only required if -d is used. (Date::Manip is
  still only required if you use complex date specfications.)
- Added -n flag to print line numbers a la grep
- Fixed a bug in debug output where the email subject was actually the
  sender
- Fixed an undefined value in the printing of flag information
- An ASCII file is now determined to be a mailbox if it has a line
  whose prefix is 'From' or 'X-From-Line:', and another line whose
  prefix is 'Received ', 'Date:', 'Subject:', 'X-Status:', or
  'Status:'.
- Error exits now return 1
- -V flag prints the version
- Fixed a bug in -r counting when used with -h.
- Fixed a bug in the handling of included messages.
- Restructured code: localized reading of the emails from the file,
  removed two functions

See the file CHANGES for a complete change history and credits.


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 addtional 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)

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
  [Choose whether or not to use Mail::Folder::FastReader.]
  % make
  % make test
  % make install

If make test fails, please run

  make testfunc

and see which test(s) are failing. Please email the output of running
the particular test with the -D flag (e.g.:

  blib/script/grepmail library -D -d "before July 9 1998" t/mailarc-1.txt

to the address below.

=> On Windows systems:

- Just copy "grepmail" to a place in your path


DOCUMENTATION

"perldoc grepmail"


HOMEPAGE

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


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/.
