const uschar * save_address = deliver_host_address;
const int save_port = deliver_host_port;
-if (!addr->transport)
- return;
-
router_name = addr->router ? addr->router->name : NULL;
-transport_name = addr->transport->name;
deliver_domain = addr->domain;
deliver_localpart = addr->local_part;
deliver_host = addr->host_used ? addr->host_used->name : NULL;
-(void) event_raise(addr->transport->event_action, event,
- 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);
+if (!addr->transport)
+ {
+ if (Ustrcmp(event, "msg:fail:delivery") == 0)
+ {
+ /* An address failed with no transport involved. This happens when
+ a filter was used which triggered a fail command (in such a case
+ a transport isn't needed). Convert it to an internal fail event. */
+
+ (void) event_raise(event_action, US"msg:fail:internal", addr->message);
+ }
+ }
+else
+ {
+ transport_name = addr->transport->name;
+
+ (void) event_raise(addr->transport->event_action, event,
+ 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;
deliver_host_address = save_address;
often bigger) so even if we are reading while the subprocess is still going, we
should never have only a partial item in the buffer.
-hs12: This assumption is not true anymore, since we got quit large items (certificate
-information and such)
+hs12: This assumption is not true anymore, since we get quite large items (certificate
+information and such).
Argument:
poffset the offset of the parlist item
search_tidyup();
-
if ((pid = fork()) == 0)
{
int fd = pfd[pipe_write];
host_item *h;
- DEBUG(D_deliver) debug_selector |= D_pid; // hs12
/* Setting this global in the subprocess means we need never clear it */
transport_name = tp->name;
it is obtained from a command line (the -M or -q options), and otherwise it is
known to be a valid message id. */
-Ustrcpy(message_id, id);
+if (id != message_id)
+ Ustrcpy(message_id, id);
f.deliver_force = forced;
return_count = 0;
message_size = 0;