-/* $Cambridge: exim/src/src/routers/redirect.c,v 1.3 2004/12/16 15:11:48 tom Exp $ */
+/* $Cambridge: exim/src/src/routers/redirect.c,v 1.7 2005/03/22 14:11:55 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 2004 */
+/* Copyright (c) University of Cambridge 1995 - 2005 */
/* See the file NOTICE for conditions of use and distribution. */
(void *)offsetof(redirect_router_options_block, bit_options) },
{ "forbid_file", opt_bool,
(void *)offsetof(redirect_router_options_block, forbid_file) },
+ #ifdef EXPAND_DLFUNC
+ { "forbid_filter_dlfunc", opt_bit | (RDON_DLFUNC << 16),
+ (void *)offsetof(redirect_router_options_block, bit_options) },
+ #endif
{ "forbid_filter_existstest", opt_bit | (RDON_EXISTS << 16),
(void *)offsetof(redirect_router_options_block, bit_options) },
{ "forbid_filter_logwrite",opt_bit | (RDON_LOG << 16),
"%sone of \"file\" or \"data\" must be specified",
rblock->name, (ob->file == NULL)? "" : "only ");
-/* Onetime aliases can only be real addresses. Headers can't be manipulated. */
+/* Onetime aliases can only be real addresses. Headers can't be manipulated.
+The combination of one_time and unseen is not allowed. We can't check the
+expansion of "unseen" here, but we assume that if it is set to anything other
+than false, there is likely to be a problem. */
if (ob->one_time)
{
log_write(0, LOG_PANIC_DIE|LOG_CONFIG_FOR, "%s router:\n "
"\"headers_add\" and \"headers_remove\" are not permitted with "
"\"one_time\"", rblock->name);
+ if (rblock->unseen || rblock->expand_unseen != NULL)
+ log_write(0, LOG_PANIC_DIE|LOG_CONFIG_FOR, "%s router:\n "
+ "\"unseen\" may not be used with \"one_time\"", rblock->name);
}
/* The defaults for check_owner and check_group depend on other settings. The
if(ob->srs != NULL)
{
BOOL usesrs = TRUE;
-
+
if(ob->srs_condition != NULL)
usesrs = expand_check_condition(ob->srs_condition, "srs_condition expansion failed", NULL);
-
+
if(usesrs)
if(Ustrcmp(ob->srs, "reverse") == 0 || Ustrcmp(ob->srs, "reverseandforward") == 0)
{
uschar *res;
int n_srs;
-
+
srs_orig_recipient = addr->address;
eximsrs_init();
if(ob->srs_db)
srs_recipient = res;
eximsrs_done();
DEBUG(D_any)
- debug_printf("SRS: Recipient '%s' rewriteen to '%s'\n", srs_orig_recipient, srs_recipient);
+ debug_printf("SRS: Recipient '%s' rewritten to '%s'\n", srs_orig_recipient, srs_recipient);
}
}
#endif
if(ob->srs != NULL)
{
BOOL usesrs = TRUE;
-
+
if(ob->srs_condition != NULL)
usesrs = expand_check_condition(ob->srs_condition, "srs_condition expansion failed", NULL);
-
+
if(usesrs)
if((Ustrcmp(ob->srs, "forward") == 0 || Ustrcmp(ob->srs, "reverseandforward") == 0) && !verify)
{
uschar *res;
uschar *usedomain;
int n_srs;
-
+
srs_orig_sender = sender_address;
eximsrs_init();
if(ob->srs_db)
if(ob->srs_alias != NULL ? (usedomain = expand_string(ob->srs_alias)) == NULL : 1)
usedomain = deliver_domain;
-
+
if((n_srs = eximsrs_forward(&res, sender_address, usedomain)) != OK)
return n_srs;
sender_address = res;