Halon MTA supports the DSN extensions (RFC 3461). It's possible to store, forward or act upon the DSN extensions parameters. Halon MTA doesn't automatically announce the DSN extension in the EHLO reply. Instead that has to be done using a HELO script.
Accept([ "extensions" => [...$arguments["extensions"] ?? , "DSN"] ]);
This will allow clients to send MAIL FROM and RCPT TO parameters such as ENVID, RET, NOTIFY and ORCPT. These parameters will be available in the sender or recipient parameters (as any other parameters that you could receive). These parameters may be passed on to queue():
foreach ($recipients as $recipient) $mail->queue( $sender, $recipient["address"], $recipient["transportid"], [ "dsn" => [ "envid" => xtext_decode($senderparams["ENVID"] ?? ""), "ret" => str_upper($senderparams["RET"] ?? ""), "notify" => str_upper($recipientparams["NOTIFY"] ?? ""), "orcpt" => xtext_decode($recipientparams["ORCPT"] ?? "") ] ] );
If these parameters are specified when queuing the email (or given to the Try() function in the pre-delivery script), the sending SMTP client will behave according to the DSN RFC. For example, if SUCCESS notifications are requested, the SMTP client may either forward the DSN extension or send a delivered or relayed notification back to the client (depending on if the delivery is final or not).
Try(["dsn" => ["success" => "delivered"]]);