[Mimedefang] Need Tip on Filter

Peter A. Cole peteracole at bigpond.com
Sun Mar 21 06:21:57 EST 2004


On Sun, 21 Mar 2004 00:00:17 -0600
Michael Sims <michaels at crye-leike.com> wrote:

> Try this in filter_end (untested):
> 
>   open(HEADERS, '< ./HEADERS');
>   while (<HEADERS>) {
>     if (/^X-Telstra-AS-Scanner: .*?, (.*?)% /i
>         && $1 >= 90) {
> 
>       delete_recipient($_) foreach (@Recipients);
>       add_recipient('spamdrop at example.com');
>       last;
>     }
>   }
>   close(HEADERS);
> 
> ___________________________________________
> Michael Sims

Hi again Michael (and anybody else who has interest in this thread),

So far, this seems to be successful in that it doesn't cause any dramas for legitimate mail coming in. I haven't received any with the applicable headers yet to be sure if it gets rid of the spam though.

However, I also want to add in a section to get rid of mail with the "X-Habeas-SWE" type headers as they also only appear to be spam, but my ISP for some reason seems to let them through as valid messages.

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 have, of course, substituted 'spamdrop at example.com' with my local spamdrop mailbox.

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.

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?

Thanks,

Pete



More information about the MIMEDefang mailing list