[Mimedefang] filter based on From/To headers?
    kamal 
    kamalnee at iitk.ac.in
       
    Wed May  5 15:05:29 EDT 2004
    
    
  
> I need to check for 'invalid' From and To headers in our inbound email
> (primarily to catch spam that inserts 'JUNK at mail_server_hostname' into
> either header.)  Does anyone have an example of how they did this or
> pointers on where to wedge it in?
open FH, "<HEADERS" or md_syslog("warning","couldn't open headers file");
my($from);
while(<FH>){
	if($_ =~ /^from:/i){
		$from=substr($_,5);
		last;
	}
}
$from contains the from address including name, similarly you can to for 
To header
    
    
More information about the MIMEDefang
mailing list