It's somewhat common check if a sender domain exists before accepting mail. This check is technically backed by the standard[1] however in practice it is prune to false-positives, so we can't fully endorse this method of anti-spam prevention. The standard argues that since mail should be transactionally safe, the return/sender address has to be valid so that non-delivered mail can be returned to the sender.
if ($senderdomain != "") {
$dnsa = dns($senderdomain, ["extended_result" => true]);
$dnsmx = dnsmx($senderdomain, ["extended_result" => true]);
if ($dnsa["error"] == "NXDOMAIN" and $dnsmx["error"] == "NXDOMAIN") {
Reject("$senderdomain doesn't exist");
}
}
This check, can be done in the MAIL FROM context or at any later stage.
Comments
0 comments
Article is closed for comments.