summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2006-06-27 14:34:26 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2006-06-27 14:34:26 +0000
commit4608d6834bf682e578a5d907a2f6b8fb674c07a0 (patch)
tree40cfbd87cf1cbd8d456b0bcc11de7bec9742c673 /src
parent4e167a8cc7dd4a135f23abee763763add28494fd (diff)
Implement filter_prepend_home option.
Diffstat (limited to 'src')
-rw-r--r--src/ACKNOWLEDGMENTS5
-rw-r--r--src/src/filter.c7
-rw-r--r--src/src/macros.h5
-rw-r--r--src/src/routers/redirect.c6
4 files changed, 14 insertions, 9 deletions
diff --git a/src/ACKNOWLEDGMENTS b/src/ACKNOWLEDGMENTS
index ce4bf787c..8eb06f402 100644
--- a/src/ACKNOWLEDGMENTS
+++ b/src/ACKNOWLEDGMENTS
@@ -1,4 +1,4 @@
-$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.46 2006/06/07 15:06:26 fanf2 Exp $
+$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.47 2006/06/27 14:34:26 ph10 Exp $
EXIM ACKNOWLEDGEMENTS
@@ -20,7 +20,7 @@ relatively small patches.
Philip Hazel
Lists created: 20 November 2002
-Last updated: 04 April 2006
+Last updated: 27 June 2006
THE OLD LIST
@@ -157,6 +157,7 @@ Steve Haslam Lots of stuff, including
Sheldon Hearn Suggested patch for smtp_accept_max_nonmail_hosts
Bryan Henderson Patch to use RM_COMMAND everywhere during building
Jakob Hirsch Patch for % operator
+Magnus Holmgren Patch for filter_prepend_home
Kjetil Torgrim Homme Patch for require_files problem on NFS file systems
Tom Hughes Suggested patch for $n bug in pipe command from filter
Pierre Humblet Continued Cygwin support
diff --git a/src/src/filter.c b/src/src/filter.c
index e94cbd135..a924defa2 100644
--- a/src/src/filter.c
+++ b/src/src/filter.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/filter.c,v 1.9 2006/02/07 11:19:00 ph10 Exp $ */
+/* $Cambridge: exim/src/src/filter.c,v 1.10 2006/06/27 14:34:26 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -1834,11 +1834,12 @@ while (commands != NULL)
else
{
+ if (s[0] != '/' && (filter_options & RDO_PREPEND_HOME) != 0 &&
+ deliver_home != NULL && deliver_home[0] != 0)
+ s = string_sprintf("%s/%s", deliver_home, s);
DEBUG(D_filter) debug_printf("Filter: %ssave message to: %s%s\n",
(commands->seen)? "" : "unseen ", s,
commands->noerror? " (noerror)" : "");
- if (s[0] != '/' && deliver_home != NULL && deliver_home[0] != 0)
- s = string_sprintf("%s/%s", deliver_home, s);
/* Create the new address and add it to the chain, setting the
af_pfr and af_file flags, the af_ignore_error flag if necessary, and the
diff --git a/src/src/macros.h b/src/src/macros.h
index 7de0c4bfc..17337089d 100644
--- a/src/src/macros.h
+++ b/src/src/macros.h
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/macros.h,v 1.24 2006/03/09 15:10:16 ph10 Exp $ */
+/* $Cambridge: exim/src/src/macros.h,v 1.25 2006/06/27 14:34:26 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -508,6 +508,7 @@ router, which were chosen to represent the standard situation for users'
#define RDO_REWRITE 0x00020000 /* Rewrite generated addresses */
#define RDO_EXIM_FILTER 0x00040000 /* Forbid Exim filters */
#define RDO_SIEVE_FILTER 0x00080000 /* Forbid Sieve filters */
+#define RDO_PREPEND_HOME 0x00100000 /* Prepend $home to relative paths in Exim filter save commands */
/* This is the set that apply to expansions in filters */
@@ -521,7 +522,7 @@ automated, but I haven't bothered. Keep this list in step with the above! */
enum { RDON_BLACKHOLE, RDON_DEFER, RDON_EACCES, RDON_ENOTDIR, RDON_EXISTS,
RDON_FAIL, RDON_FILTER, RDON_FREEZE, RDON_INCLUDE, RDON_LOG, RDON_LOOKUP,
RDON_PERL, RDON_READFILE, RDON_READSOCK, RDON_RUN, RDON_DLFUNC, RDON_REALLOG,
- RDON_REWRITE, RDON_EXIM_FILTER, RDON_SIEVE_FILTER };
+ RDON_REWRITE, RDON_EXIM_FILTER, RDON_SIEVE_FILTER, RDON_PREPEND_HOME };
/* Results of filter or forward file processing. Some are only from a filter;
some are only from a forward file. */
diff --git a/src/src/routers/redirect.c b/src/src/routers/redirect.c
index c2e2a21fe..d94240ebc 100644
--- a/src/src/routers/redirect.c
+++ b/src/src/routers/redirect.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/routers/redirect.c,v 1.15 2006/02/07 11:19:02 ph10 Exp $ */
+/* $Cambridge: exim/src/src/routers/redirect.c,v 1.16 2006/06/27 14:34:26 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -39,6 +39,8 @@ optionlist redirect_router_options[] = {
(void *)offsetof(redirect_router_options_block, file) },
{ "file_transport", opt_stringptr,
(void *)offsetof(redirect_router_options_block, file_transport_name) },
+ { "filter_prepend_home",opt_bit | (RDON_PREPEND_HOME << 16),
+ (void *)offsetof(redirect_router_options_block, bit_options) },
{ "forbid_blackhole", opt_bit | (RDON_BLACKHOLE << 16),
(void *)offsetof(redirect_router_options_block, bit_options) },
{ "forbid_exim_filter", opt_bit | (RDON_EXIM_FILTER << 16),
@@ -160,7 +162,7 @@ redirect_router_options_block redirect_router_option_defaults = {
NULL, /* srs_dbselect */
#endif
022, /* modemask */
- RDO_REWRITE, /* bit_options */
+ RDO_REWRITE | RDO_PREPEND_HOME, /* bit_options */
FALSE, /* check_ancestor */
TRUE_UNSET, /* check_owner */
TRUE_UNSET, /* check_group */