Home > Archive > alt.os.linux > October 2002 > procmail file attachment detect





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author procmail file attachment detect
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

Chris Lowth

2002-10-04, 4:25 am

Bill K wrote:

> 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?


Try "protector" at http://protector.sourceforge.net

Chris
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net