procmail
[Top] [All Lists]

Re: procmail executable attachment filtering.

2001-08-12 10:44:04


<

On Sun, 12 Aug 2001, Gregory Berardi wrote:

I would like to see a filter like this too.

I would like the original email to reach the destination without the
attachment with a note that the attachment had been removed.

The suggestion by Jan;

:0 B:
* ^Content-Type: application/octet-stream; name=.*\.exe.*
/dev/null

would bitbucket the whole email which is not the desired effect.

Does anyone have a filter that would do this?

-greg

Hi I got this one. its not perfect sinc it doesnt send the name of the
file to the reciever.. But...

<snip>
:0
* 9876543210^0  ^Content-[-a-z0-9_]+:.*="?[^"]*\.(vb[se]|ws[fh]|hta|shs|exe|jpg)
* 9876543210^0 B ?? ^Content-[-a-z0-9_]+:.*($[  
].*)*="?[^"]*\.(vb[se]|exe|ws[fh]|h$|jpg)
*!^X-Loop: TO_=`formail -zxTo:`
{
TO_=`formail -zxTo:`
SUBJ_=`formail -zxSubject:`
FROM_=`formail -rtzxTo:`
:0 fw
|metamail -q -x -w > /dev/null
:0 fwh
| (formail -r -A"X-Loop: micke(_at_)localhost" \
-I"To: micke(_at_)localhost" \
-I"Subject: Attachment.." \
-I"From: $FROM_"; \
echo ""; \
echo "Det var till $TO_"; \
echo "Sparat i : $METAMAIL_TMPDIR "; \
echo " $FROM_ Skickade det..   Rubriken var $SUBJ_"; \
echo "") \
| $SENDMAIL $SENDMAILFLAGS -t
}
<snip>
Maybee someone can fix it better!1

/M

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