[Mimedefang] Code fragment works only sometimes

Andrea Venturoli ml.ventu at flashnet.it
Sun Jul 13 00:37:01 EDT 2003


I'm quite new to MIMEDefang, and know little of perl (I'm a C++ programmer).
I installed MIMEDefang in its deafult configuration, tried it out and then, after a while, modified
/usr/local/etc/mimedefang/mimedefang-filter by adding the following fragment to the end of filter_begin:

    if (open(HDR,"HEADERS")&&open(BLK,"/usr/local/netfence/local/etc/spam_recipients"))
        @lines=<HDR>; @blk=<BLK>;
        foreach $line (@lines)
            foreach $blk (@blk)
                if (rindex($line,$blk)!=-1)
                    return action_bounce("Spam is not accepted");

What I'm trying to do is look for specific strings in the headers and bounce the message back if any is found.
This works sometimes, but sometimes not: the string is there, but I get the message anyway.
What am I doing wrong?
I guess the problem is with action_bounce, but I'm not sure if and why.

 bye & Thanks

P.S. Sorry if this is a stupid question, forgive my "newby-ness" :) If I need to provide more informations, I'm
obviously willing to do so.

More information about the MIMEDefang mailing list