[Mimedefang] MX ->

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

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
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

  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.


More information about the MIMEDefang mailing list