X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Frda.c;h=1be7b1cc4a21dd4e4760489ef2f7b062793b1b5e;hb=294520c8ca731e79345021d53ab294b83a9c69cd;hp=9ba95c8312865e42e64f1693e032b68d0aa13b49;hpb=c988f1f4faa9f679f79beddf3c14676c5dcb8e28;p=exim.git diff --git a/src/src/rda.c b/src/src/rda.c index 9ba95c831..1be7b1cc4 100644 --- a/src/src/rda.c +++ b/src/src/rda.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/rda.c,v 1.3 2005/01/04 10:00:42 ph10 Exp $ */ +/* $Cambridge: exim/src/src/rda.c,v 1.7 2005/06/16 14:10:13 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -299,14 +299,8 @@ if (fread(filebuf, 1, statbuf.st_size, fwd) != statbuf.st_size) } filebuf[statbuf.st_size] = 0; -/* Don't pass statbuf.st_size directly to debug_printf. On some systems it -is a long, which may not be the same as an int. */ - DEBUG(D_route) - { - int size = (int)statbuf.st_size; - debug_printf("%d bytes read from %s\n", size, filename); - } + debug_printf(OFF_T_FMT " bytes read from %s\n", statbuf.st_size, filename); fclose(fwd); return filebuf; @@ -333,6 +327,8 @@ Arguments: options the options bits include_directory restrain to this directory sieve_vacation_directory passed to sieve_interpret + sieve_useraddress passed to sieve_interpret + sieve_subaddress passed to sieve_interpret generated where to hang generated addresses error for error messages eblockp for details of skipped syntax errors @@ -348,7 +344,8 @@ Returns: a suitable return for rda_interpret() static int rda_extract(redirect_block *rdata, int options, uschar *include_directory, - uschar *sieve_vacation_directory, address_item **generated, uschar **error, + uschar *sieve_vacation_directory, uschar *sieve_useraddress, + uschar *sieve_subaddress, address_item **generated, uschar **error, error_block **eblockp, int *filtertype) { uschar *data; @@ -378,7 +375,7 @@ if (*filtertype != FILTER_FORWARD) (*filtertype == FILTER_EXIM)? "an Exim" : "a Sieve"); /* RDO_FILTER is an "allow" bit */ - + if ((options & RDO_FILTER) == 0) { *error = US"filtering not enabled"; @@ -388,18 +385,18 @@ if (*filtertype != FILTER_FORWARD) expand_forbid = (expand_forbid & ~RDO_FILTER_EXPANSIONS) | (options & RDO_FILTER_EXPANSIONS); - + /* RDO_{EXIM,SIEVE}_FILTER are forbid bits */ - + if (*filtertype == FILTER_EXIM) { if ((options & RDO_EXIM_FILTER) != 0) { *error = US"Exim filtering not enabled"; return FF_ERROR; - } + } frc = filter_interpret(data, options, generated, error); - } + } else { if ((options & RDO_SIEVE_FILTER) != 0) @@ -407,9 +404,9 @@ if (*filtertype != FILTER_FORWARD) *error = US"Sieve filtering not enabled"; return FF_ERROR; } - frc = sieve_interpret(data, options, sieve_vacation_directory, generated, - error); - } + frc = sieve_interpret(data, options, sieve_vacation_directory, + sieve_useraddress, sieve_subaddress, generated, error); + } expand_forbid = old_expand_forbid; return frc; @@ -515,6 +512,8 @@ Arguments: plus ENOTDIR and EACCES handling bits include_directory restrain :include: to this directory sieve_vacation_directory directory passed to sieve_interpret() + sieve_useraddress passed to sieve_interpret + sieve_subaddress passed to sieve_interpret ugid uid/gid to run under - if NULL, no change generated where to hang generated addresses, initially NULL error pointer for error message @@ -541,7 +540,8 @@ Returns: values from extraction function, or FF_NONEXIST: int rda_interpret(redirect_block *rdata, int options, uschar *include_directory, - uschar *sieve_vacation_directory, ugid_block *ugid, address_item **generated, + uschar *sieve_vacation_directory, uschar *sieve_useraddress, + uschar *sieve_subaddress, ugid_block *ugid, address_item **generated, uschar **error, error_block **eblockp, int *filtertype, uschar *rname) { int fd, rc, pfd[2]; @@ -586,7 +586,8 @@ if (!ugid->uid_set || /* Either there's no uid, or */ Ustrstr(data, ":include:") == NULL)) /* and there's no :include: */ { return rda_extract(rdata, options, include_directory, - sieve_vacation_directory, generated, error, eblockp, filtertype); + sieve_vacation_directory, sieve_useraddress, sieve_subaddress, + generated, error, eblockp, filtertype); } /* We need to run the processing code in a sub-process. However, if we can @@ -631,7 +632,8 @@ if ((pid = fork()) == 0) /* Now do the business */ yield = rda_extract(rdata, options, include_directory, - sieve_vacation_directory, generated, error, eblockp, filtertype); + sieve_vacation_directory, sieve_useraddress, sieve_subaddress, generated, + error, eblockp, filtertype); /* Pass back whether it was a filter, and the return code and any overall error text via the pipe. */