[Mimedefang] Thought I should share this - Reduced Junk traffic with md_check_against_smtp_server

Matthew Schumacher matt.s at aptalaska.net
Fri Mar 11 15:12:31 EST 2005


Larry Starr wrote:
> Having received requests, off list, for my solution, I'm posting it for 
> whoever want's it
> Note:  
> 1.   "<my internal server>" - should be the name of the machine that your are 
> relaying for i.e. "internalserver.mydomain.com"
> 2.   The RE for setting $relay "mshould be your mail domain "mydom.com
>       should, of course be your domain "\bmydomain\.com\b"
> 3.    "myfqdn"  should be the name of the server running mimedefang
> 	i.e "mail.mydomain.com"
> 

Larry,

Here is how I do it:

sub filter_initialize {

   require DB_File;
   use Fcntl;
   tie %relaydomains, "DB_File", "/etc/mail/mailertable.db", O_RDONLY;

}

sub filter_recipient {

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

   ($user,$domain) = split /\@/, $recip;

   if( $relaydomains{$domain} =~ /^smtp:\[(.+)\]/){
     return md_check_against_smtp_server($sender, $recip, 
"filter.domain.com", $1);
   } else {
     return ("CONTINUE", "OK");
   }

}

This is causes mimedefang to md_check_against_smtp_server() on all relay 
domains listed in your mailertable.

schu



More information about the MIMEDefang mailing list