Initial import into the new git repository. Back from the dead!

This commit is contained in:
Daniel Spiljar 2018-10-04 21:28:05 +02:00
commit bd80cfbb4d
40 changed files with 11000 additions and 0 deletions

2
AUTHORS Normal file
View File

@ -0,0 +1,2 @@
$Id: AUTHORS,v 1.2 2002/01/28 23:43:34 dspiljar Exp $

341
COPYING Normal file
View File

@ -0,0 +1,341 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

254
ChangeLog Normal file
View File

@ -0,0 +1,254 @@
Sun Aug 24 21:49:52 CEST 2003 Daniel Spiljar <dspiljar@world.std.com>
* doc/mboxgrep.1, doc/mboxgrep.texi:
small updates
Sat Aug 23 20:56:39 CEST 2003 James P. Dugal <jpd@louisiana.edu>
* src/main.c, src/mbox.h, src/mbox.c
If we are to use rename() to move a temp file (resulting from
deletions done in a mailbox) back over the original mailbox, we
must be sure the temp file is on the same file system. Also,
we should try to preserve the same ownership and permissions.
Mon Aug 11 00:39:14 CEST 2003 Daniel Spiljar <dspiljar@world.std.com>
* configure.ac:
look for pcre-config(1) script; this effectively fixes a
compilation bug on recent RedHat Linux systems
Sun Apr 13 21:16:25 CEST 2003 Daniel Spiljar <dspiljar@world.std.com>
* src/info.c, src/info.h:
print_wrap(); list of compile-time options is now printed wrapped
Mon Apr 7 01:24:20 CEST 2003 Daniel Spiljar <dspiljar@world.std.com>
* src/mbox.c, src/wrap.c, src/wrap.h:
m_gzdopen()
Sun Apr 6 23:04:19 CEST 2003 Daniel Spiljar <dspiljar@world.std.com>
* src/mbox.c, src/mbox.h, src/mboxgrep.h, src/misc.c, src/scan.c:
support for bzip2 compressed mailboxes
Fri Apr 4 00:14:01 CEST 2003 Daniel Spiljar <dspiljar@world.std.com>
* configure.ac:
check for libbz2
Sun Oct 27 23:57:31 CET 2002 Daniel Spiljar <dspiljar@world.std.com>
* src/mbox.c:
mbox_open() should now complain if called with an unknown argument
mode. Shouldn't normally happen, but...
Sun Aug 25 22:43:38 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
* src/main.c, src/mbox.c, src/mbox.h, src/scan.c:
removed the gzmbox* functions in order to avoid code duplication;
as a side effect, mboxgrep can now read compressed mbox folders
from standard input
Sun Aug 11 01:36:02 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
* configure.ac:
AC_HEADER_STDC, which fixed another compiler warning
Sat Aug 10 22:03:31 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
* src/main.c, src/mbox.c, src/mh.c, src/scan.c, src/misc.c, src/maildir.c, src/mboxgrep.h:
made various code cleanups: got rid of a couple of global variables,
fixed compiler warnings and things like that
Sat Aug 10 00:35:21 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
* src/mh.h, src/wrap.h, src/mboxgrep.h:
removed some unnecessary #defines that have been causing compiler
errors
Sun Aug 4 20:11:29 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
* src/main.c, src/scan.c, src/scan.h:
code clean up: moved recursive scan code from main()
to recursive_scan()
Wed Jul 24 00:20:59 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
* src/maildir.c:
same thing with maildir as with MH below
Sat Jul 6 22:51:45 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
* src/mh.c:
MH module doesn't read files which aren't RFC 2822 messages anymore
Sat Jun 29 01:43:36 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
* configure.in, src/maildir.c, src/main.c, src/mbox.c, src/mh.c, src/scan.c:
added debugging with dmalloc library
Sat Jun 29 01:39:21 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
* src/mbox.c, src/maildir.c:
fixed potential problem as with MH folders (below)
Sat Jun 29 01:28:30 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
* src/mh.c, src/scan.c:
(hopefully) fixed crashes on MH folders
Sat Feb 23 22:22:12 CET 2002 Daniel Spiljar <dspiljar@bofhlet.net>
* src/mbox.c, src/maildir.c, src/mh.c, src/misc.c:
removed useless code that required strptime ()
Sat Feb 23 15:43:05 CET 2002 Daniel Spiljar <dspiljar@bofhlet.net>
* src/main.c, src/mbox.h, src/mbox.c, src/scan.c:
mboxgrep can now read mbox folders from standard input
Fri Feb 8 02:15:36 CET 2002 Daniel Spiljar <dspiljar@bofhlet.net>
* src/main.c:
fixed a bug which prevented mboxgrep from being compiled;
this happened because I've put some assignments *before*
declarations
Wed Feb 6 23:11:50 CET 2002 Daniel Spiljar <dspiljar@bofhlet.net>
* src/maildir.c, src/main.c, src/mbox.c, src/mboxgrep.h, src/mh.c, src/mh.h, src/misc.c, src/scan.c, src/wrap.c
code cleanups; many global variables have been replaced with
a single option_t structure
Fri Feb 1 00:31:05 CET 2002 Daniel Spiljar <dspiljar@bofhlet.net>
* src/maildir.c:
fixed a bug which occured on recursive search of maildirs
Wed Jan 2 00:32:37 CET 2002 Daniel Spiljar <dspiljar@bofhlet.net>
* src/main.c, src/misc.c, src/wrap.h:
applied a patch (kindly submitted by John R. Daily
<jdaily@progeny.com>), which fixes missing prototypes that might
cause mboxgrep to coredump on IA64 platform
Sat Dec 15 20:12:40 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
* src/main.c, src/scan.c, src/scan.h:
recursive search through directories has been reimplemented
Sat Dec 8 22:13:54 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
* src/main.c, src/maildir.c:
replaced remaining occurences of malloc() with xmalloc()
Sat Dec 8 21:21:58 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
* src/maildir.c, src/main.c, src/mbox.c, src/mh.c, src/misc.c, src/scan.c, src/wrap.c, src/wrap.h:
wrote xstrdup(), an error-checking wrapper around strdup() and
replaced all occurences of strdup() with xstrdup()
Sun Dec 2 18:05:57 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
* src/Makefile.in, src/info.c, src/main.c, src/mboxgrep.h, src/md5.c, src/md5.h, src/scan.c, src/scan.h, doc/mboxgrep.texi:
mboxgrep can now ignore duplicate messages, thanks to the MD5
algorithm
* src/maildir.c, src/main.c, src/scan.c, src/wrap.c, src/wrap.h:
wrote xcalloc() and renamed m_realloc() to xrealloc()
Sat Nov 17 22:57:57 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
* src/mbox.c, src/mh.c, src/maildir.c
message->headers and message->body pointers are now initially malloc'd
to size of one character in order to prevent NULL pointers from being
passed to regexec()
Wed Nov 7 22:47:34 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
* configure.ac, src/mboxgrep.h, src/main.c, src/misc.h, src/misc.c, src/info.c, src/config.h, src/mbox.c:
file locking method can now be selected at run time
* src/info.c, src/maildir.c, src/main.c, src/mbox.h, src/misc.c, src/scan.c, src/Makefile.in
changed `#include "config.h"' to `#include <config.h>', and fixed
other bugs with #including
Sat Nov 3 16:08:22 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
* configure.ac, src/config.h.in, src/info.c, src/mbox.c
files can be locked with flock() instead of fcntl(), if
enabled at compile time
Sun Oct 28 19:01:44 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
* src/Makefile.in:
forgot to mention getopt.c and getopt1.c
Sun Oct 28 16:06:28 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
* src/mh.c, src/main.c, src/scan.c:
#included certain neccessary files
Sun Oct 28 14:43:21 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
* src/maildir.c, src/maildir.h, src/scan.c:
wrote functions maildir_check and maildir_create;
if the target maildir doesn't exist, mboxgrep creates one;
if it does exist, mboxgrep checks its consistency and refuses to
write to it unless `tmp', `new' and `cur' subdirectories exist
Sun Oct 28 13:02:10 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
* src/info.c, doc/mboxgrep.texi, doc/mboxgrep.1
the "--regexp" command was implemented in version 0.7.0, but I
forgot to document it
Sat Oct 27 21:48:36 CEST 2001 Daniel Spiljar <dspiljar@bofhlet.net>
* src/scan.c:
if the input is a non-mbox folder, a proper postmark line (with
date) is put on top of each message written to stdout
Mon Oct 8 22:53:34 CEST 2001 Daniel Spiljar <dspiljar@bofhlet.net>
* src/*:
source code now completely rewritten
Sun May 27 00:19:52 CEST 2001 Daniel Spiljar <dspiljar@public.srce.hr>
* doc/mboxgrep.1:
updated the manual page -- it now refers to RFC 2822, instead
of the obsoleted 822
Tue May 1 15:06:03 CEST 2001 Daniel Spiljar <dspiljar@public.srce.hr>
* configure.in, doc/Makefile.in, src/Makefile.in, Makefile.in:
moved manpage to the `doc' subdirectory; changed files above
accordingly
Sun Apr 15 23:00:08 CEST 2001 Daniel Spiljar <dspiljar@public.srce.hr>
* src/mboxgrep.h, src/main.c, src/file.c, src/scan.c, src/info.c:
added support for writing messages to another mail folder
Mon Apr 9 21:55:15 CEST 2001 Daniel Spiljar <dspiljar@public.srce.hr>
* src/file.c, src/scan.c: all calls of malloc() are now checked
and mboxgrep exits with code 2 if it fails to allocate memory
Sun Apr 8 19:40:33 CEST 2001 Daniel Spiljar <dspiljar@public.srce.hr>
* src/mboxgrep.h, src/main.c: wrote mboxgrep_stat()
Sun Apr 8 16:58:36 CEST 2001 Daniel Spiljar <dspiljar@public.srce.hr>
* src/mboxgrep.h, src/main.c: wrote mboxgrep_error()
Tue Mar 27 01:26:22 CEST 2001 Daniel Spiljar <dspiljar@public.srce.hr>
* configure.in: check for gethostname()
$Id: ChangeLog,v 1.37 2003/08/24 19:51:12 dspiljar Exp $

37
Makefile.in Normal file
View File

@ -0,0 +1,37 @@
# mboxgrep - scan mailbox for messages matching a regular expression
# Copyright (C) 2000, 01 Daniel Spiljar
#
# Mboxgrep is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Mboxgrep is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with mboxgrep; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# $Id: Makefile.in,v 1.1 2001/10/26 13:07:28 dspiljar Exp $
SHELL = /bin/sh
all:
cd src; $(MAKE)
clean:
cd src; $(MAKE) clean
distclean:
rm -f *~ Makefile config.status config.log config.cache
cd src; $(MAKE) distclean
cd doc; $(MAKE) distclean
install:
cd src; $(MAKE) install
cd doc; $(MAKE) install
.NOEXPORT:

106
NEWS Normal file
View File

@ -0,0 +1,106 @@
Changes of mboxgrep
===================
Changes since 0.7.8
- implemented support for mbox folders compressed with bzip2 algorithm
- improved detection of PCRE library; this also fixes a compilation bug
on recent RedHat Linux systems
- fixed a problem with message deletion, which used to occur if an mbox
folder and temporary directory were on different filesystems;
thanks to James P. Dugal <jpd@louisiana.edu> for providing a patch
Changes since 0.7.7
- fixed crashes on MH folders, as well as a potential problem with mbox
and maildir folders with the same cause
- debugging with dmalloc library
- MH and maildir functions no longer read files which aren't RFC 2822 messages
- mboxgrep can now read gzip compressed mbox folders from standard input
(which is a side effect of a code cleanup!)
Changes since 0.7.6a
- mboxgrep can now read mbox folders from standard input
Changes since 0.7.6
- fixed a bug which prevented mboxgrep from being compiled
Changes since 0.7.5
- fixed a bug which caused mboxgrep to coredump on recursive search of
maildirs
- code cleanups
Changes since 0.7.4
- recursive search through directories has been reimplemented
Changes since 0.7.3
- mboxgrep can now ignore messages with identical bodies
Changes since 0.7.2
- file locking method can be selected at runtime
- mboxgrep used to coredump on messages with empty headers; the problem is
now hopefully fixed
- mboxgrep now compiles on FreeBSD
Changes since 0.7.1
- file locking with flock() instead of fcntl() is now supported
- mboxgrep should now compile on systems which don't have getopt_long()
- other minor bugfixes
Changes since 0.7.0
- bugfixes
Changes since 0.5.3
- NOTE: there was no stable version between 0.5.x and 0.7.x
- mboxgrep is almost completely rewritten
- implemented message deleting feature (--delete)
- implemented piping messages to a command (--pipe) (using this option,
each selected message is piped to a separate instance of the specified
command)
- added support for compressed mbox folders
Changes since 0.5.2
- implemented ability to write found messages to another folder (instead
of stdout)
- started writing *real* changelog (while this file has been renamed to
"NEWS")
- wrote a manual in Texinfo format
Changes since 0.5.1
- implemented message counting (-c, --count)
- fixed manual page installation target in src/Makefile.in -- manual page
is now installed in $(manpath)/man1/ rather than in $(prefix)/man/man1/
- added `--without-sense-of-humor' switch to the configure script, which
disables checking whether Garfield still hates Mondays
- short version of `--version' switch is now `-V' instead of `-v',
because `-v' will be used for inverted matching
- implemented inverted matching (-v, --invert-match)
- implemented recursive search through directories (-r, --recursive)
- config.h[.in] is now wrapped (#ifndef CONFIG_H and stuff)
Changes since 0.5.0
- added support for qmail-style maildir folders
Changes since 0.4.0
- source of getopt_long() is now included, so long options are also available
on platforms that don't use GNU libc
- file locking is now performed on mbox folders only
Changes since 0.2.0
- added support for MH mailboxes
- added scope selection switches `-B' (or `--body') and `-H' (or `--headers')
- getopt() (or getopt_long(), if available) is now used to parse command line
arguments, instead of my own lousy routine
- configure script now looks for PCRE by default, unless `--with-pcre=no' or
`--without-pcre' is specified
- the feature of reading from standard input is gone
- added `-v' (or `--version') switch
Changes since 0.1.1
- mboxgrep now puts a shared lock on a mailbox before reading it
- various code cleanups
Changes since 0.1.0
- fixed install target in Makefile (`install' is now used instead of `cp')
- added support for mailboxes generated by Gnus
$Id: NEWS,v 1.21 2003/08/24 19:23:48 dspiljar Exp $

19
README Normal file
View File

@ -0,0 +1,19 @@
-*- text -*-
mboxgrep - displays e-mail messages matching a pattern
Full description of mboxgrep is contained in the documentation,
which is provided both in manpage and texinfo format, to satisfy
believers of both religions.
The author of mboxgrep is Daniel Spiljar, who can be reached via email
at <dspiljar@world.std.com>. Bug reports, feature requests and flames
are welcome.
If you intend to bundle mboxgrep with an operating system (such as a
GNU/Linux distrubution, for example), please drop me a line about it.
For build instructions, read the file `INSTALL', and run
`./configure --help'
$Id: README,v 1.2 2002/12/02 20:53:07 dspiljar Exp $

26
TODO Normal file
View File

@ -0,0 +1,26 @@
-*- text -*-
- ignore .overview when grepping Gnus folders [X]
- implement inverted matching [X]
- (re)implement recursive search through directories [X]
- implement literal date matching [ ]
- write Texinfo documentation [X]
- implement writing selected messages to a new folder [X]
- implement deleting selected messages [X]
- add support for config files [ ]
- add support for reading messages from stdin [X]
- add support for compressed mbox folders [X]
- make use of lockfile library [ ]
- make use of Solaris' maillock library [ ]
- provide possibility to use flock() instead of fcntl() [X]
- provide national language support with gettext() [ ]
- allow run-time selection of file locking method [X]
- make mboxgrep understand MIME [ ]
- enable removing duplicate messages w/ MD5 checksums [X]
- add checking for conflicting command-line options [ ]
- add support for GnuPG [ ]
- add support for bzip2 compression [X]
- add support for mail folder conversion [ ]
$Id: TODO,v 1.16 2003/04/06 21:48:23 dspiljar Exp $

4941
configure vendored Executable file

File diff suppressed because it is too large Load Diff

98
configure.ac Normal file
View File

@ -0,0 +1,98 @@
# mboxgrep - scan mailbox for messages matching a regular expression
# Copyright (C) 2000, 2001, 2002, 2003 Daniel Spiljar
#
# Mboxgrep is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Mboxgrep is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with mboxgrep; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# $Id: configure.ac,v 1.13 2003/08/10 22:45:45 dspiljar Exp $
# Process this file with autoconf to produce a configure script.
# Yawn.
AC_INIT
AC_LANG(C)
AC_CONFIG_HEADER([src/config.h])
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
# Checks for standard (sp?) header files
AC_HEADER_STDC
AC_HEADER_DIRENT
# Checks for libraries.
# Check for PCRE library
AC_ARG_WITH(pcre, [ --without-pcre Compile without Perl regexp support],,
[
AC_PATH_PROG(PCRE_CONFIG, pcre-config)
if test "$PCRE_CONFIG"; then
CFLAGS="$CFLAGS `$PCRE_CONFIG --cflags`"
LIBS="$LIBS `$PCRE_CONFIG --libs`"
AC_LINK_IFELSE(
[
#include <pcre.h>
int main ()
{
return 0;
}
],
AC_DEFINE(HAVE_LIBPCRE),
[
AC_MSG_NOTICE(found pcre-config but could not compile test program.)
AC_MSG_FAILURE(is PCRE properly installed?)
]
)
else
AC_MSG_NOTICE(pcre-config not found)
AC_MSG_NOTICE(trying to find PCRE anyway)
AC_CHECK_LIB(pcre, main)
fi
]
)
# Check for zlib
AC_ARG_WITH(z, [ --without-zlib Compile without suport for gzip compressed mailboxes],,
AC_CHECK_LIB(z, gzopen))
# Check for bzlib
AC_ARG_WITH(z, [ --without-bzlib Compile without suport for bzip2 compressed mailboxes],,
AC_CHECK_LIB(bz2, BZ2_bzopen))
# Check for dmalloc
AC_ARG_WITH(dmalloc, [ --with-dmalloc Compile with dmalloc library],
AC_CHECK_LIB(dmalloc, main))
# Check for our favorite sarcastic cat's sanity. 8)
AC_ARG_WITH(sense-of-humor, [ --without-sense-of-humor If you have no sense of humor],,
AC_CHECK_LIB(garfield, like_monday))
# AC_ARG_WITH(lockfile, [ --without-lockfile Blah],,
# AC_CHECK_LIB(lockfile, maillock))
AC_CHECK_FUNCS(fcntl)
AC_CHECK_FUNCS([flock])
AC_CHECK_FUNCS([regcomp])
AC_CHECK_FUNCS([strptime])
AC_CHECK_FUNCS(ftw)
AC_CHECK_FUNCS(fts_open)
AC_CONFIG_FILES([Makefile
doc/Makefile
src/Makefile])
AC_OUTPUT

5
contrib/README Normal file
View File

@ -0,0 +1,5 @@
This directory is intended to hold third-party contributions.
- mboxgrep.spec is an RPM spec file, kindly contributed by
Vaclav Slavik <v.slavik@volny.cz>

46
contrib/mboxgrep.spec Normal file
View File

@ -0,0 +1,46 @@
Summary: Grep for mailboxes
Name: mboxgrep
Version: 0.5.3
Release: 1
Epoch: 1
License: GPL
Group: Applications/Internet
Source: http://public.srce.hr/~dspiljar/mboxgrep-%{version}.tar.gz
URL: http://public.srce.hr/~dspiljar/mboxgrep.html
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
mboxgrep is a small utility that scans a mailbox for messages
matching a basic, extended, or Perl-compatible regular
expression. Found messages can be either displayed on
standard output, counted or written to another mailbox.
It supports mbox, MH, nnmh, nnml and maildir folders.
%prep
%setup -q
%build
%configure
%make
%install
rm -rf $RPM_BUILD_ROOT
%makeinstall
%clean
rm -rf $RPM_BUILD_ROOT
%post
/sbin/install-info %{_infodir}/mboxgrep.info* %{_infodir}/dir
%preun
if [ $1 = 0 ]; then
/sbin/install-info --delete %{_infodir}/mboxgrep.info* %{_infodir}/dir
fi
%files
%defattr(-,root,root)
%doc COPYING INSTALL NEWS README
%{_bindir}/*
%{_infodir}/*
%{_mandir}/*/*

41
doc/Makefile.in Normal file
View File

@ -0,0 +1,41 @@
# mboxgrep - search mailbox for messages matching a regular expression
# Copyright (C) 2000, 01 Daniel Spiljar
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# $Id: Makefile.in,v 1.1 2001/10/26 13:07:55 dspiljar Exp $
MANPAGE = mboxgrep.1
INSTALL = @INSTALL@
prefix = @prefix@
mandir = @mandir@
infodir = @infodir@
SHELL = /bin/sh
.PHONY: all
all:
.PHONY: distclean
distclean:
rm -f *~ Makefile
.PHONY: install
install: mboxgrep.1
$(INSTALL) -d $(mandir)/man1
$(INSTALL) -m 0644 $(MANPAGE) $(mandir)/man1
$(INSTALL) -d $(infodir)
$(INSTALL) -m 0644 mboxgrep.info $(infodir)
.NOEXPORT:

122
doc/mboxgrep.1 Normal file
View File

@ -0,0 +1,122 @@
.Id $Id: mboxgrep.1,v 1.15 2003/08/24 19:51:14 dspiljar Exp $
.TH MBOXGREP 1 "24 Aug 2003"
.SH NAME
mboxgrep \- displays email messages matching a pattern
.SH SYNOPSIS
.B mboxgrep
.RI [ OPTIONS ]
.RI PATTERN
.RI [ MAILBOX ]
.SH DESCRIPTION
This manual page refers to
.B mboxgrep
version
.BR 0.7.9 .
.PP
.B mboxgrep
scans a
.I MAILBOX
and displays messages matching
.I PATTERN.
.PP
If a mailbox name is ommited, or a single dash (-) is given instead,
it reads from standard input.
It can read mbox folders or output from another
.B mboxgrep
process from standard input.
.PP
.B mboxgrep
understands POSIX regular expressions, as well as Perl compatible regular
expressions (if enabled at compile time).
.I MAILBOX
can be either a:
.TP
\(bu
mbox folder (either plain or compressed)
.TP
\(bu
MH folder
.TP
\(bu
Gnus nnmh or nnml folder
.TP
\(bu
qmail-style maildir folder
.SH OPTIONS
.PP
.IP "-h, --help"
Display a help screen and exit.
.IP "-V, --version"
Display version and copyright information and exit.
.IP "-r, --recursive"
Descend into directories recursively.
.IP "-E, --extended-regexp"
PATTERN is an extended regular expression. This is default.
.IP "-G, --basic-regexp "
PATTERN is a basic regular expression.
.IP "-P, --perl-regexp"
PATTERN is a Perl regular expression. Works only if enabled at compile time.
.IP "-e, --regexp=PATTERN"
Use PATTERN as a regular expression.
.IP "-i, --ignore-case"
Ignore case distinctions.
.IP "-v, --invert-match"
Select messages which don't match PATTERN.
.IP "-H, --headers"
Match PATTERN against message headers.
.IP "-B, --body"
Match PATTERN against message body.
.IP "-l, --file-lock=METHOD"
Select file locking METHOD. METHOD is `fcntl', `flock', or `none'.
.IP "-nl, --no-file-lock"
Do not lock files. This option is meaningful only if a mbox folder (see below)
is scanned.
.IP "-c, --count"
Suppress normal output and print a count of matching messages.
.IP "-o, --output=FOLDER"
Suppress normal output and write messages to destination folder FOLDER instead.
.IP "-p, --pipe=COMMAND"
Pipe each found message to COMMAND
.IP "-d, --delete"
Suppress normal output and delete selected messages instead. Use with
caution.
.IP "-nd, --no-duplicates"
Ignore duplicate messages.
.IP "-m, --mailbox-format=TYPE"
Select input and output mailbox TYPE. TYPE can be either `mbox' (default),
`zmbox' (meaning `gzip compressed mbox'), `bz2mbox' (meaning `bzip2
compressed mbox'), `mh', `nnml', `nnmh' or `maildir'.
.SH EXAMPLES
.TP
\(bu
Search $MAIL for messages from Dirty Harry:
.PP
mboxgrep '^From:.*callahan@homicide\\.SFPD\\.gov' $MAIL
.TP
\(bu
Display all messages contained in folder ~/Mail/incoming, except those
that appear to originate from AOL:
.PP
mboxgrep -v 'Received:.*aol\\.com' ~/Mail/incoming
.SH BUGS
Report them to address below.
.SH NOTICE
Mboxgrep was alomost completely rewritten since version 0.5.3. Additionally,
there was no stable 0.6.x branch between 0.5.3 and 0.7.0.
.SH SEE ALSO
grep(1),
regex(7),
perlre(1),
mbox(5),
RFC 2822
.SH DEDICATION
Mboxgrep is dedicated in loving memory of Vicky, my cat who died of
tumor on Sep 12, 2002.
.PP
You haven't been long with us, but you gave us a lot of joy and all your
big heart that stopped ticking too early. I will never forget you. Sleep
well, little friend.
.SH URL
http://www.mboxgrep.org/
.SH AUTHOR
Daniel Spiljar <dspiljar@world.std.com>

BIN
doc/mboxgrep.info Normal file

Binary file not shown.

279
doc/mboxgrep.texi Normal file
View File

@ -0,0 +1,279 @@
\input texinfo @c -*-texinfo-*-
@c $Id: mboxgrep.texi,v 1.19 2003/08/24 19:51:14 dspiljar Exp $
@setfilename mboxgrep.info
@settitle Grep through mailboxes
@finalout
@setchapternewpage odd
@set EDITION 0.7
@set VERSION 0.7.9
@set UPDATED 24 Aug 2003
@dircategory Mail
@direntry
* mboxgrep: (mboxgrep). A mail folder scanning utility.
@end direntry
@node Top, , , (dir)
@ifinfo
This file documents @code{mboxgrep} (version @value{VERSION}), a
mailbox scanning utility.
Copyright (C) 2000, 2001, 2002, 2003 Daniel Spiljar
@end ifinfo
@menu
* Introduction:: A short preface.
* Invoking:: Command-line arguments.
* Examples:: A few examples of usage.
* Bugs:: What to do with bugs and similar vermin.
* To Vicky:: Author's dedication.
@end menu
@node Introduction, Invoking, , Top
@chapter Introduction
@cindex introduction
@cindex preface
@code{mboxgrep} is a small, non-interactive utility that scans mail folders
for messages matching regular expressions.
It supports basic and extended POSIX regular expressions. @code{Perl}-style
regular expressions are supported as well, if @code{mboxgrep} is linked with
PCRE library.
Found messages can be either displayed on standard output, counted, deleted,
piped to a specified command, or copied to another mailbox.
It can read and write a variety of folder formats:
@itemize @bullet
@item
mbox folders, either plain or compressed
@item
MH folders
@item nnml and nnmh folders used by Gnus
@item @code{qmail}-style maildirs
@end itemize
Additionally, it can read mbox folders or output from another @code{mboxgrep}
process from standard input. It does so if a single dash (-) is given
as a file name.
@node Invoking, Examples, Introduction, Top
@chapter Command-Line Arguments
@cindex arguments
The syntax of @code{mboxgrep} invocation is:
@example
mboxgrep [OPTIONS] PATTERN [MAILBOX]
@end example
@menu
* Miscellaneous::
* File locking::
* Regexp selection::
* Output control::
* Search scope selection::
* Mailbox type selection::
@end menu
@node Miscellaneous, File locking, , Invoking
@table @samp
@item --help
@itemx -h
Display a brief help screen and exit.
@item --version
@itemx -V
Display program version and copyright information and exit.
@item --recursive
@itemx -r
Descend into directories recursively.
@end table
@node File locking, Regexp selection, Miscellaneous, Invoking
When accessing mbox folders, @code{mboxgrep} puts a shared lock on
files by default. Note that mbox folders normally should not be accessed
without locking.
@table @samp
@item --file-lock=METHOD
@itemx -l METHOD
Specify file locking METHOD. @code{mboxgrep} supports @code{flock} and
@code{fcntl} file locking. However, one of these methods may be
unimplemented on your operating system and thus not available in
@code{mboxgrep} at run time. To disable file locking, specify @code{none}.
@item --no-file-lock
@itemx -nl
Do not attempt to lock mbox folder files.
@end table
@node Regexp selection, Output control, File locking, Invoking
@table @samp
@item --extended-regexp
@itemx -E
PATTERN is an extended regular expression.
@item --basic-regexp
@itemx -G
PATTERN is a basic regular expression.
@item --perl-regexp
@itemx -P
PATTERN is a Perl regular expression.
@item --regexp=PATTERN
@itemx -e PATTERN
Use PATTERN as a regular expression.
@item --ignore-case
@itemx -i
Perform case-insensitive search.
@item --invert-match
@itemx -v
Invert the sense of matching, i.e. select only non-matching messages.
@end table
@node Output control, Search scope selection, Regexp selection, Invoking
By default, @code{mboxgrep} writes found messages to standard output.
The options below change such behavior.
@table @samp
@item --count
@itemx -c
Suppress normal output and print the count of matching (or non-matching,
if used with the @code{-v} option) messages.
@item --delete
@itemx -d
Suppress normal output and delete selected messages.
Use with extreme caution.
@item --no-duplicates
@itemx -nd
Ignore duplicate messages.
@item --output=FOLDER
@itemx -o FOLDER
Suppress normal output and write messages to destination folder FOLDER
instead.
Note that @code{mboxgrep} assumes the output folder is of the same format
as the input folder. Currently there is no possibility to convert folders.
@item --pipe=COMMAND
@itemx -p COMMAND
Suppress normal output and pipe each selected message to a separate
instance of COMMAND.
@item --no-messages
@itemx -s
Suppress error messages.
@end table
@node Search scope selection, Mailbox type selection, Output control, Invoking
@table @samp
@item --headers
@itemx -H
Match PATTERN against message headers.
@item --body
@itemx -B
Match PATTERN against message body.
@end table
@node Mailbox type selection, , Search scope selection, Invoking
@table @samp
@item --mailbox-format=FORMAT
@itemx -m FORMAT
Specify mailbox FORMAT. Supported formats are @code{mbox} (default),
@code{zmbox} (gzip compressed mbox), @code{bz2mbox} (bzip2 compressed
mbox) @code{mh}, @code{nnml}, @code{nnmh}, and @code{maildir}.
@end table
@node Examples, Bugs, Invoking, Top
@chapter Examples
@cindex example
Scan @env{$MAIL} for messages from Dirty Harry:
@example
mboxgrep -H '^From:.*callahan@@homicide\.SFPD\.gov' $MAIL
@end example
Re-mail to George messages that mention his name:
@example
mboxgrep --pipe="/usr/lib/sendmail george" --ignore-case george ~/Mail/*
@end example
Display all messages in folder @file{~/Mail/incoming}, except those that
appear to originate from AOL:
@example
mboxgrep -v -H '^Received:.*aol\.com' ~/Mail/incoming
@end example
Do a case-insensitive scan of @file{~/Mail/incoming} for messages with subject
``Weekly News'' and write them to folder @file{~/Mail/archive}:
@example
mboxgrep -o ~/Mail/archive -H -i '^Subject: Weekly News' ~/Mail/incoming
@end example
Count @emph{all} messages stored in folder @file{spam}, ignoring duplicates:
@example
mboxgrep -nd -c . spam
@end example
@node Bugs, To Vicky, Examples, Top
@chapter Detecting Vermin
@cindex bug, insect, vermin, bugreport
Shortly, if @code{mboxgrep} crashes and/or works differently than described
in this manual, you've found a bug.
Please report bugs to @email{dspiljar@@world.std.com}.
Instructions how to reproduce the bug or output from a debugger would be
highly appreciated. Don't, however, send any coredumps.
@node To Vicky, , Bugs, Top
@chapter Author's Dedication
@cindex vicky, cat, memory, love
@code{Mboxgrep} is dedicated in loving memory of Vicky, my cat who died
of tumor on Sep 12, 2002.
You haven't been long with us, but you gave us a lot of joy and all
your big heart that stopped ticking too early. I will never forget
you. Sleep well, little friend.
@bye @c cruel world

251
install-sh Executable file
View File

@ -0,0 +1,251 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0

21
mboxgrep.lsm Normal file
View File

@ -0,0 +1,21 @@
Begin4
Title: mboxgrep
Version: 0.7.9
Entered-date: 2003-08-24
Description: mboxgrep is a small utility that scans a mailbox for messages
matching a basic, extended, or Perl-compatible regular
expression. Selected messages can be either displayed on
standard output, counted, piped to a command or written to
another mailbox.
It supports mbox (both plain and compressed), MH, nnmh, nnml
and maildir folders.
Keywords: mail, mail-tools, mbox, MH, nnmh, nnml, maildir, regex
Author: dspiljar@world.std.com (Daniel Spiljar)
Maintained-by: dspiljar@world.std.com (Daniel Spiljar)
Primary-site: http://www.mboxgrep.org/
75k mboxgrep-0.7.9.tar.gz
Alternate-site:
Original-site:
Platforms:
Copying-policy: GPL
End

57
src/Makefile.in Normal file
View File

@ -0,0 +1,57 @@
# mboxgrep - scan mailbox for messages matching a regular expression
# Copyright (C) 2000, 2001, 2002, 2003 Daniel Spiljar
#
# Mboxgrep is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Mboxgrep is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with mboxgrep; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# $Id: Makefile.in,v 1.9 2003/03/30 23:07:10 dspiljar Exp $
srcdir = @srcdir@
CC = @CC@
OBJS = info.o main.o mh.o scan.o maildir.o mbox.o misc.o \
wrap.o getopt.o getopt1.o md5.o
SRCS = info.c main.c mh.c scan.c maildir.c mbox.c misc.c \
wrap.c getopt.c getopt1.c md5.c
TARGET = mboxgrep
CFLAGS = @CFLAGS@
LIBS = @LIBS@
INSTALL = @INSTALL@
prefix = @prefix@
SHELL = /bin/sh
INCLUDES = -I. -I$(srcdir)
.SUFFIXES:
.SUFFIXES: .c .o
.c.o:
$(CC) $(CFLAGS) $(INCLUDES) -c $<
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
.PHONY: clean
clean:
rm -f $(TARGET) $(OBJS) core
.PHONY: distclean
distclean:
rm -f *~ Makefile config.h
.PHONY: install
install: mboxgrep
$(INSTALL) -d $(prefix)/bin
$(INSTALL) -s $(TARGET) $(prefix)/bin
.NOEXPORT:

67
src/config.h.in Normal file
View File

@ -0,0 +1,67 @@
/* src/config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#undef HAVE_DIRENT_H
/* Define to 1 if you have the `fcntl' function. */
#undef HAVE_FCNTL
/* Define to 1 if you have the `flock' function. */
#undef HAVE_FLOCK
/* Define to 1 if you have the `fts_open' function. */
#undef HAVE_FTS_OPEN
/* Define to 1 if you have the `ftw' function. */
#undef HAVE_FTW
/* Define to 1 if you have the `bz2' library (-lbz2). */
#undef HAVE_LIBBZ2
/* Define to 1 if you have the `dmalloc' library (-ldmalloc). */
#undef HAVE_LIBDMALLOC