diff options
author | Matthias Kurz <m.kurz@irregular.at> | 2018-09-28 19:04:55 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2018-09-28 19:07:00 +0100 |
commit | ffbc20ed9c9ed09a68ff0a608f623c3c83d521a8 (patch) | |
tree | a7dfcd265ab8fe6c6b5c3a43d48aa1b1122ecfc3 /src | |
parent | eb58ddf5828a161dec94f131ff2c5c926c868354 (diff) |
Events: Fire msg:fail:delivery event even when error is being ignored. Bug 2314
Diffstat (limited to 'src')
-rw-r--r-- | src/src/deliver.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/src/deliver.c b/src/src/deliver.c index 9ab740288..bba343c55 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -890,6 +890,7 @@ deliver_host = addr->host_used ? addr->host_used->name : NULL; addr->host_used || Ustrcmp(addr->transport->driver_name, "smtp") == 0 || Ustrcmp(addr->transport->driver_name, "lmtp") == 0 + || Ustrcmp(addr->transport->driver_name, "autoreply") == 0 ? addr->message : NULL); deliver_host_port = save_port; @@ -1383,6 +1384,16 @@ failure_log(address_item * addr, uschar * driver_kind, uschar * now) void * reset_point; gstring * g = reset_point = string_get(256); +#ifndef DISABLE_EVENT +/* Message failures for which we will send a DSN get their event raised +later so avoid doing it here. */ + +if ( !addr->prop.ignore_error + && !(addr->dsn_flags & (rf_dsnflags & ~rf_notify_failure)) + ) + msg_event_raise(US"msg:fail:delivery", addr); +#endif + /* Build up the log line for the message and main logs */ /* Create the address string for logging. Must not do this earlier, because @@ -1431,10 +1442,6 @@ else log_write(0, LOG_MAIN, "** %s", g->s); -#ifndef DISABLE_EVENT -msg_event_raise(US"msg:fail:delivery", addr); -#endif - store_reset(reset_point); return; } @@ -7445,6 +7452,9 @@ while (addr_failed) addr_failed = addr->next; if (addr->return_filename) Uunlink(addr->return_filename); +#ifndef DISABLE_EVENT + msg_event_raise(US"msg:fail:delivery", addr); +#endif log_write(0, LOG_MAIN, "%s%s%s%s: error ignored", addr->address, !addr->parent ? US"" : US" <", |