Skip to main content

Enable the DSN extensions

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.

HELO context
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():

EOD context
foreach ($recipients as $recipient)
$mail->queue(
$sender,
$recipient["address"],
$recipient["transportid"],
[
"dsn" => [
"envid" => xtext_decode($transaction["senderparams"]["ENVID"] ?? ""),
"ret" => str_upper($transaction["senderparams"]["RET"] ?? ""),
"notify" => str_upper($recipient["params"]["NOTIFY"] ?? ""),
"orcpt" => xtext_decode($recipient["params"]["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).

Pre-delivery context
Try(["dsn" => ["success" => "delivered"]]);