[Mimedefang] Perl and Content Filtering...
    Kozloski, Matthew 
    matthew.kozloski at strus.com
       
    Wed Feb  6 14:56:05 EST 2002
    
    
  
First of all, I would really like to thank all you folks that post replies
to this group, I have found it to be a wonderful resource, so thanks :).
Now, for my question...  Keeping in mind that I haven't had _that_ much
experience with perl, I am having a problem scanning for multiple words,
this works (badword):
open(IN_BODY, "<$bodytest") or return 0;
                while(<IN_BODY>){
                                if($_ =~ /(MIMEDefang Administrator)/i) {
return action_accept(); }
                                if($_ =~ /(badword)/i) {
                                foreach $recip (@Recipients) {
delete_recipient($recip); }
                                return action_quarantine($entity, "This
message has been quarantined due to its content, please see the messag
e for more details.\n");
                                }
                        }
This doesn't work (by saying that, I mean it "technically" works, but it
starts returning things that, to me, have no relevance to the bad words).
Am I using the correct syntax to separate the words?:
open(IN_BODY, "<$bodytest") or return 0;
                while(<IN_BODY>){
                                if($_ =~ /(MIMEDefang Administrator)/i) {
return action_accept(); }
                                if($_ =~
/(badword|realbadword|reallyreallybadword)/i) {
                                foreach $recip (@Recipients) {
delete_recipient($recip); }
                                return action_quarantine($entity, "This
message has been quarantined due to its content, please see the messag
e for more details.\n");
                                }
                        }
Thanks in advance, Matt
    
    
More information about the MIMEDefang
mailing list