[Mimedefang] Merging MXs, but Excluding domains

Paul Murphy pjm at ousekjarr.org
Mon Nov 21 16:40:33 EST 2005


Ashley,

One possibility:

Enable filter_recipient() and stream_by_recipient (just in case someone mails
a user in two domains you host which are normally dealt with separately), and
then have it check the recipient domain against a list of domains to be
skipped (NB: untested code snippet!):

sub filter_recipient ($$$$$$$$$) {

my($recipient, $sender, $ip, $hostname, $first, $helo, $rcpt_mailer,
$rcpt_host
, $rcpt_addr) = @_;

# domains to be skipped - explicit or built from a file/DB
$SkipDomain{'test.com'}=1;
$SkipDomain{'test2.org'}=1;

my $recip=lc($recipient);
$recip=~ s/[<>]//g;	# get rid of brackets
my @parts = split(/@/, $recip);	# extract domain part
my $dom = lc($parts[1]);	# store domain part in lower case
If (exists($SkipDomain{dom})) {
  return ('ACCEPT_AND_NO_MORE_FILTERING', "ok");                           
  }
...
(other processing if required)
...
Return('CONTINUE',"ok");
}

Best Wishes,

Paul.




More information about the MIMEDefang mailing list