procmail
[Top] [All Lists]

Re: Attachment Filtering

2002-04-15 13:28:17
Myles Williams wrote,

| I've just set up a global /etc/procmailrc file for filtering attachments
| of (exe,pif,com,vbs...etc).  I'm using formail to send an auto-reply
| notifying the sender that we do not allow attachments of this type.
| This is fine and dandy, and works precisely how I want it to.
|
| However, if the user sends his original message to 5 recipients, he will
| get the same amount of 'notification' messages send back to him. Is
| there a way to avoid this?

Not having root privileges anywhere, I cannot test this, but here's an idea.

Procmail has to be the LDA, and it must be setuid root.

Early in /etc/procmailrc, before you use DROPPRIVS, use a duplicate detection
recipe (see the man pages for examples) to see if the Message-Id: has come
through there before.  Since various users' mail will all have to share the
same cache file of Message IDs, this has to be done while procmail still has
root privileges; if all users have write access to the cache, someone will
find it and screw with it.

If a message has a forbidden attachment type, test its ID against the cache.
If the ID is already in there, don't send the autoresponse.  If the ID was
not previously there (formail -D will add it), send it.  Just use a -f option
to $SENDMAIL so that it doesn't come from root (unless you want it to) ...
you might want to plug postmaster as its envelope sender and into its From:
header.





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