Commit a48a7d6b authored by Sean Whitton's avatar Sean Whitton

Imported Upstream version 0.23+git20131125

parents
*.o
*.swp
*.report
.RELEASES
Makefile
RELEASES
config.log
datescan.c
datescan.h
fromcheck.c
fromcheck.h
mairix
make.log
nvpscan.c
nvpscan.h
nvp.report
version.h
These people have contributed useful patches, ideas and suggestions:
Anand Kumria
Andr Costa
Andreas Amann
Andre Costa
Aredridel
Balzs Szab
Bardur Arantsson
Benj. Mako Hill
Chris Mason
Christoph Dworzak
Christopher Rosado
Chung-chieh Shan
Claus Alboege
Corrin Lakeland
Dan Egnor
Daniel Jacobowitz
Dirk Huebner
Ed Blackman
Emil Sit
Felipe Gustavo de Almeida
Ico Doornekamp
Jaime Velasco Juan
James Leifer
Jerry Jorgenson
Joerg Desch
Johannes Schindelin
Johannes Weil
John Arthur Kane
John Keener
Jonathan Kamens
Josh Purinton
Karsten Petersen
Kevin Rosenberg
Mark Hills
Martin Danielsson
Matthias Teege
Mikael Ylikoski
Mika Fischer
Oliver Braun
Paramjit Oberoi
Paul Fox
Peter Chines
Peter Jeremy
Robert Hofer
Roberto Boati
Samuel Tardieu
Sanjoy Mahajan
Satyaki Das
Steven Lumos
Tim Harder
Tom Doherty
Vincent Lefevre
Vladimir V. Kisil
Will Yardley
Wolfgang Weisselberg
I apologise to any contributors who have been omitted from this list!
This diff is collapsed.
Installation of mairix goes as follows:
./configure
make
make install
You need to be root to run the final step unless you're installing under your
own home directory somewhere.
However, you might want to tune the options further. The configure script
shares its common options with the usual autoconf-generated scripts, even
though it's not autoconf-generated itself. For example, a fuller build could
use
CC=gcc CFLAGS="-O2 -Wall" ./configure \
--prefix=/opt/mairix \
--infodir=/usr/share/info
make
make install
The final step is to create a ~/.mairixrc file. An example is included in the
file dotmairixrc.eg. Just copy that to ~/.mairixrc and edit it.
#########################################################################
#
# mairix - message index builder and finder for maildir folders.
#
# Copyright (C) Richard P. Curnow 2002-2004,2006
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# 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.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# =======================================================================
#########################################################################
# Edit the following variables as required
CC=@cc@
CFLAGS=@cflags@ @defs@
CPPFLAGS=@CPPFLAGS@
LDFLAGS=@LDFLAGS@
LIBS=@LIBS@
#######################################################################
# If you're generating a package, you may want to use
# make DESTDIR=temporary_dir install
# to get the software installed to a directory where you can create
# a tdl.tar.gz from it
DESTDIR=
#######################################################################
prefix=$(DESTDIR)@prefix@
bindir=$(DESTDIR)@bindir@
mandir=$(DESTDIR)@mandir@
man1dir=$(mandir)/man1
man5dir=$(mandir)/man5
infodir=$(DESTDIR)@infodir@
docdir=$(DESTDIR)@docdir@
#########################################################################
# Things below this point shouldn't need to be edited.
OBJ = mairix.o db.o rfc822.o tok.o hash.o dirscan.o writer.o \
reader.o search.o stats.o dates.o datescan.o mbox.o md5.o \
fromcheck.o glob.o dumper.o expandstr.o dotlock.o \
nvp.o nvpscan.o
all : mairix
mairix : $(OBJ)
$(CC) -o mairix $(CFLAGS) $(LDFLAGS) $(OBJ) $(LIBS)
%.o : %.c memmac.h mairix.h reader.h Makefile
$(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
datescan.c datescan.h : datescan.nfa ./dfasyn/dfasyn
./dfasyn/dfasyn -o datescan.c -ho datescan.h -r datescan.report -v -u datescan.nfa
fromcheck.c fromcheck.h : fromcheck.nfa ./dfasyn/dfasyn
./dfasyn/dfasyn -o fromcheck.c -ho fromcheck.h -r fromcheck.report -v -u fromcheck.nfa
nvpscan.c nvpscan.h : nvp.nfa ./dfasyn/dfasyn
./dfasyn/dfasyn -o nvpscan.c -ho nvpscan.h -r nvpscan.report -v -u nvp.nfa
dates.o : datescan.h
mbox.o : fromcheck.h
nvp.o : nvpscan.h
version.h:
./mkversion
./dfasyn/dfasyn:
if [ -d dfasyn ]; then cd dfasyn ; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" ; else echo "No dfasyn subdirectory?" ; exit 1 ; fi
clean:
-rm -f *~ *.o mairix *.s core
-rm -f mairix.cp mairix.fn mairix.aux mairix.log mairix.ky mairix.pg mairix.toc mairix.tp mairix.vr
-rm -f fromcheck.[ch] datescan.[ch]
-rm -f nvpscan.[ch]
if [ -d dfasyn ]; then cd dfasyn ; $(MAKE) clean ; fi
if [ -d test ]; then cd test ; $(MAKE) clean ; fi
distclean: clean
if [ -d test ]; then cd test ; $(MAKE) distclean ; fi
-rm -f Makefile config.log
install:
[ -d $(prefix) ] || mkdir -p $(prefix)
[ -d $(bindir) ] || mkdir -p $(bindir)
[ -d $(mandir) ] || mkdir -p $(mandir)
[ -d $(man1dir) ] || mkdir -p $(man1dir)
[ -d $(man5dir) ] || mkdir -p $(man5dir)
cp -f mairix $(bindir)
chmod 555 $(bindir)/mairix
cp -f mairix.1 $(man1dir)
chmod 444 $(man1dir)/mairix.1
cp -f mairixrc.5 $(man5dir)
chmod 444 $(man5dir)/mairixrc.5
check: mairix
if [ -d test ]; then cd test ; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" check ; else echo "No test subdirectory?" ; exit 1 ; fi
.PHONY : all install clean distclean check
mairix.o : version.h
This diff is collapsed.
mairix is a program for indexing and searching email messages stored in
Maildir, MH or mbox folders.
* Indexing is fast. It runs incrementally on new messages - any particular
message only gets scanned once in the lifetime of the index file.
* The search mode populates a "virtual" folder with symlinks(*) which
point to the real messages. This folder can be opened as usual in your mail
program.
* The search mode is very fast.
* Indexing and searching works on the basis of words. The index file tabulates
which words occur in which parts (particular headers + body) of which
messages.
The program is a very useful complement to mail programs like mutt
(http://www.mutt.org/, which supports Maildir, MH and mbox folders) and
Sylpheed (which supports MH folders).
[(*) where the input or output folder is an mbox, a copy of the message is made
instead of symlinking.]
See also the mairix.txt file.
*********************************************************************
Copyright (C) Richard P. Curnow 2002-2004
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
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.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*********************************************************************
Suggestions, bug reports, experiences, praise, complaints etc to the author
please, at <rc@rc0.org.uk>
Since July 2006, there is a mairix-users mailing list. To subscribe or to view
the archives, visit
https://lists.sourceforge.net/lists/listinfo/mairix-users
The main website for mairix is
http://www.rc0.org.uk/mairix
The SourceForge project page is
http://www.sf.net/projects/mairix
ACKNOWLEDGEMENTS
================
See the ACKNOWLEDGEMENTS file
#!/bin/sh
#########################################################################
#
# mairix - message index builder and finder for maildir folders.
#
# Copyright (C) Richard P. Curnow 2003,2004,2005
# Copyright (C) Paramjit Oberoi 2005
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# 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.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# =======================================================================
if [ -f config.log ]; then rm -f config.log ; fi
exec 5>config.log
MYCC=${CC:-gcc}
MYCFLAGS=${CFLAGS:--O2 -Wall}
MYCPPFLAGS=${CPPFLAGS:-}
MYLDFLAGS=${LDFLAGS:-}
# =======================================================================
# Functions
#{{{ cleanup
cleanup () {
if [ -f docheck.c ]; then rm -f docheck.c ; fi
if [ -f docheck.o ]; then rm -f docheck.o ; fi
if [ -f docheck ]; then rm -f docheck ; fi
rm -rf docheck.c docheck.o docheck
}
#}}}
#{{{ test_cc : basic compiler sanity check
test_cc () {
printf "Testing whether your compiler \"$MYCC $MYCFLAGS\" works : "
cat >docheck.c <<EOF;
#include <stdio.h>
int main (int argc, char **argv)
{
return 0;
}
EOF
${MYCC} ${MYCFLAGS} -o docheck docheck.c 1>&5 2>&5
if [ $? -eq 0 ]
then
printf "it works\n"
else
printf "it doesn't work\n"
printf "Failed program was\n" 1>&5
cat docheck.c 1>&5
rm -f docheck.c docheck
exit 1
fi
cleanup
}
#}}}
#{{{ test_for_stdint_h
test_for_stdint_h () {
cat >docheck.c <<EOF;
#include <stdint.h>
int main(int argc, char **argv) {
return 0;
}
EOF
${MYCC} ${MYCFLAGS} -c -o docheck.o docheck.c >/dev/null 2>&1
if [ $? -eq 0 ]
then
result=0
else
result=1
fi
rm -f docheck.c docheck.o
echo $result
}
#}}}
#{{{ test_for_inttypes_h
test_for_inttypes_h () {
cat >docheck.c <<EOF;
#include <inttypes.h>
int main(int argc, char **argv) {
return 0;
}
EOF
${MYCC} ${MYCFLAGS} -c -o docheck.o docheck.c >/dev/null 2>&1
if [ $? -eq 0 ]
then
result=0
else
result=1
fi
rm -f docheck.c docheck.o
echo $result
}
#}}}
#{{{ test_for_zlib
test_for_zlib () {
cat > docheck.c <<EOF;
#include <zlib.h>
int main () {
const char *foo;
foo = zlibVersion();
return 0;
}
EOF
echo "Test program is" 1>&5
cat docheck.c 1>&5
${MYCC} ${MYCPPFLAGS} ${MYCFLAGS} ${MYLDFLAGS} -o docheck docheck.c -lz 1>&5 2>&1
if [ $? -eq 0 ]
then
result=0
else
result=1
fi
rm -f docheck.c docheck
echo $result
}
#}}}
#{{{ test_for_bzlib
test_for_bzlib () {
cat > docheck.c <<EOF;
#include <bzlib.h>
int main () {
const char *foo;
foo = BZ2_bzlibVersion();
return 0;
}
EOF
echo "Test program is" 1>&5
cat docheck.c 1>&5
${MYCC} ${MYCPPFLAGS} ${MYCFLAGS} ${MYLDFLAGS} -o docheck docheck.c -lbz2 1>&5 2>&1
if [ $? -eq 0 ]
then
result=0
else
result=1
fi
rm -f docheck.c docheck
echo $result
}
#}}}
#{{{ test_for_bison
test_for_bison () {
bison --help > /dev/null
if [ $? -eq 0 ]
then
result=0
else
result=1
fi
echo $result
}
#}}}
#{{{ test_for_flex
test_for_flex () {
flex --help > /dev/null
if [ $? -eq 0 ]
then
result=0
else
result=1
fi
echo $result
}
#}}}
#{{{ usage
usage () {
cat <<EOF;
\`configure' configures tdl to adapt to many kinds of systems.
Usage: ./configure [OPTION]...
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
By default, \`make install' will install all the files in
\`/usr/local/bin', \`/usr/local/lib' etc. You can specify
an installation prefix other than \`/usr/local' using \`--prefix',
for instance \`--prefix=$HOME'.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--infodir=DIR info documentation [PREFIX/info]
--mandir=DIR man documentation [PREFIX/man]
--docdir=DIR other documentation [PREFIX/doc/mairix-\$version]
Other options:
--enable-gzip-mbox attempt to support gzipped mboxes (requires zlib)
--disable-gzip-mbox don't attempt to support gzipped mboxes
--enable-bzip-mbox attempt to support bzip2ed mboxes (requires bzlib)
--disable-bzip-mbox don't attempt to support bzip2ed mboxes
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
CPPFLAGS Extra C preprocessor flags, e.g. -I<include dir> if you
have header files in a nonstandard directory <include dir>
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
Use these variables to override the choices made by \`configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to <rc@rc0.org.uk>.
EOF
}
#}}}
# =======================================================================
# Defaults for variables
PREFIX=/usr/local
use_readline=yes
bad_options=no
use_gzip_mbox=yes
use_bzip_mbox=yes
# Parse options to configure
for option
do
case "$option" in
--prefix=* | --install-prefix=* )
PREFIX=`echo $option | sed -e 's/[^=]*=//;'`
;;
--bindir=* )
BINDIR=`echo $option | sed -e 's/[^=]*=//;'`
;;
--mandir=* )
MANDIR=`echo $option | sed -e 's/[^=]*=//;'`
;;
--infodir=* )
INFODIR=`echo $option | sed -e 's/[^=]*=//;'`
;;
--docdir=* )
DOCDIR=`echo $option | sed -e 's/[^=]*=//;'`
;;
--enable-gzip-mbox )
use_gzip_mbox=yes
;;
--disable-gzip-mbox )
use_gzip_mbox=no
;;
--enable-bzip-mbox )
use_bzip_mbox=yes
;;
--disable-bzip-mbox )
use_bzip_mbox=no
;;
-h | --help )
usage
exit 1
;;
* )
printf "Unrecognized option : $option\n"
bad_options=yes
;;
esac
done
if [ ${bad_options} = yes ]; then
exit 1
fi
DEFS=""
test_cc
printf "Checking for <stdint.h> : "
if [ `test_for_stdint_h` -eq 0 ]; then
printf "Yes\n"
DEFS="${DEFS} -DHAS_STDINT_H"
else
printf "No\n"
fi
printf "Checking for <inttypes.h> : "
if [ `test_for_inttypes_h` -eq 0 ]; then
printf "Yes\n"
DEFS="${DEFS} -DHAS_INTTYPES_H"
else
printf "No\n"
fi
if [ $use_gzip_mbox = "yes" ]; then
printf "Checking for zlib : "
if [ `test_for_zlib` -eq 0 ]; then
printf "Yes\n";
DEFS="${DEFS} -DUSE_GZIP_MBOX"
LIBS="-lz"
else
printf "No (disabled gzipped mbox support)\n";
fi
fi
if [ $use_bzip_mbox = "yes" ]; then
printf "Checking for bzlib : "
if [ `test_for_bzlib` -eq 0 ]; then
printf "Yes\n";
DEFS="${DEFS} -DUSE_BZIP_MBOX"
LIBS="${LIBS} -lbz2"
else
printf "No (disabled bzip2ed mbox support)\n";
fi
fi
printf "Checking for bison : "
if [ `test_for_bison` -eq 0 ]; then
printf "Yes\n";
else
printf "No\n";
exit 1;
fi
printf "Checking for flex : "
if [ `test_for_flex` -eq 0 ]; then
printf "Yes\n";
else
printf "No\n";
exit 1;
fi
#{{{ Determine version number of the program.
if [ -f version.txt ]; then
revision=`cat version.txt`
else
revision="DEVELOPMENT"
fi
#}}}
if [ "x" = "x${BINDIR}" ]; then BINDIR=${PREFIX}/bin ; fi
if [ "x" = "x${MANDIR}" ]; then MANDIR=${PREFIX}/man ; fi
if [ "x" = "x${INFODIR}" ]; then INFODIR=${PREFIX}/info ; fi
if [ "x" = "x${DOCDIR}" ]; then DOCDIR=${PREFIX}/doc/mairix-${revision} ; fi
echo "Generating Makefile"
rm -f Makefile
sed -e "s%@cc@%${MYCC}%; \
s%@defs@%${DEFS}%; \
s%@cflags@%${MYCFLAGS}%; \
s%@prefix@%${PREFIX}%; \
s%@bindir@%${BINDIR}%; \
s%@mandir@%${MANDIR}%; \
s%@infodir@%${INFODIR}%; \
s%@docdir@%${DOCDIR}%; \
s%@LIBS@%${LIBS}%; \
s%@CPPFLAGS@%${MYCPPFLAGS}%; \
s%@LDFLAGS@%${MYLDFLAGS}%; \
" < Makefile.in > Makefile
# Avoid editing Makefile instead of Makefile.in
chmod ugo-w Makefile
# =======================================================================
# vim:et:sw=2:ht=2:sts=2:fdm=marker:cms=#%s
This diff is collapsed.
/*
mairix - message index builder and finder for maildir folders.
**********************************************************************
* Copyright (C) Richard P. Curnow 2002-2004
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
**********************************************************************
*/
#ifndef DATES_H
#define DATES_H
enum DATESCAN_TYPE {
DS_FAILURE,
DS_D,
DS_Y,
DS_YYMMDD,
DS_SCALED,
DS_M,
DS_DM,
DS_MD,
DS_YM,
DS_MY,
DS_YMD,
DS_DMY,
};
extern int datescan_next_state(int current_state, int next_token);
extern enum DATESCAN_TYPE datescan_exitval[];
#endif /* DATES_H */