| Bill K 2002-10-03, 3:25 pm |
| Hello all,
On a Red Hat Linux box...
I have a simple procmail script that looks for any email messages with
bat, exe, js, msi, pif, scr, vb, vbs file-attachments coming in and
forwards them to a different email account. It does this by looking
for
"name=*.bat" etc. Here is the script I use:
SHELL=/bin/sh
PATH="$HOME/bin:/usr/bin:/usr/local/bin:/usr/include:/usr/local/sbin:/bin:/sbin:/usr/sbin"
:0B
*
..*name=.*\. ([Bb][Aa][Tt]|[Ee][Xx][Ee]|[Jj
][Ss]|[Mm][Ss][Ii]|[Pp][Ii][Ff
]|[Ss][Cc][Rr]|[Vv][Bb]|[Vv][B
b][Ss]).*
! prog_file@billism\.com
It works great most of the time, but sometimes, it will catch an email
that doesn't actually have a file attached to it. IE: If the email has
a
line like this in it, EXAMPLE:
-------------- start examlpe -------------->8
<INPUT TYPE=text NAME=file_name> look at this site www.blah.com
--------------- end examlpe --------------->8
Notice the "NAME=" and ".com" on the same line. This causes a false
positive.
Is there a better way to detect a certain file extension on a file
attachment with procmail, and exclude a search of the email body?
Thanks in advance for any help!
-Bill K
please reply to: news@billism.com
|