[Mimedefang] MX -> 127.0.0.1

Kevin A. McGrail kmcgrail at pccc.com
Tue Oct 11 11:58:26 EDT 2005


We have added the check_primary_mx for senders to our filter with good
success and I've added this feature to
http://www.peregrinehw.com/downloads/MIMEDefang/mimedefang-filter-KAM


To use this in your own filter, make sure you have use Net::DNS in a sub
filter_initialize in your mimedefang filter.

Then, add the subroutines from
http://www.peregrinehw.com/downloads/MIMEDefang/contrib/check_primary_mx_stub.pl
to your filter.

Next, modify or create a filter_sender function:

sub filter_sender {
  my ($sender, $ip, $hostname, $helo) = @_;

  unless (&check_primary_mx($sender)) {
    return ('REJECT', "Sorry; $sender has an invalid MX record.");
    md_syslog('warning', "Rejecting $sender email due to invalid MX record
test.");
  }

  return ('CONTINUE', "ok");
}


Finally, make sure you have sender filtering turned on.  With my
installation, I edit /etc/sysconfig/mimedefang and change the line for
MX_SENDER_CHECK=yes.  I believe this equates to sending a -s to the
mimedefang daemon.

Regards,
KAM




More information about the MIMEDefang mailing list