[Mimedefang] Need Tip on Filter

Michael Sims michaels at crye-leike.com
Sun Mar 21 10:41:18 EST 2004


Peter A. Cole wrote:
> I have added the following lines to my mimedefang-filter, between the
> two } curly brackets at the end, which I assume would include it in
> the "while (<HEADERS>) {" routine:  
> 
> if (/^X-Habeas-SWE) {
>   delete_recipient($_) foreach (@Recipients);
>   add_recipient('spamdrop at example.com');
>   last;
> }
[...]
> I thought that this would work, but when I run mimedefang.pl -test,
> it comes up with errors about bare text and missing curly brackets
> etc., so obviously it is not correct.

Your regex pattern isn't terminated.  You need a "/" at the end of it.

> Can anyone enlighten me as to what I have done wrong or tell me how I
> can add an "or" type statement into the first part Michael has
> provided?  

Here ya go:

  open(HEADERS, '< ./HEADERS');
  while (<HEADERS>) {
    if (/^X-Habeas-SWE/i 
        || (/^X-Telstra-AS-Scanner: .*?, (.*?)% /i 
            && $1 >= 90)) {

      delete_recipient($_) foreach (@Recipients);
      add_recipient('spamdrop at example.com');
      last;
    }
  }
  close(HEADERS);

___________________________________________
Michael Sims
Project Analyst - Information Technology
Crye-Leike Realtors
Office: (901)758-5648  Pager: (901)769-3722
___________________________________________



More information about the MIMEDefang mailing list