- from_address = string_sprintf("postmaster@%s", qualify_domain_sender);
- address_key = string_sprintf("%s/<postmaster@%s>", addr->address,
- qualify_domain_sender);
+ if (options & vopt_callout_recipsender)
+ from_address = sender_address;
+ else if (options & vopt_callout_r_tptsender)
+ {
+ transport_instance * tp = addr->transport;
+ from_address = addr->prop.errors_address
+ ? addr->prop.errors_address : sender_address;
+ DEBUG(D_verify)
+ debug_printf(" return-path from routed addr: %s\n", from_address);
+
+ GET_OPTION("return_path");
+ if (tp->return_path)
+ {
+ uschar * new_return_path = expand_string(tp->return_path);
+ if (new_return_path)
+ from_address = new_return_path;
+ else if (!f.expand_string_forcedfail)
+ return DEFER;
+ DEBUG(D_verify)
+ debug_printf(" return-path from transport: %s\n", from_address);
+ }
+ }
+ else /* if (options & vopt_callout_recippmaster) */
+ from_address = string_sprintf("postmaster@%s", qualify_domain_sender);
+
+ address_key = string_sprintf("%s/<%s>", addr->address, from_address);
+ addr->return_path = from_address; /* for cutthrough logging */
+ if (cutthrough.delivery) /* cutthrough previously req. */
+ options |= vopt_callout_no_cache; /* in case called by verify= */