From 7f45268c9e24a11001679f1e50b1ac77b43e8aa9 Mon Sep 17 00:00:00 2001 From: Philip Hazel Date: Tue, 15 Mar 2005 11:37:21 +0000 Subject: [PATCH] Forbid both "unseen" and "one_time" on redirect routers. --- doc/doc-txt/ChangeLog | 8 +++++++- src/src/acl.c | 34 +++++++++++++++++----------------- src/src/route.c | 4 +--- src/src/routers/redirect.c | 10 ++++++++-- 4 files changed, 33 insertions(+), 23 deletions(-) diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index ba0f2633c..2ad7d4c07 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.88 2005/03/09 14:41:00 tom Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.89 2005/03/15 11:37:21 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -25,6 +25,12 @@ PH/02. Installed a slightly modified version of Nikos Mavrogiannopoulos' patch means that you can't go back to an older release without removing the file. +PH/03. A redirect router that has both "unseen" and "one_time" set does not + work if there are any delivery delays because "one_time" forces the + parent to be marked "delivered", so its unseen clone is never tried + again. For this reason, Exim now forbids the simultaneous setting of + these two options. + A note about Exim versions 4.44 and 4.50 ---------------------------------------- diff --git a/src/src/acl.c b/src/src/acl.c index 70ce7368c..1d0150d5b 100644 --- a/src/src/acl.c +++ b/src/src/acl.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/acl.c,v 1.23 2005/03/09 14:36:54 tom Exp $ */ +/* $Cambridge: exim/src/src/acl.c,v 1.24 2005/03/15 11:37:21 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -94,12 +94,12 @@ static uschar *conditions[] = { US"acl", US"authenticated", US"demime", #endif #ifdef EXPERIMENTAL_DOMAINKEYS - US"dk_domain_source", - US"dk_policy", - US"dk_sender_domains", - US"dk_sender_local_parts", - US"dk_senders", - US"dk_status", + US"dk_domain_source", + US"dk_policy", + US"dk_sender_domains", + US"dk_sender_local_parts", + US"dk_senders", + US"dk_status", #endif US"dnslists", US"domains", US"encrypted", US"endpass", US"hosts", US"local_parts", US"log_message", US"logwrite", @@ -149,12 +149,12 @@ static uschar cond_expand_at_top[] = { TRUE, /* demime */ #endif #ifdef EXPERIMENTAL_DOMAINKEYS - TRUE, /* dk_domain_source */ - TRUE, /* dk_policy */ - TRUE, /* dk_sender_domains */ + TRUE, /* dk_domain_source */ + TRUE, /* dk_policy */ + TRUE, /* dk_sender_domains */ TRUE, /* dk_sender_local_parts */ - TRUE, /* dk_senders */ - TRUE, /* dk_status */ + TRUE, /* dk_senders */ + TRUE, /* dk_status */ #endif TRUE, /* dnslists */ FALSE, /* domains */ @@ -205,12 +205,12 @@ static uschar cond_modifiers[] = { FALSE, /* demime */ #endif #ifdef EXPERIMENTAL_DOMAINKEYS - FALSE, /* dk_domain_source */ - FALSE, /* dk_policy */ - FALSE, /* dk_sender_domains */ + FALSE, /* dk_domain_source */ + FALSE, /* dk_policy */ + FALSE, /* dk_sender_domains */ FALSE, /* dk_sender_local_parts */ - FALSE, /* dk_senders */ - FALSE, /* dk_status */ + FALSE, /* dk_senders */ + FALSE, /* dk_status */ #endif FALSE, /* dnslists */ FALSE, /* domains */ diff --git a/src/src/route.c b/src/src/route.c index 47d95332e..a80ecb62d 100644 --- a/src/src/route.c +++ b/src/src/route.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/route.c,v 1.4 2005/01/11 15:51:02 ph10 Exp $ */ +/* $Cambridge: exim/src/src/route.c,v 1.5 2005/03/15 11:37:21 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -1889,8 +1889,6 @@ yield = exp_bool(addr, r->name, US"unseen", r->unseen, r->expand_unseen, &unseen); if (yield != OK) goto ROUTE_EXIT; - - /* Debugging output recording a successful routing */ HDEBUG(D_route) diff --git a/src/src/routers/redirect.c b/src/src/routers/redirect.c index 90ec9de6a..461fc5d92 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.5 2005/02/17 11:58:27 ph10 Exp $ */ +/* $Cambridge: exim/src/src/routers/redirect.c,v 1.6 2005/03/15 11:37:21 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -185,7 +185,10 @@ if ((ob->file == NULL) == (ob->data == NULL)) "%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) { @@ -194,6 +197,9 @@ 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 -- 2.30.2