procmail
[Top] [All Lists]

Recipe for Blocking VBS Files with Procmail

2000-11-30 12:22:03
Greetings All,

I am trying to develop a recipe that blocks messages containing .vbs attachments from being delivered to users on the system. The recipe that I have to date works well with all incoming mail, except for attachments sent with Microsoft Outlook. The reason for this appears to be in the way Outlook formats MIME attachment headers compared with other mail clients (header example follows).

Outlook MIME Attachment Header
=====================================
Content-Type: application/octet-stream;
        name="myvbsfile.vbs"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
        filename="myvbsfile.vbs"

Other Mail Client MIME Attachment Header
=====================================
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: attachment; filename="myvbsfile.vbs"

As shown above, Outlook moves the "filename=" descriptor to the next line, which limits the effectiveness of my current recipe (please see my recipe below). Can anyone suggest modifications that I can make to my recipe such that I can block .vbs attachments sent in Outlook?

Thank you in advance.

My Current Procmail Recipe To Block .VBS
=====================================
:0
* ! ^FROM_DAEMON
* ! ^X-Loop: vbsfilter
* 9876543210^0      ^Content-[-a-z0-9_]+:.*="?[^"]*\.vbs
* 9876543210^0 B ?? ^Content-[-a-z0-9_]+:.*($   ].*)*="?[^"]*\.vbs
| (formail -r \
        -i"Subject: Returned email - file type rejected" \
        -A"X-Loop: vbsfilter" ; \
        echo "*************************************************" ; \
        echo "*     This is a computer-generated response     *" ; \
        echo "*************************************************" ; \
        echo ; \
        echo ".VBS file type rejected -" ; \
        echo "If you must send this file via email use ZIP to compress it" ; \
        echo "Thanks.") \
| /usr/sbin/sendmail -t
/dev/null

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>