diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/src/deliver.c | 24 | ||||
-rw-r--r-- | src/src/exim.c | 13 | ||||
-rw-r--r-- | src/src/log.c | 6 |
3 files changed, 33 insertions, 10 deletions
diff --git a/src/src/deliver.c b/src/src/deliver.c index 41a43c80d..23875d959 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/deliver.c,v 1.20 2005/06/27 14:29:43 ph10 Exp $ */ +/* $Cambridge: exim/src/src/deliver.c,v 1.21 2005/06/28 10:23:35 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -5952,11 +5952,29 @@ set_process_info("tidying up after delivering %s", message_id); signal(SIGTERM, SIG_IGN); /* When we are acting as an MUA wrapper, the smtp transport will either have -succeeded for all addresses, or failed them all. We do not ever want to retry, -nor do we want to send a bounce message. */ +succeeded for all addresses, or failed them all in normal cases. However, there +are some setup situations (e.g. when a named port does not exist) that cause an +immediate exit with deferral of all addresses. Convert those into failures. We +do not ever want to retry, nor do we want to send a bounce message. */ if (mua_wrapper) { + if (addr_defer != NULL) + { + address_item *addr, *nextaddr; + for (addr = addr_defer; addr != NULL; addr = nextaddr) + { + log_write(0, LOG_MAIN, "** %s mua_wrapper forced failure for deferred " + "delivery", addr->address); + nextaddr = addr->next; + addr->next = addr_failed; + addr_failed = addr; + } + addr_defer = NULL; + } + + /* Now all should either have succeeded or failed. */ + if (addr_failed == NULL) final_yield = DELIVER_MUA_SUCCEEDED; else { uschar *s = (addr_failed->user_message != NULL)? diff --git a/src/src/exim.c b/src/src/exim.c index 4c8366951..5cc0cb47c 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/exim.c,v 1.21 2005/06/27 14:29:04 ph10 Exp $ */ +/* $Cambridge: exim/src/src/exim.c,v 1.22 2005/06/28 10:23:35 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -3939,12 +3939,17 @@ DEBUG(D_receive) debug_printf("originator: uid=%d gid=%d login=%s name=%s\n", /* Run in daemon and/or queue-running mode. The function daemon_go() never returns. We leave this till here so that the originator_ fields are available -for incoming messages via the daemon. */ +for incoming messages via the daemon. The daemon cannot be run in mua_wrapper +mode. */ if (daemon_listen || queue_interval > 0) { - if (mua_wrapper) log_write(0, LOG_MAIN|LOG_PANIC_DIE, "Daemon cannot be " - "run when mua_wrapper is set"); + if (mua_wrapper) + { + fprintf(stderr, "Daemon cannot be run when mua_wrapper is set\n"); + log_write(0, LOG_MAIN|LOG_PANIC_DIE, "Daemon cannot be run when " + "mua_wrapper is set"); + } daemon_go(); } diff --git a/src/src/log.c b/src/src/log.c index a014befb7..1427bd061 100644 --- a/src/src/log.c +++ b/src/src/log.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/log.c,v 1.5 2005/06/27 14:29:43 ph10 Exp $ */ +/* $Cambridge: exim/src/src/log.c,v 1.6 2005/06/28 10:23:35 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -997,11 +997,11 @@ if ((flags & LOG_PROCESS) != 0) /* Handle the panic log, which is not kept open like the others. If it fails to open, there will be a recursive call to log_write(). We detect this above and attempt to write to the system log as a last-ditch try at telling somebody. In -all cases, try to write to log_stderr. */ +all cases except mua_wrapper, try to write to log_stderr. */ if ((flags & LOG_PANIC) != 0) { - if (log_stderr != NULL && log_stderr != debug_file) + if (log_stderr != NULL && log_stderr != debug_file && !mua_wrapper) fprintf(log_stderr, "%s", CS log_buffer); if ((logging_mode & LOG_MODE_SYSLOG) != 0) |