[Mimedefang] Checking for a valid sender

Alan Madill amadill at hwy16.com
Tue Nov 18 08:41:06 EST 2003


For a while I was bouncing mail identified as spam by SA.  (I know,  
bad idea because it all comes bouncing back again.) 

A large percentage of spam has a fake from address.  Has anyone  
tried using md_check_against_smtp_server to test the senders  
address? 

sub filter_sender { 
	my ($sender, $ip, $hostname, $helo) = @_; 
	$supposedsender = $sender; 
 	$sender =~ s/[<>]//g; 
	$sender =~ /^(.*)\@(.*)/; 
	$supposedserver = $2; 
	return md_check_against_smtp_server( 
		"<postmaster\@mydomain.com>", 
		$supposedsender, 
		"mail.mydomain.com", 
		$supposedserver); 
} 

I haven't tested it yet and the perl wizards can probably get that 
down to  2 lines. :-) 

-- 
Alan Madill - Aspen House Systems
250 567-4200



More information about the MIMEDefang mailing list