Milter to reject mail whose sender domain publishes a null mx record
use Mail::Milter::Module::MailDomainDotMX;
my $milter = new Mail::Milter::Module::MailDomainDotMX;
my $milter2 = &MailDomainDotMX; # convenience
$milter2->set_message('Mail from %M domain invalid (has dot-MX record)');
This milter module rejects any mail from a sender's domain (in the \s-1MAIL\s0 \s-1FROM\s0 part of the \s-1SMTP\s0 transaction, not in the From: header) if that domain publishes a \*(L"null\*(R", or \*(L"dot\*(R" \s-1MX\s0 record. Such a record looks like the following in \s-1DNS:\s0
example.com. IN MX 0 .
This lookup requires the Net::DNS module to be installed in order to fetch the \s-1MX\s0 record.
An extra check as to whether the \s-1MX\s0 is valid is not (yet) done here. It is currently assumed that the \s-1MTA\s0 does rudimentary checking for the presence of a valid \s-1MX\s0 or A record on the sending domain.
Creates a MailDomainDotMX object. There are no arguments to configure this module, as it is a fixed check.
If \s-1FLAG\s0 is 0 (the default), a \s-1DNS\s0 lookup which fails the underlying \s-1DNS\s0 query will cause the milter to return a temporary failure result (\s-1SMFIS_TEMPFAIL\s0). If \s-1FLAG\s0 is 1, a temporary \s-1DNS\s0 failure will be treated as if the lookup resulted in an empty record set (\s-1SMFIS_CONTINUE\s0). This method returns a reference to the object itself, allowing this method call to be chained.
Sets the message used when rejecting messages. This string may contain the substring %M, which will be replaced by the matching e-mail address. This method returns a reference to the object itself, allowing this method call to be chained.
Todd Vierling, <[email protected]> <[email protected]>
Mail::Milter::Object