procmail
[Top] [All Lists]

Re: Attachments filter - newbie

2003-05-23 07:37:32
At 08:49 2003-05-23 +0100, Kenny Jarman did say:
I have this procmail filter for stopping "dangerous" attachments:-

:0w B:

The B flag is inappropriate here - the FROM_DAEMON and X-Loop are in the HEADERS, not the body.

* ! ^FROM_DAEMON
* !^X-Loop: virusfilter
* ^Content-Transfer-Encoding: base64
* name=.*\.(pif|bat|vbs|js)

* HB ?? ^Content-Transfer-Encoding: base64
* HB ?? name=.*\.(pif|bat|vbs|js)

| ($FORMAIL -r \
        -i"From: post(_at_)mydomain(_dot_)com" \
        -i"Subject: Returned email - file type rejected" \
        -A"X-Loop: virusfilter" ; \
        echo "This is an automated reponse .. blah ...blah")  \
| $SENDMAIL

I'd advise that you indent that last line - as presented, it may give the incorrect impression that there are separate action lines (yea, I know the immediatley preceeding line has a continuation on it, but a quick glance at the rcfile makes it appear that sendmail is the action, rather than formail).

Question - what actually happens to the email?!

You're discarding it.

  - I've tried putting
/dev/null or a mailbox onto the end of the filter but it is always
"skipped"

Have you defined $FORMAIL?

Also, how do I avoid "Couldn't determine implicit lockfile" ?

Er, specify an EXPLICIT one after the trailing colon on the flags line? However, there's absolutely no need for a lockfile - you're not outputting to a file.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


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