On Tue, Sep 11, 2007 at 10:02:50AM +1000, Bron Gondwana wrote: > On Mon, Sep 10, 2007 at 02:38:07PM -0400, Ken Murchison wrote: > > A lot of the patches (past and present) have been implemented. Some of the > > others will be implemented in time. Others may not. > > Some of them are still waiting for me to finish polishing them as well! > In particular the pcreposix patch.
As promised, here it is. I'm nearly home, so I'll put it online when I'm connected again. I've reorganised our patchset to put the two patches I want to push directly to you up the top (after the accepted/upstream ones) for minimal fuzz against CVS. P.S. have you seen the way that patches are "patchbomb"ed to the Linux kernel mailing list, and do you think that would make sense for this list? Basically you get: Subject: PATCH [0/N] FastMail.FM Cyrus Patches Subject: -> PATCH [1/N] dbtool-transaction - Make dbtool use a transaction Subject: -> PATCH [2/N] pcreposix - Use PCRE posix-compatability library for regex handling Subject: -> PATCH [3/N] actionstring - Remove sieve action string Etc - with all the additional patches being replies to the header email. Each patch can then start its own separate discussion, and people with threaded email readers can easily follow the conversations (or ignore ones that they aren't interested in) If anyone is interested, I'm happy to bomb our patches here so we can discuss them all individually - especially I'm interested in polishing comments! Thanks, Bron.
Use PCRE posix-compatability library for regex handling We let users generate sieve scripts with regular expressions in them, and occasionally these combine in ugly ways with incoming messages (i.e. a message with hundreds of recipients and an inefficient regex match on recipient addresses caused an lmtp process to grow to over 2Gb in size before it died) This patch tests for the presence of the PCRE library and uses it by preference if available. NOTE: you will need to run autoconf again on your source tree after applying this patch, because it changes configure.in. Index: cyrus-imapd-2.3.9/configure.in =================================================================== --- cyrus-imapd-2.3.9.orig/configure.in 2006-12-01 04:11:16.000000000 +1100 +++ cyrus-imapd-2.3.9/configure.in 2007-09-11 17:16:54.000000000 +1000 @@ -243,10 +243,13 @@ AC_PROG_LEX AC_CHECK_LIB(fl,main) + AC_SEARCH_LIBS(regcomp, pcreposix, [LIBS="${LIBS} -lpcre -lpcreposix" + AC_DEFINE(ENABLE_REGEX,[],[Do we have a decent regex library?]) + AC_CHECK_HEADER(pcreposix.h, AC_DEFINE(HAVE_PCREPOSIX,[],[Do we have pcreposix.h?]))]) + AC_SEARCH_LIBS(regcomp, rx regex, [ AC_DEFINE(ENABLE_REGEX,[],[Do we have a decent regex library?]) AC_CHECK_HEADER(rxposix.h, AC_DEFINE(HAVE_RX,[],[Do we have rxposix.h?]))]) - SIEVE_SUBDIRS="${SIEVE_SUBDIRS} $sievedir" EXTRA_OUTPUT="${EXTRA_OUTPUT} $sievedir/Makefile" Index: cyrus-imapd-2.3.9/sieve/comparator.h =================================================================== --- cyrus-imapd-2.3.9.orig/sieve/comparator.h 2006-12-01 04:11:24.000000000 +1100 +++ cyrus-imapd-2.3.9/sieve/comparator.h 2007-09-11 17:04:34.000000000 +1000 @@ -29,6 +29,9 @@ #define COMPARATOR_H #ifdef ENABLE_REGEX +#ifdef HAVE_PCREPOSIX +#include <pcreposix.h> +#else #ifdef HAVE_RX #include <rxposix.h> #else @@ -36,6 +39,7 @@ #include <regex.h> #endif #endif +#endif /* compares pat to text; returns 1 if it's true, 0 otherwise first arg is text, second arg is pat, third arg is rock */