diff options
author | Philip Hazel <ph10@hermes.cam.ac.uk> | 2006-04-20 14:11:29 +0000 |
---|---|---|
committer | Philip Hazel <ph10@hermes.cam.ac.uk> | 2006-04-20 14:11:29 +0000 |
commit | f7fd3850601c141d3a8d5b9cc6e6403f623923ae (patch) | |
tree | 692317e12f7df5ef5b00e2bf3d45c8bf08d3c659 /src | |
parent | dd16e114db70592df34e8b9ee4a05dae69aaba43 (diff) |
Make batch delivery work for files and pipes set up by redirection.
Diffstat (limited to 'src')
-rw-r--r-- | src/src/deliver.c | 25 | ||||
-rw-r--r-- | src/src/transports/appendfile.c | 13 |
2 files changed, 27 insertions, 11 deletions
diff --git a/src/src/deliver.c b/src/src/deliver.c index 0cb0132c4..a80d97842 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/deliver.c,v 1.30 2006/03/01 16:07:16 ph10 Exp $ */ +/* $Cambridge: exim/src/src/deliver.c,v 1.31 2006/04/20 14:11:29 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -228,11 +228,18 @@ if (addr->next == NULL) } /* For multiple addresses, don't set local part, and leave the domain and -self_hostname set only if it is the same for all of them. */ +self_hostname set only if it is the same for all of them. It is possible to +have multiple pipe and file addresses, but only when all addresses have routed +to the same pipe or file. */ else { address_item *addr2; + if (testflag(addr, af_pfr)) + { + if (testflag(addr, af_file)) address_file = addr->local_part; + else if (addr->local_part[0] == '|') address_pipe = addr->local_part; + } for (addr2 = addr->next; addr2 != NULL; addr2 = addr2->next) { if (deliver_domain != NULL && @@ -2119,15 +2126,17 @@ while (addr_local != NULL) disable_logging = tp->disable_logging; - /* Check for batched addresses and possible amalgamation. File deliveries can - never be batched. Skip all the work if either batch_max <= 1 or there aren't - any other addresses for local delivery. */ + /* Check for batched addresses and possible amalgamation. Skip all the work + if either batch_max <= 1 or there aren't any other addresses for local + delivery. */ - if (!testflag(addr, af_file) && tp->batch_max > 1 && addr_local != NULL) + if (tp->batch_max > 1 && addr_local != NULL) { int batch_count = 1; BOOL uses_dom = readconf_depends((driver_instance *)tp, US"domain"); - BOOL uses_lp = readconf_depends((driver_instance *)tp, US"local_part"); + BOOL uses_lp = (testflag(addr, af_pfr) && + (testflag(addr, af_file) || addr->local_part[0] == '|')) || + readconf_depends((driver_instance *)tp, US"local_part"); uschar *batch_id = NULL; address_item **anchor = &addr_local; address_item *last = addr; @@ -2156,6 +2165,7 @@ while (addr_local != NULL) same transport not previously delivered (see comment about 50 lines above) same local part if the transport's configuration contains $local_part + or if this is a file or pipe delivery from a redirection same domain if the transport's configuration contains $domain same errors address same additional headers @@ -2169,6 +2179,7 @@ while (addr_local != NULL) BOOL ok = tp == next->transport && !previously_transported(next, TRUE) && + (addr->flags & (af_pfr|af_file)) == (next->flags & (af_pfr|af_file)) && (!uses_lp || Ustrcmp(next->local_part, addr->local_part) == 0) && (!uses_dom || Ustrcmp(next->domain, addr->domain) == 0) && same_strings(next->p.errors_address, addr->p.errors_address) && diff --git a/src/src/transports/appendfile.c b/src/src/transports/appendfile.c index 7a415de7a..090951969 100644 --- a/src/src/transports/appendfile.c +++ b/src/src/transports/appendfile.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/transports/appendfile.c,v 1.14 2006/03/01 11:24:04 ph10 Exp $ */ +/* $Cambridge: exim/src/src/transports/appendfile.c,v 1.15 2006/04/20 14:11:29 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -1333,10 +1333,15 @@ if (path[0] != '/') return FALSE; } -/* For a file delivery, make sure the local part in the address is updated to -the true local part. */ +/* For a file delivery, make sure the local part in the address(es) is updated +to the true local part. */ -if (testflag(addr, af_file)) addr->local_part = string_copy(path); +if (testflag(addr, af_file)) + { + address_item *addr2; + for (addr2 = addr; addr2 != NULL; addr2 = addr2->next) + addr2->local_part = string_copy(path); + } /* The available mailbox formats depend on whether it is a directory or a file delivery. */ |