X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/a29e5231ac02b045d8fdd5610abac3c38131366f..4263f395efd136dece52d765dfcff3c96f17506e:/src/src/transports/pipe.c diff --git a/src/src/transports/pipe.c b/src/src/transports/pipe.c index 2464abd14..15714f3f4 100644 --- a/src/src/transports/pipe.c +++ b/src/src/transports/pipe.c @@ -1,5 +1,3 @@ -/* $Cambridge: exim/src/src/transports/pipe.c,v 1.15 2010/06/05 10:04:44 pdp Exp $ */ - /************************************************* * Exim - an Internet mail transport agent * *************************************************/ @@ -41,6 +39,8 @@ optionlist pipe_transport_options[] = { (void *)offsetof(pipe_transport_options_block, escape_string) }, { "freeze_exec_fail", opt_bool, (void *)offsetof(pipe_transport_options_block, freeze_exec_fail) }, + { "freeze_signal", opt_bool, + (void *)offsetof(pipe_transport_options_block, freeze_signal) }, { "ignore_status", opt_bool, (void *)offsetof(pipe_transport_options_block, ignore_status) }, { "log_defer_output", opt_bool | opt_public, @@ -111,6 +111,7 @@ pipe_transport_options_block pipe_transport_option_defaults = { 60*60, /* timeout */ 0, /* options */ FALSE, /* freeze_exec_fail */ + FALSE, /* freeze_signal */ FALSE, /* ignore_status */ FALSE, /* permit_coredump */ FALSE, /* restrict_to_path */ @@ -960,11 +961,20 @@ if ((rc = child_close(pid, timeout)) != 0) /* Either the process completed, but yielded a non-zero (necessarily positive) status, or the process was terminated by a signal (rc will contain the negation of the signal number). Treat killing by signal as failure unless - status is being ignored. */ + status is being ignored. By default, the message is bounced back, unless + freeze_signal is set, in which case it is frozen instead. */ else if (rc < 0) { - if (!ob->ignore_status) + if (ob->freeze_signal) + { + addr->transport_return = DEFER; + addr->special_action = SPECIAL_FREEZE; + addr->message = string_sprintf("Child process of %s transport (running " + "command \"%s\") was terminated by signal %d (%s)%s", tblock->name, cmd, + -rc, os_strsignal(-rc), tmsg); + } + else if (!ob->ignore_status) { addr->transport_return = FAIL; addr->message = string_sprintf("Child process of %s transport (running "