I put the new check_valid_mx into work on a production system today and
caught two small implementation changes needed with the new check_valid_mx
routine

1st, I am getting emails like <[EMAIL PROTECTED] > (NOTE the space at
the end).  So I have added to quick lines to strip leading and trailing
spaces.  Should I have to do this?  Is this just a real-world oddity?  Some
examples:

Nov  4 18:56:22 intel1 mimedefang.pl[26988]: filter_sender rejected sender
<[EMAIL PROTECTED] >
Nov  4 18:56:59 intel1 mimedefang.pl[26988]: filter_sender rejected sender
<[EMAIL PROTECTED] >
Nov  4 19:06:10 intel1 mimedefang.pl[26990]: filter_sender rejected sender
<[EMAIL PROTECTED] >
Nov  4 19:08:17 intel1 mimedefang.pl[26994]: filter_sender rejected sender
<[EMAIL PROTECTED] >

2nd, to avoid filtering bounce messages, I just escaped out now to check if
$sender is <> for filter_sender.  Seems to be fine.  Anyone have comments if
this is a good/bad idea?

sub filter_sender {
  my ($sender, $ip, $hostname, $helo) = @_;
  my ($rv, $reason);
  #md_syslog('warning', "Testing $sender, $ip, $hostname, $helo");

  if ($sender ne '<>') {
    ($rv, $reason) = &check_valid_mx($sender);
    unless ($rv) {
      return ('REJECT', "Sorry; $sender has an invalid MX record:
$reason.");
      md_syslog('warning', "Rejecting $sender - Invalid MX: $reason.");
    }
  }

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

Regards,
KAM

_______________________________________________
Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list
[email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to