[Mimedefang] scanning message body

Matthew Simpson matthew at symatec-computer.com
Fri Mar 19 11:24:10 EST 2004


I need some quick help scanning the message body for URLs and certain HTML
tags.  I wrote the following code which works fine standalone, but it is not
working inside my mimedefang-filter [standalone it finds the offending
tag/url, inside my filter it lets the mail go through]:

if(open(EM, "<ENTIRE_MESSAGE")) {
              while (<EM>) {
                if(/<object/i)
                {
                        close(EM);
                        action_notify_administrator("Message $Subject
dropped because contained object tag.");
                        action_discard();
                        return;
                }
              }
        }

I have this code in my filter_begin function.

That if statement is supposed to drop the message and notify the admin if an
<OBJECT tag is found.

If there's a better way to do this, please let me know.



More information about the MIMEDefang mailing list