X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/f05da2e8b55f18554ebbcf97523fd54fb03d071e..184e88237dea64ce48076cdd0184612d057cbafd:/src/src/filtertest.c diff --git a/src/src/filtertest.c b/src/src/filtertest.c index 40da59b17..30f29562a 100644 --- a/src/src/filtertest.c +++ b/src/src/filtertest.c @@ -1,10 +1,10 @@ -/* $Cambridge: exim/src/src/filtertest.c,v 1.2 2004/11/25 13:54:31 ph10 Exp $ */ +/* $Cambridge: exim/src/src/filtertest.c,v 1.10 2007/01/08 10:50:18 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2004 */ +/* Copyright (c) University of Cambridge 1995 - 2007 */ /* See the file NOTICE for conditions of use and distribution. */ @@ -22,19 +22,20 @@ we can set up the message_body variables at the same time (in normal use, the message_body variables are not set up unless needed). The reading code is written out here rather than having options in read_message_data, in order to -keep that function as efficient as possible. Handling message_body_end is -somewhat more tedious. Pile it all into a circular buffer and sort out at the -end. +keep that function as efficient as possible. (Later: this function is now +global because it is also used by the -bem testing option.) Handling +message_body_end is somewhat more tedious. Pile it all into a circular buffer +and sort out at the end. -Arguments: +Arguments: dot_ended TRUE if message already terminated by '.' Returns: nothing */ - -static void -read_message_body(dot_ended) -{ + +void +read_message_body(BOOL dot_ended) +{ register int ch; int body_len, body_end_len, header_size; uschar *s; @@ -154,7 +155,7 @@ twice if both system and user filters are being tested. Argument: fd an fd containing the filter file - filename the name of the filter file + filename the name of the filter file is_system TRUE if testing is to be as a system filter dot_ended TRUE if message already terminated by '.' @@ -181,7 +182,7 @@ if (fstat(fd, &statbuf) != 0) filebuf = store_get(statbuf.st_size + 1); rc = read(fd, filebuf, statbuf.st_size); -close(fd); +(void)close(fd); if (rc != statbuf.st_size) { @@ -248,7 +249,7 @@ if (filter_type == FILTER_FORWARD) return TRUE; } -/* For a filter, set up the message_body variables and the message size if this +/* For a filter, set up the message_body variables and the message size if this is the first time this function has been called. */ if (message_body == NULL) read_message_body(dot_ended); @@ -271,7 +272,7 @@ if (is_system) else { yield = (filter_type == FILTER_SIEVE)? - sieve_interpret(filebuf, RDO_REWRITE, NULL, &generated, &error) + sieve_interpret(filebuf, RDO_REWRITE, NULL, NULL, NULL, &generated, &error) : filter_interpret(filebuf, RDO_REWRITE, &generated, &error); }